Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Jordan <bjordan@wireless-19-111.media.mit.edu>2008-09-10 18:44:31 (GMT)
committer Brian Jordan <bjordan@wireless-19-111.media.mit.edu>2008-09-10 18:44:31 (GMT)
commit16220712fa096765e156c623da589ab34374e074 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904
parente13ac655d021ca8ebc91f204da94cc8c41d95050 (diff)
Delete.
-rw-r--r--AUTHORS8
-rw-r--r--LICENSE339
-rw-r--r--MANIFEST3174
-rwxr-xr-xNEWS49
-rwxr-xr-x_wp.sobin118963 -> 0 bytes
-rw-r--r--activity.py68
-rw-r--r--activity/activity-help.svg11
-rw-r--r--activity/activity.info6
-rwxr-xr-xbin/blahtexbin1204424 -> 0 bytes
-rwxr-xr-xbin/tidybin301996 -> 0 bytes
-rw-r--r--bin/tidy.conf7
-rw-r--r--blahtexml/GNU-FDL397
-rw-r--r--blahtexml/GNU-GPL340
-rw-r--r--blahtexml/HTML+Blahtex.xml22
-rw-r--r--blahtexml/HTML+MathML.xml20
-rw-r--r--blahtexml/ISTtoTeX.xslt50
-rw-r--r--blahtexml/InputSymbolTranslation.tex694
-rw-r--r--blahtexml/README33
-rw-r--r--blahtexml/example1.xml5
-rw-r--r--blahtexml/example2.xml5
-rw-r--r--blahtexml/example3.xml5
-rw-r--r--blahtexml/example4.xml4
-rw-r--r--blahtexml/logo.pngbin29600 -> 0 bytes
-rw-r--r--blahtexml/makefile145
-rw-r--r--blahtexml/manual.tex1857
-rw-r--r--blahtexml/source/BlahtexCore/ISTtoCpp.xslt46
-rw-r--r--blahtexml/source/BlahtexCore/InputSymbolTranslation.cpp55
-rw-r--r--blahtexml/source/BlahtexCore/InputSymbolTranslation.h33
-rw-r--r--blahtexml/source/BlahtexCore/InputSymbolTranslation.inc344
-rw-r--r--blahtexml/source/BlahtexCore/InputSymbolTranslation.xml367
-rw-r--r--blahtexml/source/BlahtexCore/Interface.cpp63
-rw-r--r--blahtexml/source/BlahtexCore/Interface.h90
-rw-r--r--blahtexml/source/BlahtexCore/LayoutTree.cpp1677
-rw-r--r--blahtexml/source/BlahtexCore/LayoutTree.h670
-rw-r--r--blahtexml/source/BlahtexCore/MacroProcessor.cpp332
-rw-r--r--blahtexml/source/BlahtexCore/MacroProcessor.h125
-rw-r--r--blahtexml/source/BlahtexCore/Manager.cpp553
-rw-r--r--blahtexml/source/BlahtexCore/Manager.h127
-rw-r--r--blahtexml/source/BlahtexCore/MathmlNode.cpp330
-rw-r--r--blahtexml/source/BlahtexCore/MathmlNode.h173
-rw-r--r--blahtexml/source/BlahtexCore/Misc.h222
-rw-r--r--blahtexml/source/BlahtexCore/ParseTree.h896
-rw-r--r--blahtexml/source/BlahtexCore/ParseTree1.cpp1290
-rw-r--r--blahtexml/source/BlahtexCore/ParseTree2.cpp1089
-rw-r--r--blahtexml/source/BlahtexCore/ParseTree3.cpp1317
-rw-r--r--blahtexml/source/BlahtexCore/Parser.cpp1643
-rw-r--r--blahtexml/source/BlahtexCore/Parser.h142
-rw-r--r--blahtexml/source/BlahtexCore/XmlEncode.cpp694
-rw-r--r--blahtexml/source/BlahtexCore/XmlEncode.h42
-rw-r--r--blahtexml/source/BlahtexXMLin/AttributesImpl.cpp131
-rw-r--r--blahtexml/source/BlahtexXMLin/AttributesImpl.h63
-rw-r--r--blahtexml/source/BlahtexXMLin/BlahtexFilter.cpp171
-rw-r--r--blahtexml/source/BlahtexXMLin/BlahtexFilter.h51
-rw-r--r--blahtexml/source/BlahtexXMLin/SAX2Output.cpp165
-rw-r--r--blahtexml/source/BlahtexXMLin/SAX2Output.h57
-rw-r--r--blahtexml/source/BlahtexXMLin/XercesString.cpp90
-rw-r--r--blahtexml/source/BlahtexXMLin/XercesString.h40
-rw-r--r--blahtexml/source/Messages.cpp328
-rw-r--r--blahtexml/source/UnicodeConverter.cpp222
-rw-r--r--blahtexml/source/UnicodeConverter.h70
-rw-r--r--blahtexml/source/main.cpp694
-rw-r--r--blahtexml/source/mainPng.cpp213
-rw-r--r--blahtexml/source/mainPng.h62
-rw-r--r--blahtexml/source/md5.c381
-rw-r--r--blahtexml/source/md5.h91
-rw-r--r--blahtexml/source/md5Wrapper.cpp53
-rw-r--r--blahtexml/source/md5Wrapper.h36
-rw-r--r--cert8.db1
-rw-r--r--es_PE/template_blacklist31
-rw-r--r--generated/dummy1
-rw-r--r--locale/es/LC_MESSAGES/org.laptop.WikipediaActivity.mobin1687 -> 0 bytes
-rw-r--r--locale/es/activity.linfo2
-rwxr-xr-xmwlib/EasyTimeline.pl4718
-rw-r--r--mwlib/Makefile20
-rwxr-xr-xmwlib/__init__.py6
-rw-r--r--mwlib/_expander.cc826
-rw-r--r--mwlib/_expander.re206
-rwxr-xr-xmwlib/_expander.sobin74041 -> 0 bytes
-rw-r--r--mwlib/_mwscan.cc1699
-rw-r--r--mwlib/_mwscan.re327
-rwxr-xr-xmwlib/_mwscan.sobin82978 -> 0 bytes
-rw-r--r--mwlib/_version.py9
-rw-r--r--mwlib/advtree.py545
-rw-r--r--mwlib/allnodes.py27
-rw-r--r--mwlib/apps.py378
-rwxr-xr-xmwlib/caller.py20
-rwxr-xr-xmwlib/cdb.py262
-rwxr-xr-xmwlib/cdbwiki.py243
-rw-r--r--mwlib/dummydb.py10
-rwxr-xr-xmwlib/expander.py587
-rwxr-xr-xmwlib/expr.py222
-rwxr-xr-xmwlib/htmlwriter.py451
-rwxr-xr-xmwlib/imgmap.py122
-rwxr-xr-xmwlib/lang.py10
-rw-r--r--mwlib/lang.txt256
-rw-r--r--mwlib/licenses.py185
-rwxr-xr-xmwlib/log.py53
-rwxr-xr-xmwlib/magics.py469
-rwxr-xr-xmwlib/metabook.py119
-rw-r--r--mwlib/mwapidb.py376
-rwxr-xr-xmwlib/mwscan.py315
-rwxr-xr-xmwlib/netdb.py529
-rw-r--r--mwlib/overlay.py22
-rwxr-xr-xmwlib/parser.py1418
-rwxr-xr-xmwlib/recorddb.py83
-rwxr-xr-xmwlib/rendermath.py144
-rw-r--r--mwlib/resources/__init__.py0
-rw-r--r--mwlib/resources/__init__.pycbin144 -> 0 bytes
-rw-r--r--mwlib/resources/outgoing_link.gifbin99 -> 0 bytes
-rw-r--r--mwlib/resources/pedia.css1250
-rw-r--r--mwlib/sanitychecker.py205
-rwxr-xr-xmwlib/scanfile.py29
-rwxr-xr-xmwlib/scanner.py6
-rwxr-xr-xmwlib/texmap.py95
-rwxr-xr-xmwlib/timeline.py52
-rwxr-xr-xmwlib/uparser.py126
-rw-r--r--mwlib/utils.py112
-rwxr-xr-xmwlib/web.py122
-rwxr-xr-xmwlib/wiki.py135
-rwxr-xr-xmwlib/zipwiki.py167
-rw-r--r--searchtoolbar.py81
-rwxr-xr-xserver.py612
-rwxr-xr-xsetup.py22
-rw-r--r--static/acerca.html8
-rwxr-xr-xstatic/audio.pngbin312 -> 0 bytes
-rw-r--r--static/biology.pngbin12873 -> 0 bytes
-rw-r--r--static/bullet.gifbin50 -> 0 bytes
-rw-r--r--static/common.css538
-rwxr-xr-xstatic/discussionitem_icon.gifbin949 -> 0 bytes
-rwxr-xr-xstatic/document.pngbin270 -> 0 bytes
-rw-r--r--static/earth.pngbin21002 -> 0 bytes
-rw-r--r--static/es-gfdl.html421
-rwxr-xr-xstatic/external.pngbin165 -> 0 bytes
-rwxr-xr-xstatic/file_icon.gifbin921 -> 0 bytes
-rw-r--r--static/headbg.jpgbin7881 -> 0 bytes
-rw-r--r--static/humanities.pngbin153948 -> 0 bytes
-rw-r--r--static/index.html278
-rwxr-xr-xstatic/link_icon.gifbin942 -> 0 bytes
-rwxr-xr-xstatic/lock_icon.gifbin918 -> 0 bytes
-rw-r--r--static/magnify-clip.pngbin237 -> 0 bytes
-rwxr-xr-xstatic/mail_icon.gifbin918 -> 0 bytes
-rw-r--r--static/math.pngbin9866 -> 0 bytes
-rw-r--r--static/monobook.css1821
-rwxr-xr-xstatic/news_icon.pngbin297 -> 0 bytes
-rw-r--r--static/outgoing_link.gifbin99 -> 0 bytes
-rw-r--r--static/pedia.css1250
-rw-r--r--static/phys_science.pngbin17125 -> 0 bytes
-rwxr-xr-xstatic/required.gifbin47 -> 0 bytes
-rw-r--r--static/shared.css242
-rw-r--r--static/socialscience.pngbin4779 -> 0 bytes
-rw-r--r--static/society.pngbin3308 -> 0 bytes
-rw-r--r--static/styles.css61
-rw-r--r--static/technology.pngbin21617 -> 0 bytes
-rwxr-xr-xstatic/user.gifbin932 -> 0 bytes
-rwxr-xr-xstatic/video.pngbin215 -> 0 bytes
-rw-r--r--static/wikipedia.pngbin16286 -> 0 bytes
-rwxr-xr-xtools/CountLinks.pl66
-rwxr-xr-xtools/GetPageCounts.pl67
-rwxr-xr-xtools/GetPages.pl85
-rwxr-xr-xtools/GetPagesAboveThreshold.pl42
-rwxr-xr-xtools/GetTemplates.pl142
-rwxr-xr-xtools/PageLinks.pl132
-rwxr-xr-xtools/RankImages.pl150
-rwxr-xr-xtools/RemoveBlacklist.pl40
-rwxr-xr-xtools/RemoveUnlinked.pl72
-rwxr-xr-xtools/get_images.py260
-rw-r--r--woip/AUTHORS3
-rw-r--r--woip/COPYING339
-rw-r--r--woip/README61
-rw-r--r--woip/app/ArticleView.h16
-rw-r--r--woip/app/ArticleView.m83
-rw-r--r--woip/app/Makefile23
-rw-r--r--woip/app/ReadStream.h16
-rw-r--r--woip/app/ReadStream.m71
-rw-r--r--woip/app/SearchBar.h11
-rw-r--r--woip/app/SearchBar.m69
-rw-r--r--woip/app/SearchResult.h9
-rw-r--r--woip/app/SearchResult.m13
-rw-r--r--woip/app/SearchView.h35
-rw-r--r--woip/app/SearchView.m179
-rw-r--r--woip/app/WPParser.h16
-rw-r--r--woip/app/WPParser.m113
-rw-r--r--woip/app/WebKitView.h15
-rw-r--r--woip/app/WebKitView.m77
-rw-r--r--woip/app/WikiApp.h24
-rw-r--r--woip/app/WikiApp.m139
-rw-r--r--woip/app/main.m9
-rw-r--r--woip/c/AUTHORS0
-rw-r--r--woip/c/COPYING0
-rw-r--r--woip/c/ChangeLog0
-rw-r--r--woip/c/INSTALL0
-rw-r--r--woip/c/Makefile.am28
-rw-r--r--woip/c/Makefile.in782
-rw-r--r--woip/c/NEWS0
-rw-r--r--woip/c/README0
-rw-r--r--woip/c/aclocal.m4902
-rw-r--r--woip/c/blocks.c40
-rwxr-xr-xwoip/c/bootstrap.sh6
-rw-r--r--woip/c/bzipreader.c438
-rw-r--r--woip/c/bzipreader.h79
l---------woip/c/compile1
-rwxr-xr-xwoip/c/configure4745
-rw-r--r--woip/c/configure.ac16
-rw-r--r--woip/c/debug.h32
l---------woip/c/depcomp1
-rw-r--r--woip/c/indexer.c177
-rw-r--r--woip/c/indexer.i3883
-rw-r--r--woip/c/indexer.s9
l---------woip/c/install-sh1
-rw-r--r--woip/c/livesearch.c258
-rw-r--r--woip/c/lsearcher.c338
-rw-r--r--woip/c/lsearcher.h47
l---------woip/c/missing1
-rw-r--r--woip/c/safe.c69
-rw-r--r--woip/c/safe.h23
-rw-r--r--woip/c/search.c174
-rw-r--r--woip/c/search.h7
-rw-r--r--woip/c/searcher.c63
-rw-r--r--woip/c/ternary.h45
-rw-r--r--woip/c/wp.c157
-rw-r--r--woip/c/wp.h18
-rw-r--r--woip/py/setup.py38
-rw-r--r--woip/py/wp.i121
-rw-r--r--woip/rb/#bzipreader.rb#192
-rw-r--r--woip/rb/article.rb30
-rw-r--r--woip/rb/bzipreader.rb192
-rw-r--r--woip/rb/common.rb3
-rw-r--r--woip/rb/index.rb54
-rw-r--r--woip/rb/livesearch.rb106
-rw-r--r--woip/rb/server.rb284
-rw-r--r--woip/rb/titles.rb17
-rw-r--r--woip/rb/xapian-index.rb30
-rw-r--r--woip/rb/xmlprocess.rb52
-rwxr-xr-xwoip/sh/livesearch3
-rwxr-xr-xwoip/sh/process48
-rwxr-xr-xwoip/sh/scan28
-rwxr-xr-xwoip/sh/server3
-rwxr-xr-xwoip/sh/test30
-rw-r--r--wp.py59
239 files changed, 0 insertions, 60809 deletions
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index a70b48c..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,8 +0,0 @@
-OLPC adaptation by:
-* Chris Ball <cjb@laptop.org>
-* Wade Brainerd <wadetb@gmail.com>
-* Benjamin M. Schwartz <bmschwar@fas.harvard.edu>
-* Madeleine Price Ball <mad@printf.net>
-
-Wikipedia On iPhone by Patrick Collison <patrick@collison.ie>
-Some code from bzip2 and the FreeBSD implementation of locate has been used; more details are provided in README
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index d511905..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/MANIFEST b/MANIFEST
deleted file mode 100644
index 71f037c..0000000
--- a/MANIFEST
+++ /dev/null
@@ -1,3174 +0,0 @@
-activity/activity-wikipedia.svg
-activity/activity.info
-activity.py
-AUTHORS
-cert8.db
-es_PE/template_blacklist
-es_PE/es_PE.xml.bz2.index.txt
-es_PE/es_PE.xml.bz2.locate.db
-es_PE/es_PE.xml.bz2.locate.prefixdb
-es_PE/es_PE.xml.bz2.processed
-es_PE/es_PE.xml.bz2.blocks.db
-locale/es/activity.linfo
-mwlib/mwapidb.py
-mwlib/rendermath.pyc
-mwlib/zipwiki.py
-mwlib/uparser.py
-mwlib/rendermath.py
-mwlib/_expander.re
-mwlib/expander.pyc
-mwlib/log.py
-mwlib/_mwscan.so
-mwlib/lang.py
-mwlib/_version.py
-mwlib/scanner.pyc
-mwlib/_expander.so
-mwlib/imgmap.py
-mwlib/licenses.py
-mwlib/htmlwriter.py
-mwlib/recorddb.py
-mwlib/advtree.py
-mwlib/timeline.py
-mwlib/utils.py
-mwlib/web.py
-mwlib/expr.pyc
-mwlib/scanfile.py
-mwlib/overlay.py
-mwlib/allnodes.py
-mwlib/texmap.py
-mwlib/expander.py
-mwlib/magics.py
-mwlib/cdbwiki.py
-mwlib/cdb.py
-mwlib/resources/pedia.css
-mwlib/resources/__init__.pyc
-mwlib/resources/outgoing_link.gif
-mwlib/resources/__init__.py
-mwlib/scanner.py
-mwlib/mwscan.py
-mwlib/metabook.py
-mwlib/netdb.py
-mwlib/Makefile
-mwlib/lang.txt
-mwlib/log.pyc
-mwlib/apps.py
-mwlib/timeline.pyc
-mwlib/__init__.pyc
-mwlib/parser.py
-mwlib/htmlwriter.pyc
-mwlib/caller.py
-mwlib/lang.pyc
-mwlib/dummydb.py
-mwlib/parser.pyc
-mwlib/texmap.pyc
-mwlib/_mwscan.cc
-mwlib/expr.py
-mwlib/sanitychecker.py
-mwlib/_expander.cc
-mwlib/EasyTimeline.pl
-mwlib/magics.pyc
-mwlib/wiki.py
-mwlib/_mwscan.re
-mwlib/__init__.py
-mwlib/mwscan.pyc
-NEWS
-searchtoolbar.py
-server.py
-setup.py
-static/acerca.html
-static/lock_icon.gif
-static/es-gfdl.html
-static/document.png
-static/wikipedia.png
-static/file_icon.gif
-static/monobook.css
-static/bullet.gif
-static/pedia.css
-static/shared.css
-static/math.png
-static/technology.png
-static/society.png
-static/news_icon.png
-static/biology.png
-static/phys_science.png
-static/earth.png
-static/mail_icon.gif
-static/socialscience.png
-static/required.gif
-static/outgoing_link.gif
-static/index.html
-static/headbg.jpg
-static/external.png
-static/common.css
-static/video.png
-static/magnify-clip.png
-static/link_icon.gif
-static/humanities.png
-static/user.gif
-static/audio.png
-static/styles.css
-static/discussionitem_icon.gif
-tools/CountLinks.pl
-tools/GetTemplates.pl
-tools/PageLinks.pl
-tools/GetPagesAboveThreshold.pl
-tools/GetPageCounts.pl
-tools/GetPages.pl
-tools/RankImages.pl
-tools/get_images.py
-woip/c/lsearcher.h
-woip/c/Makefile.in
-woip/c/README
-woip/c/lsearcher.c
-woip/c/wp.h
-woip/c/wp.c
-woip/c/indexer.s
-woip/c/bzipreader.h
-woip/c/safe.h
-woip/c/bootstrap.sh
-woip/c/Makefile.am
-woip/c/search.h
-woip/c/searcher.c
-woip/c/AUTHORS
-woip/c/configure.ac
-woip/c/indexer.i
-woip/c/aclocal.m4
-woip/c/ternary.h
-woip/c/debug.h
-woip/c/ChangeLog
-woip/c/indexer.c
-woip/c/NEWS
-woip/c/COPYING
-woip/c/bzipreader.c
-woip/c/search.c
-woip/c/safe.c
-woip/c/INSTALL
-woip/c/livesearch.c
-woip/c/configure
-woip/c/blocks.c
-woip/README
-woip/app/ReadStream.h
-woip/app/ReadStream.m
-woip/app/WikiApp.m
-woip/app/main.m
-woip/app/WPParser.m
-woip/app/SearchView.m
-woip/app/Makefile
-woip/app/WebKitView.h
-woip/app/SearchBar.h
-woip/app/WPParser.h
-woip/app/WebKitView.m
-woip/app/WikiApp.h
-woip/app/SearchView.h
-woip/app/ArticleView.m
-woip/app/ArticleView.h
-woip/app/SearchBar.m
-woip/app/SearchResult.m
-woip/app/SearchResult.h
-woip/AUTHORS
-woip/rb/livesearch.rb
-woip/rb/bzipreader.rb
-woip/rb/common.rb
-woip/rb/xapian-index.rb
-woip/rb/server.rb
-woip/rb/article.rb
-woip/rb/index.rb
-woip/rb/xmlprocess.rb
-woip/rb/titles.rb
-woip/rb/#bzipreader.rb#
-woip/COPYING
-woip/py/wp.i
-woip/py/setup.py
-woip/sh/server
-woip/sh/scan
-woip/sh/process
-woip/sh/livesearch
-woip/sh/test
-wp.py
-_wp.so
-es_PE/images/f/fd/Dymaxion_map_unfolded-no-ocean.png
-es_PE/images/f/fd/Carnaval_de_Rio_-_Costume.jpg
-es_PE/images/f/fd/Ringsundial_open.jpg
-es_PE/images/f/fd/BD-fishermen.jpg
-es_PE/images/f/fd/Diode-photo.JPG
-es_PE/images/f/fd/Alhambra_de_noche.JPG
-es_PE/images/f/fd/National_Park_Service_9-11_Statue_of_Liberty_and_WTC_fire.jpg
-es_PE/images/f/fd/Resultados_de_las_elecciones_generales_de_2008_por_provincias_(2).PNG
-es_PE/images/f/fd/Reichsadler.svg
-es_PE/images/f/fd/Reichsadler.svg.jpg
-es_PE/images/f/fd/303px-Madon1.jpg
-es_PE/images/f/fd/RMS_Titanic_3.jpg
-es_PE/images/f/f3/Jade_pot_from_the_Qing_Dynasty.jpg
-es_PE/images/f/f3/Magnetosphere_rendition.jpg
-es_PE/images/f/f3/Voltaire.jpg
-es_PE/images/f/f3/Gnome-globe.svg
-es_PE/images/f/f3/Gnome-globe.svg.jpg
-es_PE/images/f/f3/Entrevista_de_Guayaquil.jpg
-es_PE/images/f/f3/Algoritmo_de_la_suma.JPG
-es_PE/images/f/f3/Flag_of_Russia.svg
-es_PE/images/f/f3/Busto_di_Aristotele_conservato_a_Palazzo_Altaemps,_Roma._Foto_di_Giovanni_Dall'Orto.jpg
-es_PE/images/f/f3/Flag_of_Switzerland.svg
-es_PE/images/f/f3/Crystal_Clear_action_edit.png
-es_PE/images/f/f3/Staunton_chess_set.jpg
-es_PE/images/f/f3/Aavikko.png
-es_PE/images/f/f3/Pi-CM.svg
-es_PE/images/f/f3/Pi-CM.svg.jpg
-es_PE/images/f/f3/Statue-de-la-liberte-new-york.jpg
-es_PE/images/f/f3/Maximilian_I_of_Mexico_portrait_standing.jpg
-es_PE/images/f/fc/Flag_of_Mexico.svg
-es_PE/images/f/fc/Flag_of_Mexico.svg.jpg
-es_PE/images/f/fc/Dictiosome.svg
-es_PE/images/f/fc/Dictiosome.svg.jpg
-es_PE/images/f/fc/Chip.jpg
-es_PE/images/f/fc/Karl_Marx.jpg
-es_PE/images/f/fc/Water_droplet_blue_bg05.jpg
-es_PE/images/f/fc/Ceviche_del_Perú.jpg
-es_PE/images/f/fc/Juan_Manuel_Blanes_-_Artigas_en_la_Ciudadela.jpg
-es_PE/images/f/fc/Weather-symbols.png
-es_PE/images/f/fc/Ribosa1.png
-es_PE/images/f/fc/Ethanol-2D-skeletal.png
-es_PE/images/f/fc/Algunos_alcanos.JPG
-es_PE/images/f/fc/Definicion_clasica_de_conocimiento.png
-es_PE/images/f/fc/Three_cell_growth_types_es.png
-es_PE/images/f/fc/VietnamMural.jpg
-es_PE/images/f/fc/Illu_synovial_joint.jpg
-es_PE/images/f/fc/Nutrition-label.jpg
-es_PE/images/f/f2/ADN.jpg
-es_PE/images/f/f2/Alvaro_Obregon.jpg
-es_PE/images/f/f2/Herpes_simpex_virus.jpg
-es_PE/images/f/f2/CON_party.png
-es_PE/images/f/f2/Puerta_de_la_Ciudadela5.jpg
-es_PE/images/f/f2/Flag_of_Costa_Rica.svg
-es_PE/images/f/f2/Castillo_de_Sancti_Petri.JPG
-es_PE/images/f/f2/Europe_location_KOS.png
-es_PE/images/f/f2/Coat_of_Arms_of_the_Russian_Federation.svg
-es_PE/images/f/f2/Coat_of_Arms_of_the_Russian_Federation.svg.jpg
-es_PE/images/f/f2/Turbiny_wiatrowe_ubt.jpeg
-es_PE/images/f/f2/Neutrophil_with_anthrax_copy.jpg
-es_PE/images/f/f2/Lysdioder2.jpg
-es_PE/images/f/f2/Palanca-ejemplo.jpg
-es_PE/images/f/f2/Anne_boleyn.jpg
-es_PE/images/f/f2/Michael-faraday3.jpg
-es_PE/images/f/f2/Alga_Marina.JPG
-es_PE/images/f/f2/Idun_and_the_Apples.jpg
-es_PE/images/f/f2/Pluto_Charon_Moon_Earth_Comparison.png
-es_PE/images/f/f4/TrenFerrosurRoca.jpg
-es_PE/images/f/f4/Pico_Orizaba1.jpg
-es_PE/images/f/f4/NIAID-west-Nile.jpg
-es_PE/images/f/f4/Leaf_1_web.jpg
-es_PE/images/f/f4/Desarrollo_sostenible.svg
-es_PE/images/f/f4/Desarrollo_sostenible.svg.jpg
-es_PE/images/f/f4/Australia_coa.png
-es_PE/images/f/f4/Francisco_I_Madero.jpg
-es_PE/images/f/f4/DaddyYankee.jpg
-es_PE/images/f/f4/Ãrbol_dioses_olímpicos3.JPG
-es_PE/images/f/f4/Paleontologist_chipping.jpg
-es_PE/images/f/f4/Bauhaus_dessau.jpg
-es_PE/images/f/f4/PyramidDatePalms.jpg
-es_PE/images/f/f4/Kit_body_yellowhorizontal.png
-es_PE/images/f/fe/Flag_of_Uruguay.svg
-es_PE/images/f/fe/Sophokles.jpg
-es_PE/images/f/fe/Google_wordmark.svg
-es_PE/images/f/fe/Flag_of_Egypt.svg
-es_PE/images/f/fe/Flag_of_Egypt.svg.jpg
-es_PE/images/f/fe/Mexico_stateflags_Estado_de_Mexico.png
-es_PE/images/f/fe/Ethanol_fermentation_es.svg
-es_PE/images/f/fe/Ethanol_fermentation_es.svg.jpg
-es_PE/images/f/fe/Coat_of_arms_of_Ireland.svg
-es_PE/images/f/fe/Coat_of_arms_of_Ireland.svg.jpg
-es_PE/images/f/fe/FerrariF40.jpg
-es_PE/images/f/fe/Tensión_corriente_continua.png
-es_PE/images/f/fe/Escudo_de_Medellin.png
-es_PE/images/f/fe/Airplane_vortex_edit.jpg
-es_PE/images/f/fa/Wikibooks-logo.svg
-es_PE/images/f/fa/Wikibooks-logo.svg.jpg
-es_PE/images/f/fa/Wikiquote-logo.svg
-es_PE/images/f/fa/Topographic30deg_N0E150.png
-es_PE/images/f/fa/Flag_of_the_People's_Republic_of_China.svg
-es_PE/images/f/fa/Flag_of_the_People's_Republic_of_China.svg.jpg
-es_PE/images/f/fa/Pascal1423.jpg
-es_PE/images/f/fa/Fe-TableImage.png
-es_PE/images/f/fa/LocationMorocco.svg
-es_PE/images/f/fa/LocationMorocco.svg.jpg
-es_PE/images/f/f6/Moon_Earth_Comparison.png
-es_PE/images/f/f6/FallingwaterWright.jpg
-es_PE/images/f/f6/Amazon_rainforest.jpg
-es_PE/images/f/f6/Pinochet_y_Videla.jpg
-es_PE/images/f/f6/Represa_Salto_Grande.jpg
-es_PE/images/f/f6/Torreantel2.JPG
-es_PE/images/f/f6/Duchamp_Fountaine.jpg
-es_PE/images/f/f6/Becquer.jpg
-es_PE/images/f/f6/Illu_mouth.jpg
-es_PE/images/f/f6/Bandera_de_España(1748-1785).gif
-es_PE/images/f/f6/Ejemplo_Diagrama_E-R_extendido.PNG
-es_PE/images/f/f6/Old_violin.jpg
-es_PE/images/f/f6/Electrólisis.png
-es_PE/images/f/f6/Everest_kalapatthar.jpg
-es_PE/images/f/f6/Estatutos_rae_1715big.jpg
-es_PE/images/f/f6/Flag_of_Iraq.svg
-es_PE/images/f/f6/Flag_of_Iraq.svg.jpg
-es_PE/images/f/f6/LocationSpainInEurope.png
-es_PE/images/f/f1/Maslow_es.svg
-es_PE/images/f/f1/Maslow_es.svg.jpg
-es_PE/images/f/f1/The_Doctor_Luke_Fildes.jpg
-es_PE/images/f/f1/3d_tRNA.png
-es_PE/images/f/f1/Cambio_de_estado(png).svg
-es_PE/images/f/f1/Cambio_de_estado(png).svg.jpg
-es_PE/images/f/f1/Ronaldo.jpeg
-es_PE/images/f/f1/Kusuma_bike_large.jpg
-es_PE/images/f/ff/Plum_pudding_atom.svg
-es_PE/images/f/ff/Plum_pudding_atom.svg.jpg
-es_PE/images/f/ff/Lenguas_de_europa.png
-es_PE/images/f/ff/Andromeda_galaxy.jpg
-es_PE/images/f/ff/Fire02.jpg
-es_PE/images/f/ff/LocationArgentina.svg
-es_PE/images/f/ff/LocationArgentina.svg.jpg
-es_PE/images/f/ff/Air_.pollution_1.jpg
-es_PE/images/f/ff/Venezia-Stemma.png
-es_PE/images/f/ff/Chocolate_fountain.jpg
-es_PE/images/f/ff/Athens_map.png
-es_PE/images/f/ff/Pluto_symbol.svg
-es_PE/images/f/ff/Pluto_symbol.svg.jpg
-es_PE/images/f/f0/Geostático.JPG
-es_PE/images/f/f0/Oceania_ISO_3166-1.svg
-es_PE/images/f/f0/Oceania_ISO_3166-1.svg.jpg
-es_PE/images/f/f0/Flag_of_Japan_(bordered).svg
-es_PE/images/f/f0/Flag_of_Slovenia.svg
-es_PE/images/f/f0/Flag_of_Slovenia.svg.jpg
-es_PE/images/f/f0/Benito_Mussolini_and_Adolf_Hitler.jpg
-es_PE/images/f/f0/Khajurahosculpture.jpg
-es_PE/images/f/f0/London_City_coa.png
-es_PE/images/f/f0/Rebelde1.jpg
-es_PE/images/f/f0/Mouse_embryonic_stem_cells.jpg
-es_PE/images/f/f5/Mycobacterium_tuberculosis_8438_lores.jpg
-es_PE/images/f/f5/Grand_prismatic_spring.jpg
-es_PE/images/f/f5/Jean_Piaget.jpg
-es_PE/images/f/f5/David-hume-edinburgh.jpg
-es_PE/images/f/f5/LocationYugoslavia.png
-es_PE/images/f/f5/Ez-map.png
-es_PE/images/f/f5/Linces10.jpg
-es_PE/images/f/f7/Peru-demography.png
-es_PE/images/f/f7/Feuerreiben.gif
-es_PE/images/f/f7/C64silber.jpg
-es_PE/images/f/f7/LocationIndia.png
-es_PE/images/f/f7/AfricaLocation.svg
-es_PE/images/f/f7/AfricaLocation.svg.jpg
-es_PE/images/f/f7/Darra_j_berlin05_8.JPG
-es_PE/images/f/f7/Franco0001.PNG
-es_PE/images/f/f7/Sweden_greater_coat_of_arms.jpg
-es_PE/images/f/f7/Coat_of_Arms_of_Norway.svg
-es_PE/images/f/f7/Coat_of_Arms_of_Norway.svg.jpg
-es_PE/images/f/f7/Schematic_Proxy_Server.png
-es_PE/images/f/f7/Flag_of_Florida.svg
-es_PE/images/f/f7/Flag_of_Florida.svg.jpg
-es_PE/images/f/f7/IQ_curve.svg
-es_PE/images/f/f7/IQ_curve.svg.jpg
-es_PE/images/f/f7/Vista_su_Atene_dal_Licabeto.jpg
-es_PE/images/f/f7/Flag_of_Texas.svg
-es_PE/images/f/f7/Gatos_de_Galicia.gif
-es_PE/images/f/f9/Maré.jpg
-es_PE/images/f/f9/ChampiEnForet.jpg
-es_PE/images/f/f9/PI.svg
-es_PE/images/f/f9/PI.svg.jpg
-es_PE/images/f/f9/Three_cell_growth_types.png
-es_PE/images/f/f9/MXEscudo_Chiapas.png
-es_PE/images/f/f9/Indicateurs_colorés_de_pH.jpg
-es_PE/images/f/fb/Moon_PIA00303.jpg
-es_PE/images/f/fb/PrismAndLight.jpg
-es_PE/images/f/fb/My_Chemical_Romance_BDO_Feb_4_07_6.jpg
-es_PE/images/f/fb/Edgar_Allan_Poe_portrait_B.jpg
-es_PE/images/f/fb/Sinus2.png
-es_PE/images/f/fb/S,16.jpg
-es_PE/images/f/fb/Nelson_Mandela_1998_cropped.JPG
-es_PE/images/f/f8/Ripa_-_s_Maria_in_Cosmedin_-_reliquia_s_Valentino_1020599.JPG
-es_PE/images/f/f8/Flag_of_Barcelona.svg
-es_PE/images/f/f8/Flag_of_Barcelona.svg.jpg
-es_PE/images/f/f8/Barcelona,_Spain_location.png
-es_PE/images/f/f8/UN_Human_Development_Report_2007_(1).svg
-es_PE/images/f/f8/UN_Human_Development_Report_2007_(1).svg.jpg
-es_PE/images/f/f8/Transistor-photo.JPG
-es_PE/images/f/f8/Bermudatriangle_(sketch).png
-es_PE/images/f/f8/Flag_of_Macedonia.svg
-es_PE/images/f/f8/Genga_22.jpg
-es_PE/images/6/63/Wikipedia-logo.png
-es_PE/images/6/63/Michelangelos_David.jpg
-es_PE/images/6/63/Paris.louvre.winged.500pix.jpg
-es_PE/images/6/63/USA.NM.VeryLargeArray.02.jpg
-es_PE/images/6/63/JM_Fire.jpg
-es_PE/images/6/63/Dilution-concentration_simple_example.jpg
-es_PE/images/6/63/J_G_Trautmann_Das_brennende_Troja.jpg
-es_PE/images/6/63/Bus_Stop_trailer_screenshot_9.jpg
-es_PE/images/6/63/Poulie_bateau.jpg
-es_PE/images/6/63/GPN-2000-000465.jpg
-es_PE/images/6/63/AcueductoSegovia04.JPG
-es_PE/images/6/63/Colorwheel.gif
-es_PE/images/6/63/LocationThailand.svg
-es_PE/images/6/63/LocationThailand.svg.jpg
-es_PE/images/6/60/EXCAVACION45.jpg
-es_PE/images/6/60/Regensburg_Stadttheater_Zuschauerraum_2004.jpg
-es_PE/images/6/60/Waitakere_Piha_n.jpg
-es_PE/images/6/60/Flag_of_Suriname.svg
-es_PE/images/6/60/Flag_of_Suriname.svg.jpg
-es_PE/images/6/60/Montevideo_Department_Coa.png
-es_PE/images/6/60/Newton-Principia-Mathematica_1-500x700.jpg
-es_PE/images/6/60/Speed_of_light_from_Earth_to_Moon.gif
-es_PE/images/6/60/Refraction_on_an_aperture_-_Huygens-Fresnel_principle.svg
-es_PE/images/6/60/Refraction_on_an_aperture_-_Huygens-Fresnel_principle.svg.jpg
-es_PE/images/6/60/CMB_Timeline75.jpg
-es_PE/images/6/60/Red_King_sleeping.jpg
-es_PE/images/6/60/Location_Greece_EU_Europe.png
-es_PE/images/6/60/Bulbgraph.png
-es_PE/images/6/60/Kostaldea.jpg
-es_PE/images/6/6c/Psi2.svg
-es_PE/images/6/6c/Psi2.svg.jpg
-es_PE/images/6/6c/Wiki_letter_w.svg
-es_PE/images/6/6c/Wiki_letter_w.svg.jpg
-es_PE/images/6/6c/OGLE-2005-BLG-390Lb.jpg
-es_PE/images/6/6c/Manhattan_night_march_USa.jpg
-es_PE/images/6/6c/Location_UK_EU_Europe.png
-es_PE/images/6/6c/Clitoris_anatomy_labeled-en.jpg
-es_PE/images/6/6c/Radiohead.jpg
-es_PE/images/6/67/Norteamerica.png
-es_PE/images/6/67/Fitness-landscape-cartoon.png
-es_PE/images/6/67/Flag_of_Christmas_Island.svg
-es_PE/images/6/67/Flag_of_Christmas_Island.svg.jpg
-es_PE/images/6/67/FranceImp1.jpg
-es_PE/images/6/67/Escudo_de_Madrid.svg
-es_PE/images/6/67/Escudo_de_Madrid.svg.jpg
-es_PE/images/6/67/Hagiasophia-christ.jpg
-es_PE/images/6/67/Inversa.png
-es_PE/images/6/67/L-Zeichnen4.png
-es_PE/images/6/67/Pedro_Berruguete_-_Saint_Dominic_Presiding_over_an_Auto-da-fe_(1475).jpg
-es_PE/images/6/67/Leda.jpg
-es_PE/images/6/67/Vampiresa.jpg
-es_PE/images/6/6a/Mona_Lisa.jpg
-es_PE/images/6/6a/Control_central.JPG
-es_PE/images/6/6a/CH_Landwasser_2.jpg
-es_PE/images/6/6a/Johann_Sebastian_Bach.jpg
-es_PE/images/6/6a/Location_Belgium_EU_Europe.png
-es_PE/images/6/6a/Female_reproductive_system_lateral_nolabel.png
-es_PE/images/6/6a/Intestino.svg
-es_PE/images/6/6a/Intestino.svg.jpg
-es_PE/images/6/6a/Gottfried_Wilhelm_von_Leibniz.jpg
-es_PE/images/6/62/LocationPeru.svg
-es_PE/images/6/62/LocationPeru.svg.jpg
-es_PE/images/6/62/Hungarian_Grey_Cattle8.jpg
-es_PE/images/6/62/Opening_of_the_first_parliament.jpg
-es_PE/images/6/62/HMS_Dreadnought_1906_H61017.jpg
-es_PE/images/6/62/Feb1712.jpg
-es_PE/images/6/62/Bolivar_Paris.jpg
-es_PE/images/6/62/Neurona.svg
-es_PE/images/6/62/Neurona.svg.jpg
-es_PE/images/6/62/Byssr_flag_1919.png
-es_PE/images/6/62/Market-Chichicastenango.jpg
-es_PE/images/6/62/Jamaica_coa.png
-es_PE/images/6/62/IFA_2005_Toshiba_HBS_A_001_HD-DVD_Player_(Dual-Layer_HD-DVD_30GB)_and_(DVD-HD-DVD-Twin-Disc_5GB_15GB)_(by_HDTVTotalDOTcom).jpg
-es_PE/images/6/62/Davicrege3.JPG
-es_PE/images/6/62/Daniel_Radcliffe.jpg
-es_PE/images/6/62/Obraz_131.jpg
-es_PE/images/6/62/Sea_of_Chile.jpg
-es_PE/images/6/62/Hilary_Putnam.jpg
-es_PE/images/6/62/Megadeth_at_Sauna.jpeg
-es_PE/images/6/62/Measles_virus.JPG
-es_PE/images/6/66/Animated_flower.GIF
-es_PE/images/6/66/Barranca_del_cobre_2.jpg
-es_PE/images/6/66/FamiliaOjeda.JPG
-es_PE/images/6/66/DSCN2780.JPG
-es_PE/images/6/66/Ponteorinoco2006.jpg
-es_PE/images/6/66/Drakskepp2.PNG
-es_PE/images/6/66/Flag_of_Malaysia.svg
-es_PE/images/6/66/Flag_of_Malaysia.svg.jpg
-es_PE/images/6/66/Cervates_jauregui.jpg
-es_PE/images/6/66/Lymphatic_system.png
-es_PE/images/6/66/Entrada_Miraflores.JPG
-es_PE/images/6/66/Venus_symbol.svg
-es_PE/images/6/66/Venus_symbol.svg.jpg
-es_PE/images/6/6b/Leaving_Yongsan_Station.jpg
-es_PE/images/6/6b/Europa-philosophen-1-800.png
-es_PE/images/6/6b/Christopher_Columbus6.jpg
-es_PE/images/6/6b/Italy-Emblem.svg
-es_PE/images/6/6b/Italy-Emblem.svg.jpg
-es_PE/images/6/6b/Batalla_del_Monte_de_las_Cruces-30_oct_1810-México.jpg
-es_PE/images/6/6b/Vincent_van_Gogh_signature.png
-es_PE/images/6/6b/Aguja_tens_sup.jpg
-es_PE/images/6/6b/EU_location_ROM.png
-es_PE/images/6/6b/Illu_pituitary_pineal_glands.jpg
-es_PE/images/6/6b/PalacioReal_Stradivarius1.jpg
-es_PE/images/6/6b/Waves_mediterranean_sea.jpg
-es_PE/images/6/64/DiaDeMuertosXochimilcoDFMexico_011.jpg
-es_PE/images/6/64/Dualite.jpg
-es_PE/images/6/64/Avrilgfdl.JPG
-es_PE/images/6/64/Rio_Cunana_en_Perija_Venezuela.JPG
-es_PE/images/6/64/IntelCore2DuoE6600.jpg
-es_PE/images/6/64/Capillarity.svg
-es_PE/images/6/64/Hades.png
-es_PE/images/6/6f/Sun_symbol.svg
-es_PE/images/6/6f/Sun_symbol.svg.jpg
-es_PE/images/6/6f/Mouths_of_amazon_geocover_1990.png
-es_PE/images/6/6f/Flor_masculina_zea_mays.JPG
-es_PE/images/6/6f/Chicago_Downtown_Aerial_View.jpg
-es_PE/images/6/6f/Beethoven.jpg
-es_PE/images/6/6f/ChessSet.jpg
-es_PE/images/6/6f/NFPA_704.svg
-es_PE/images/6/6f/Flag_of_Buenos_Aires_(City)_in_Argentina.gif
-es_PE/images/6/68/PNA_party.png
-es_PE/images/6/68/Tipo_Ala_delta_con_timones.JPG
-es_PE/images/6/68/FIAV_111111.svg
-es_PE/images/6/68/FIAV_111111.svg.jpg
-es_PE/images/6/68/Efez_Celsus_Library_4_RB.jpg
-es_PE/images/6/68/Lynx_lynx_poing.jpg
-es_PE/images/6/68/HwacheonCentreLathe_460x1000.jpg
-es_PE/images/6/68/TrigaReactorCore.jpeg
-es_PE/images/6/61/3d-baseball.jpg
-es_PE/images/6/61/Religiones_de_europa.png
-es_PE/images/6/61/Flag_of_the_Provincia_Cisplatina.svg
-es_PE/images/6/61/Flag_of_the_Provincia_Cisplatina.svg.jpg
-es_PE/images/6/61/Pasajeros_al_tren.jpg
-es_PE/images/6/61/Buenos_Aires_Coats_of_Arms.gif
-es_PE/images/6/61/Thorax_Lung_3d_from_ct_scans.jpg
-es_PE/images/6/61/Emperor_charles_v.png
-es_PE/images/6/61/Rubiks_cube_solved.jpg
-es_PE/images/6/61/ChileRegions.png
-es_PE/images/6/69/2D_Wavefunction_(2,2)_Surface_Plot.png
-es_PE/images/6/69/Digitalartpaintsky.jpg
-es_PE/images/6/69/E-coli-in-color.jpg
-es_PE/images/6/69/Peru_meander1.jpg
-es_PE/images/6/69/Marinera_Norteña.jpg
-es_PE/images/6/69/Raspberries05.jpg
-es_PE/images/6/69/Alice_par_John_Tenniel_25.png
-es_PE/images/6/69/Cervantes_Don_Quixote_1605.gif
-es_PE/images/6/69/CiudadMadridPosicion.PNG
-es_PE/images/6/69/FrankLucas.jpg
-es_PE/images/6/69/Villa_uniforme.JPG
-es_PE/images/6/69/Lycian_Apollo_Louvre_left.jpg
-es_PE/images/6/65/Fes_Medersa_Bou_Inania_Mosaique3_Calligraphy2.jpg
-es_PE/images/6/65/Carlos_Noriega_Peru.jpg
-es_PE/images/6/65/Flag_of_Belgium.svg
-es_PE/images/6/65/Sor-Juana.jpg
-es_PE/images/6/65/Eye_iris.jpg
-es_PE/images/6/65/Silvia_Saint_DSC_1423.JPG
-es_PE/images/6/65/Francis_Bacon.jpg
-es_PE/images/6/6e/SeñordelosMilagrosNazarenas.jpg
-es_PE/images/6/6e/Obelisco_-_Plaza_Internacional_-_Frontera_de_la_Paz_-_Livramento_-_Rivera.jpeg
-es_PE/images/6/6e/The_sun1.jpg
-es_PE/images/6/6e/SOHO_instruments_pnggray_300.png
-es_PE/images/6/6e/Latin_dictionary.jpg
-es_PE/images/6/6e/Circumcision.jpg
-es_PE/images/6/6e/Chernobyl_Nuclear_Power_Plant.PNG
-es_PE/images/6/6e/Francisco_de_Goya_y_Lucientes_023.jpg
-es_PE/images/6/6e/Elektronenmikroskop.jpg
-es_PE/images/6/6e/Flag_of_Antioquia.svg
-es_PE/images/6/6d/Tipo_Ala_en_flecha_variable.JPG
-es_PE/images/6/6d/Dräkt,_Frankisk_ädling,_Nordisk_familjebok.png
-es_PE/images/6/6d/Chaucer_Hoccleve.gif
-es_PE/images/6/6d/Translational_motion.gif
-es_PE/images/6/6d/Cocacola-5cents-1900.jpg
-es_PE/images/6/6d/Cold_war_europe_military_alliances_map_es.png
-es_PE/images/6/6d/Forest_on_Barro_Colorado.png
-es_PE/images/6/6d/Venn_A_intersect_B.svg
-es_PE/images/6/6d/Venn_A_intersect_B.svg.jpg
-es_PE/images/6/6d/Intervalo.png
-es_PE/images/6/6d/Rolling_Stones_Nice_08-08-2006.jpg
-es_PE/images/6/6d/LocationNorway.svg
-es_PE/images/6/6d/LocationNorway.svg.jpg
-es_PE/images/6/6d/Drum_kit_illustration_edit.png
-es_PE/images/d/da/Stonehenge_back_wide.jpg
-es_PE/images/d/da/TALLERES_MUÑOZ_I.jpg
-es_PE/images/d/da/Chichen-Itza_El_Castillo.jpg
-es_PE/images/d/da/AGMA_Hérodote.jpg
-es_PE/images/d/da/Konrad_Zuse_(1992).jpg
-es_PE/images/d/da/Plato_Pio-Clemetino_Inv305.jpg
-es_PE/images/d/da/Flag_of_Luxembourg.svg
-es_PE/images/d/da/Illu_endocrine_system.png
-es_PE/images/d/da/Candida_albicans_PHIL_3192_lores.jpg
-es_PE/images/d/da/LocationBelize.svg
-es_PE/images/d/da/LocationBelize.svg.jpg
-es_PE/images/d/da/Royal_arms_of_Scotland.svg
-es_PE/images/d/da/Royal_arms_of_Scotland.svg.jpg
-es_PE/images/d/da/Coat_of_arms_of_New_Zealand.png
-es_PE/images/d/da/Cello_bridge.jpg
-es_PE/images/d/d9/Goliath_beetle.jpg
-es_PE/images/d/d9/Tyholt_taarnet.jpg
-es_PE/images/d/d9/Zuni-girl-with-jar2.png
-es_PE/images/d/d9/Flag_of_Norway.svg
-es_PE/images/d/d9/Bill_gates_portrait.jpg
-es_PE/images/d/d9/Palaiologos-Dynasty-Eagle.svg
-es_PE/images/d/d9/Palaiologos-Dynasty-Eagle.svg.jpg
-es_PE/images/d/d9/Library-shelves-bibliographies-Graz.jpg
-es_PE/images/d/d9/Mariecurie.jpg
-es_PE/images/d/d9/Coat_of_arms_of_Berlin.svg
-es_PE/images/d/d9/Coat_of_arms_of_Berlin.svg.jpg
-es_PE/images/d/d9/Batterien.jpg
-es_PE/images/d/d9/LCD_subpixel_(en).png
-es_PE/images/d/d2/Internet_map_1024.jpg
-es_PE/images/d/d2/DSC00733_Notre_Dame_Paris_from_east.jpg
-es_PE/images/d/d2/Balanza_no_neutral.png
-es_PE/images/d/d2/Gardel.jpg
-es_PE/images/d/d2/Flag_of_Wallis_and_Futuna.svg
-es_PE/images/d/d2/Flag_of_Prague.svg
-es_PE/images/d/d2/Helena_Bonham_Carter_2005.jpg
-es_PE/images/d/d2/Coquina_variation3.jpg
-es_PE/images/d/df/Wikispecies-logo.svg
-es_PE/images/d/df/Wikispecies-logo.svg.jpg
-es_PE/images/d/df/Sun_in_X-Ray.png
-es_PE/images/d/df/Flag_of_Peru_(state).svg
-es_PE/images/d/df/Flag_of_Peru_(state).svg.jpg
-es_PE/images/d/df/Gerome_-_Diogenes.jpg
-es_PE/images/d/df/ARS_Campylobacter_jejuni.jpg
-es_PE/images/d/df/Europe_all_states.png
-es_PE/images/d/df/Gnome_globe_current_event.svg
-es_PE/images/d/df/Gnome_globe_current_event.svg.jpg
-es_PE/images/d/df/En_wikinews_rss_circulation.png
-es_PE/images/d/df/Carlos_Slim_Helú.jpg
-es_PE/images/d/df/Susquehanna_steam_electric_station.jpg
-es_PE/images/d/de/Www.wikipedia.org_screenshot.png
-es_PE/images/d/de/Punta_del_Este2.jpg
-es_PE/images/d/de/Renier.jpg
-es_PE/images/d/de/Topographic30deg_S0E120.png
-es_PE/images/d/de/Condensators.JPG
-es_PE/images/d/de/Coat_of_arms_of_Morocco.png
-es_PE/images/d/de/JKepler.png
-es_PE/images/d/de/Viña_2006_-_2do_día.JPG
-es_PE/images/d/de/Flag_of_Bolivia_(state).svg
-es_PE/images/d/de/Flag_of_Bolivia_(state).svg.jpg
-es_PE/images/d/de/LocationPhilippines.png
-es_PE/images/d/de/PEGIviolencia.png
-es_PE/images/d/d3/AF-kindergarten.jpg
-es_PE/images/d/d3/Soccerball.svg
-es_PE/images/d/d3/Soccerball.svg.jpg
-es_PE/images/d/d3/Box_Log_Falls.jpg
-es_PE/images/d/d3/Flag_of_Kiribati.svg
-es_PE/images/d/d3/Flag_of_Kiribati.svg.jpg
-es_PE/images/d/d3/NSsavannah-1962.gif
-es_PE/images/d/d3/Santa-Maria.jpg
-es_PE/images/d/d3/Gregor_Mendel.png
-es_PE/images/d/d3/DVD-R_bottom-side.jpg
-es_PE/images/d/d3/Wikimedia.png
-es_PE/images/d/d3/SiegeofAntioch.jpeg
-es_PE/images/d/d3/Catalonia-Campanar_catedral_de_Vic,_Osona.jpg
-es_PE/images/d/d3/Dante_Alighieri01.jpg
-es_PE/images/d/d3/US_flag_29_stars.svg
-es_PE/images/d/d3/US_flag_29_stars.svg.jpg
-es_PE/images/d/d1/Mapa_de_los_años_de_educación_obligatoria_en_el_mundo_v1.0.PNG
-es_PE/images/d/d1/Modelo_de_Bohr.png
-es_PE/images/d/d1/Telefonodefichas.jpg
-es_PE/images/d/d1/Ubicacion_GDL.PNG
-es_PE/images/d/d1/Sanzio_01_cropped.png
-es_PE/images/d/d1/New_Spain.png
-es_PE/images/d/d1/Flag_of_OPEC.svg
-es_PE/images/d/d1/Vintergatan-karta.jpg
-es_PE/images/d/d1/Japan_tokyo_map_small.png
-es_PE/images/d/dd/Full_Moon_Luc_Viatour.jpg
-es_PE/images/d/dd/Muybridge_race_horse_animated.gif
-es_PE/images/d/dd/Buzz_salutes_the_U.S._Flag.jpg
-es_PE/images/d/dd/Juana_de_ibarbourou.jpg
-es_PE/images/d/dd/Droits_de_l'Homme_-_JPG.jpg
-es_PE/images/d/dd/Flag_of_New_Spain.svg
-es_PE/images/d/dd/El_circulo.svg
-es_PE/images/d/dd/El_circulo.svg.jpg
-es_PE/images/d/dd/Map_of_USA_CA.svg
-es_PE/images/d/dd/Map_of_USA_CA.svg.jpg
-es_PE/images/d/dd/Goya-Guerra_(05).jpg
-es_PE/images/d/dd/Coat_of_arms_of_Belize.svg
-es_PE/images/d/dd/Coat_of_arms_of_Belize.svg.jpg
-es_PE/images/d/d5/Flag_of_the_Netherlands_Antilles.svg
-es_PE/images/d/d5/Animalia_diversity.jpg
-es_PE/images/d/d5/Niels_Bohr_Albert_Einstein_by_Ehrenfest.jpg
-es_PE/images/d/d5/Gyroscope_operation.gif
-es_PE/images/d/d5/Elementos_proceso_comunicación.jpg
-es_PE/images/d/d5/Apple_IIc_Plus_(front).jpg
-es_PE/images/d/d5/LocationCanada.svg
-es_PE/images/d/d5/LocationCanada.svg.jpg
-es_PE/images/d/d5/Ares_Galaxy_Logo_Transparent.png
-es_PE/images/d/d5/Jorge_Luis_Borges_Hotel.jpg
-es_PE/images/d/d5/Odysseus_bjuder_cyklopen_vin,_Nordisk_familjebok.png
-es_PE/images/d/d5/Kaposi’s_sarcoma_intraoral_AIDS_072_lores.jpg
-es_PE/images/d/d5/LocationGermanyInEurope.png
-es_PE/images/d/d5/Question_copyright.svg
-es_PE/images/d/d5/Question_copyright.svg.jpg
-es_PE/images/d/d5/Pkuczynski_RJ-45_patchcord.jpg
-es_PE/images/d/d0/Puerto_de_Acapulco_Boot_1628.png
-es_PE/images/d/d0/Juan_Manuel_Blanes_-_El_Juramento_de_los_Treinta_y_Tres_Orientales.jpg
-es_PE/images/d/d0/Japanese_Macaques_sleeping.JPG
-es_PE/images/d/d0/Flag_of_Spain_under_Franco_1938_1945.svg
-es_PE/images/d/d0/Flag_of_Spain_under_Franco_1938_1945.svg.jpg
-es_PE/images/d/d0/New_York_1999_bruce_lee-perspcorr.jpg
-es_PE/images/d/d0/Arco1.png
-es_PE/images/d/d0/Louvre,_vu_de_la_Seine.jpg
-es_PE/images/d/d7/Guadalajara_downtown.jpg
-es_PE/images/d/d7/Alphadecay.jpg
-es_PE/images/d/d7/Ala_recta.JPG
-es_PE/images/d/d7/Bluray.png
-es_PE/images/d/d7/LocationMapJapan.png
-es_PE/images/d/d7/AinuGroup.JPG
-es_PE/images/d/d7/Orton_05.jpg
-es_PE/images/d/db/CU-Mexico-biblioteca-2.jpg
-es_PE/images/d/db/Al-Idrisi's_world_map.JPG
-es_PE/images/d/db/Map_of_Peru_Demis.png
-es_PE/images/d/db/Uruguay-demography.png
-es_PE/images/d/db/Flag_of_French_Polynesia.svg
-es_PE/images/d/db/Flag_of_French_Polynesia.svg.jpg
-es_PE/images/d/db/Sleep_EEG_Stage_4.jpg
-es_PE/images/d/db/Mitosis-flourescent.jpg
-es_PE/images/d/db/Lady_justice_standing.png
-es_PE/images/d/db/Ludwigshafen_Bruecke.jpg
-es_PE/images/d/db/Graffiti_2003_ubt.jpg
-es_PE/images/d/db/Cairns_birdwing_-_melbourne_zoo.jpg
-es_PE/images/d/db/FIGURA_04.jpg
-es_PE/images/d/db/Cityscapeberlin2006.JPG
-es_PE/images/d/db/Athena_Parthenos_Altemps_Inv8622.jpg
-es_PE/images/d/db/LocationCroatia.svg
-es_PE/images/d/db/LocationCroatia.svg.jpg
-es_PE/images/d/d6/EMpylori.jpg
-es_PE/images/d/d6/Flag_of_Brazil_(1889-1960).svg
-es_PE/images/d/d6/Flag_of_Brazil_(1889-1960).svg.jpg
-es_PE/images/d/d6/GermanShep1_wb.jpg
-es_PE/images/d/d6/Genga_36.1.jpg
-es_PE/images/d/d6/Coat_of_arms_of_the_Soviet_Union.svg
-es_PE/images/d/d6/Coat_of_arms_of_the_Soviet_Union.svg.jpg
-es_PE/images/d/d6/Venn_A_subset_B.png
-es_PE/images/d/d6/Kepler-world.jpg
-es_PE/images/d/d6/Human-woman.png
-es_PE/images/d/d8/Vaz_ferreira_carlos.jpg
-es_PE/images/d/d8/Sleep_EEG_Stage_2.jpg
-es_PE/images/d/d8/2-50A_2_(2).JPG
-es_PE/images/d/d8/Chaos_diffluens.jpg
-es_PE/images/d/d8/Prostata.jpg
-es_PE/images/d/d8/Location_Finland_EU_Europe.png
-es_PE/images/d/d8/Czech-regions.png
-es_PE/images/d/d8/Thomas_Hobbes_(portrait).jpg
-es_PE/images/d/dc/Tectonic_plates.png
-es_PE/images/d/dc/Influenza_virus.png
-es_PE/images/d/dc/Ww2_allied_axis.gif
-es_PE/images/d/dc/Film_Reel.svg
-es_PE/images/d/dc/Film_Reel.svg.jpg
-es_PE/images/d/dc/LocationEgypt.svg
-es_PE/images/d/dc/LocationEgypt.svg.jpg
-es_PE/images/d/dc/Flag_of_Barcelona_(province).svg
-es_PE/images/d/dc/Flag_of_Barcelona_(province).svg.jpg
-es_PE/images/d/dc/Canary_Islands_CoA.svg
-es_PE/images/d/dc/Canary_Islands_CoA.svg.jpg
-es_PE/images/d/dc/Fruits_Luc_Viatour.jpg
-es_PE/images/d/dc/Namespace_Wikipedia.2.svg
-es_PE/images/d/dc/Namespace_Wikipedia.2.svg.jpg
-es_PE/images/d/dc/Grade_dimension.svg
-es_PE/images/d/dc/Grade_dimension.svg.jpg
-es_PE/images/d/dc/Burning-cross2.jpg
-es_PE/images/d/dc/LCD_layers.svg
-es_PE/images/d/dc/LCD_layers.svg.jpg
-es_PE/images/d/d4/Flag_of_Israel.svg
-es_PE/images/d/d4/Flag_of_Cyprus.svg
-es_PE/images/d/d4/Flag_of_Cyprus.svg.jpg
-es_PE/images/d/d4/Vicente_López_Y_Portaña_001.jpg
-es_PE/images/d/d4/Glass_is_Liquide.jpg
-es_PE/images/d/d4/Defending_the_Polish_banner_at_Chocim,_by_Juliusz_Kossak,_1892.jpg
-es_PE/images/d/d4/Gymnastics_brokenchopstick.jpg
-es_PE/images/d/d4/Hefner2006.jpg
-es_PE/images/d/d4/PA190094.JPG
-es_PE/images/d/d4/George-W-Bush.jpeg
-es_PE/images/d/d4/Bisectriz_interior-exterior.png
-es_PE/images/d/d4/The_Crèche.jpg
-es_PE/images/3/32/EscherichiaColi_NIAID.jpg
-es_PE/images/3/32/Glucokinase-1GLK.png
-es_PE/images/3/32/Hubble_01.jpg
-es_PE/images/3/32/Anabaena_sperica.jpg
-es_PE/images/3/32/Nobel_prize_medal.svg
-es_PE/images/3/32/Nobel_prize_medal.svg.jpg
-es_PE/images/3/32/Dscf0634.jpg
-es_PE/images/3/32/Wikiquote-logo.png
-es_PE/images/3/32/Flag_of_Pakistan.svg
-es_PE/images/3/32/Decalogue_parchment_by_Jekuthiel_Sofer_1768.jpg
-es_PE/images/3/32/GeorgeWBush_Signature.svg
-es_PE/images/3/32/GeorgeWBush_Signature.svg.jpg
-es_PE/images/3/32/Dürer_karl_der_grosse.jpg
-es_PE/images/3/37/Auguste_Rodin_-_Grubleren_2005-02.jpg
-es_PE/images/3/37/Acropolis_of_Athens_01361.JPG
-es_PE/images/3/37/Palaciosalvo.jpg
-es_PE/images/3/37/Map-of-human-migrations.jpg
-es_PE/images/3/37/BigPinkHeart.jpg
-es_PE/images/3/37/PaseodelaReforma.jpg
-es_PE/images/3/37/Imperial_Seal_of_Japan.svg
-es_PE/images/3/37/Solar_Panels.jpg
-es_PE/images/3/37/Flag_of_the_United_Provinces_of_Central_America.svg
-es_PE/images/3/37/Flag_of_the_United_Provinces_of_Central_America.svg.jpg
-es_PE/images/3/37/Colombia_(regiones_naturales).png
-es_PE/images/3/37/Conquest_of_Mexico_1519-1521.svg
-es_PE/images/3/37/Conquest_of_Mexico_1519-1521.svg.jpg
-es_PE/images/3/3f/Pennies.jpg
-es_PE/images/3/3f/Margarita.jpg
-es_PE/images/3/3f/Banner_of_the_Holy_Roman_Emperor_(after_1400).svg
-es_PE/images/3/3f/Banner_of_the_Holy_Roman_Emperor_(after_1400).svg.jpg
-es_PE/images/3/3f/Catedral_de_Guadalajara_2.jpg
-es_PE/images/3/3f/Paper_sheet.jpg
-es_PE/images/3/3f/Queen_1984_0009.jpg
-es_PE/images/3/3f/Graffiti_Rosario_-_Jim_Morrison.jpg
-es_PE/images/3/3f/Spiderman_dod.jpg
-es_PE/images/3/3f/Future_video_game_icon.svg
-es_PE/images/3/3f/Future_video_game_icon.svg.jpg
-es_PE/images/3/3a/LA2-NSRW-2-0064.jpg
-es_PE/images/3/3a/USDOT_highway_sign_bicycle_symbol_-_white_on_green.svg
-es_PE/images/3/3a/USDOT_highway_sign_bicycle_symbol_-_white_on_green.svg.jpg
-es_PE/images/3/3a/Hc_frenteop.jpg
-es_PE/images/3/3a/William-Adolphe_Bouguereau_(1825-1905)_-_The_Day_of_the_Dead_(1859).jpg
-es_PE/images/3/3a/A_child_sleeping.jpg
-es_PE/images/3/3a/Bob-Marley-in-Concert_Zurich_05-30-80.jpg
-es_PE/images/3/3a/Expo_2005_Sasashima_Satellite_Studio_Deï½¥Laï½¥Fantasia03.jpg
-es_PE/images/3/3a/Frida_Kahlo_Diego_Rivera_1932.jpg
-es_PE/images/3/3a/Canon_S520_ink_jet_printer.jpg
-es_PE/images/3/3a/Melencolia_I.jpg
-es_PE/images/3/3a/Llama,_peru,_machu_picchu.jpg
-es_PE/images/3/3a/CoaofGreatColombia.gif
-es_PE/images/3/34/Wikiversity-logo-Snorky.svg
-es_PE/images/3/34/Wikiversity-logo-Snorky.svg.jpg
-es_PE/images/3/34/The_London's_Gherkin_.JPG
-es_PE/images/3/34/Dpedro2.png
-es_PE/images/3/34/Flag_of_El_Salvador.svg
-es_PE/images/3/34/Flag_of_El_Salvador.svg.jpg
-es_PE/images/3/34/TakakkawFalls2.jpg
-es_PE/images/3/34/FibPlot.png
-es_PE/images/3/34/Stomach_diagram-es.svg
-es_PE/images/3/34/Stomach_diagram-es.svg.jpg
-es_PE/images/3/34/Shawn_Michaels_in_England.jpg
-es_PE/images/3/3c/Nupedia.jpg
-es_PE/images/3/3c/Solar_planets.jpg
-es_PE/images/3/3c/Guayaqil_MuseoAntropologicoydeArteContemporaneo.JPG
-es_PE/images/3/3c/GoldenMedows.jpg
-es_PE/images/3/3c/3phase-rmf-320x240-180fc.gif
-es_PE/images/3/3c/Spain_topo.jpg
-es_PE/images/3/3c/Nitrosp_360px.png
-es_PE/images/3/3c/Cristiano_Ronaldo.jpg
-es_PE/images/3/39/Mitochondrie.svg
-es_PE/images/3/39/Mitochondrie.svg.jpg
-es_PE/images/3/39/Bronchiolar_epithelium_3_-_SEM.jpg
-es_PE/images/3/39/Europe_biogeography_countries.svg
-es_PE/images/3/39/Europe_biogeography_countries.svg.jpg
-es_PE/images/3/39/Concorde_216_(G-BOAF)_last_flight.jpg
-es_PE/images/3/39/Tipo_Ala_en_doble_flecha.JPG
-es_PE/images/3/39/M87_jet.jpg
-es_PE/images/3/39/Dräkt,_Flandrisk_dam,_Nordisk_familjebok.png
-es_PE/images/3/39/HMG-CoA_reductase_pathway.png
-es_PE/images/3/39/Anders_Zorn_-_Emma_Zorn_läsande.jpg
-es_PE/images/3/39/Ovulation.jpg
-es_PE/images/3/39/UNESCO_World_Heritage_flag.jpg
-es_PE/images/3/39/Plumpollen0060.jpg
-es_PE/images/3/36/Fungus_on_Fungus.jpg
-es_PE/images/3/36/LocationUruguay.svg
-es_PE/images/3/36/LocationUruguay.svg.jpg
-es_PE/images/3/36/Hopetoun_falls.jpg
-es_PE/images/3/36/Rembrandt_Harmensz._van_Rijn_038.jpg
-es_PE/images/3/36/Zulu_men_eating_1920s.JPG
-es_PE/images/3/36/Cesar_vallejo_1929.jpg
-es_PE/images/3/36/Waterspout_noaa00307.jpg
-es_PE/images/3/36/LocationAU.svg
-es_PE/images/3/36/LocationAU.svg.jpg
-es_PE/images/3/36/Flag_of_Albania.svg
-es_PE/images/3/36/Flag_of_Albania.svg.jpg
-es_PE/images/3/36/EU_location_POL.png
-es_PE/images/3/36/Location_Monterrey.png
-es_PE/images/3/38/Benitojuarezarptaerial.jpg
-es_PE/images/3/38/Flag_of_Tuvalu.svg
-es_PE/images/3/38/Flag_of_Tuvalu.svg.jpg
-es_PE/images/3/38/Richard_herring.jpg
-es_PE/images/3/38/Volleyball_game.jpg
-es_PE/images/3/38/VanGogh_1887_Selbstbildnis.jpg
-es_PE/images/3/38/Pacaya_erupting_in_1976.jpg
-es_PE/images/3/38/Flag_of_Tanzania.svg
-es_PE/images/3/38/Anaximander.jpg
-es_PE/images/3/38/Juan_Carlos_da_Espanha.jpg
-es_PE/images/3/3e/Vista-hd.png
-es_PE/images/3/3e/Flag_of_New_Zealand.svg
-es_PE/images/3/3e/Ohridski-Livingston.jpg
-es_PE/images/3/3e/91's_1000v.jpg
-es_PE/images/3/3e/Metallica_live_London_2003-12-19.jpg
-es_PE/images/3/3e/BenjaminFranklinLightening.jpg
-es_PE/images/3/3e/Map_of_NAFTA.png
-es_PE/images/3/3e/KelsoLevinsonWWOZ.jpg
-es_PE/images/3/3e/Kraj_Hlavni_mesto_Praha.svg
-es_PE/images/3/3e/Kraj_Hlavni_mesto_Praha.svg.jpg
-es_PE/images/3/3e/Paz0.jpg
-es_PE/images/3/3e/Kleopatra-VII.-Altes-Museum-Berlin1.jpg
-es_PE/images/3/3e/Tomas_Carrasquilla-Busto-Medellin.JPG
-es_PE/images/3/3b/Leptospira_scanning_micrograph.jpg
-es_PE/images/3/3b/PhylogeneticTree_horizontal_transfers.png
-es_PE/images/3/3b/Banco_del_Sur.jpg
-es_PE/images/3/3b/Topographic30deg_S30W150.png
-es_PE/images/3/3b/Ru_transcaucasia1922.png
-es_PE/images/3/3b/Hilton,_Paris_(2007).jpg
-es_PE/images/3/3b/3D_Cartesian_coordinates.PNG
-es_PE/images/3/31/William_Shakespeare.jpg
-es_PE/images/3/31/Flag_of_Samoa.svg
-es_PE/images/3/31/Flag_of_Samoa.svg.jpg
-es_PE/images/3/31/Shinkansen_500_Kyoto_2005-03-19.jpg
-es_PE/images/3/31/Grunewald_-_christ.jpg
-es_PE/images/3/31/Etna_eruption_seen_from_the_International_Space_Station.jpg
-es_PE/images/3/31/Three_small_electric_motors.jpg
-es_PE/images/3/31/Flag_of_Equatorial_Guinea.svg
-es_PE/images/3/31/Flag_of_Equatorial_Guinea.svg.jpg
-es_PE/images/3/31/EC_Black_Piglets.JPG
-es_PE/images/3/31/Parabola2.png
-es_PE/images/3/31/SantiagoSatellite.jpg
-es_PE/images/3/33/Gymnasta.jpg
-es_PE/images/3/33/Takatori_Catholic_Church.JPG
-es_PE/images/3/33/Hl-Valentin-mit-Stifter-150.jpg
-es_PE/images/3/33/USMC_Marathon.jpg
-es_PE/images/3/33/Tree_of_Knowledge.jpg
-es_PE/images/3/33/Republicas_mundiales.png
-es_PE/images/3/33/Rust.jpg
-es_PE/images/3/33/Gantt-chart.png
-es_PE/images/3/33/Flag_Portugal_(1707).svg
-es_PE/images/3/33/Flag_Portugal_(1707).svg.jpg
-es_PE/images/3/35/Onde_electromagnetique.svg
-es_PE/images/3/35/Onde_electromagnetique.svg.jpg
-es_PE/images/3/35/National_Cockade_of_Uruguay.png
-es_PE/images/3/35/Flag_of_the_Cook_Islands.svg
-es_PE/images/3/35/Flag_of_the_Cook_Islands.svg.jpg
-es_PE/images/3/35/Fragata_Numancia.jpg
-es_PE/images/3/35/Carbon_dioxide_pressure-temperature_phase_diagram_international.png
-es_PE/images/3/35/Gas_Washing_Bottle.jpg
-es_PE/images/3/35/Location_Sweden_EU_Europe.png
-es_PE/images/3/35/Ethene.png
-es_PE/images/3/35/Male_anatomy.png
-es_PE/images/3/35/Troas-es.svg
-es_PE/images/3/35/Troas-es.svg.jpg
-es_PE/images/3/35/DuplexScaling.jpg
-es_PE/images/3/35/Edificio_BVC.jpg
-es_PE/images/3/30/Flag_of_Nauru.svg
-es_PE/images/3/30/Flag_of_Nauru.svg.jpg
-es_PE/images/3/30/Map-Hispanophone_World.PNG
-es_PE/images/3/30/Wooden_roller_coaster_txgi.jpg
-es_PE/images/3/30/Soil_sci.jpg
-es_PE/images/3/30/1-D_kinematics.svg
-es_PE/images/3/30/Pulley.jpg
-es_PE/images/3/30/Apocalyptica_2005.jpg
-es_PE/images/3/3d/LocationChile.svg
-es_PE/images/3/3d/LocationChile.svg.jpg
-es_PE/images/3/3d/ROM_BIOS.jpg
-es_PE/images/3/3d/Bartolomé_Esteban_Perez_Murillo_004.jpg
-es_PE/images/3/3d/Cache,basic.svg
-es_PE/images/3/3d/Cache,basic.svg.jpg
-es_PE/images/3/3d/Hans_Selye.jpg
-es_PE/images/3/3d/BanderaGranColombia.png
-es_PE/images/2/2a/Coat_of_arms_of_Mexico.svg
-es_PE/images/2/2a/Coat_of_arms_of_Mexico.svg.jpg
-es_PE/images/2/2a/FIRE_01.JPG
-es_PE/images/2/2a/Shakespeare_Globe_Theater_1_db.jpg
-es_PE/images/2/2a/Views_of_a_Foetus_in_the_Womb_detail.jpg
-es_PE/images/2/2a/Moon_PIA00304.jpg
-es_PE/images/2/2a/Asia_satellite_orthographic.jpg
-es_PE/images/2/2a/Estadio_centenario_2.JPG
-es_PE/images/2/2a/Tipo_Ala_en_flecha.JPG
-es_PE/images/2/2a/Spanish_Language_Wiki.svg
-es_PE/images/2/2a/Spanish_Language_Wiki.svg.jpg
-es_PE/images/2/2a/San_valentino.png
-es_PE/images/2/2a/Paris_coa.png
-es_PE/images/2/2a/Anatomia_del_corpo_humano.jpg
-es_PE/images/2/2a/Flag_of_Germany_(2-3).svg
-es_PE/images/2/2a/Us_flag_large_Betsy_Ross.png
-es_PE/images/2/2a/Ph_regions_and_provinces.png
-es_PE/images/2/2a/Translation_arrow.svg
-es_PE/images/2/2a/Translation_arrow.svg.jpg
-es_PE/images/2/2e/Mercedes-simplex-508.jpg
-es_PE/images/2/2e/Ciclocarbo.png
-es_PE/images/2/2e/Flag_of_the_Marshall_Islands.svg
-es_PE/images/2/2e/Flag_of_the_Marshall_Islands.svg.jpg
-es_PE/images/2/2e/Oil-spill.jpg
-es_PE/images/2/2e/Male_reproductive_system_lateral_nolabel.png
-es_PE/images/2/2e/Cartesian-coordinate-system-with-circle.svg
-es_PE/images/2/2e/Cartesian-coordinate-system-with-circle.svg.jpg
-es_PE/images/2/2e/LocationCostaRica.svg
-es_PE/images/2/2e/LocationCostaRica.svg.jpg
-es_PE/images/2/2e/Kladka.jpg
-es_PE/images/2/2e/Coat_of_arms_of_Poland-official.png
-es_PE/images/2/2e/Mercury_symbol.svg
-es_PE/images/2/2e/Mercury_symbol.svg.jpg
-es_PE/images/2/2e/George-Washington.jpg
-es_PE/images/2/2e/Magendarmkanal.JPG
-es_PE/images/2/24/Gustave_Courbet_038.jpg
-es_PE/images/2/24/Wikinews-logo.svg
-es_PE/images/2/24/Wikinews-logo.svg.jpg
-es_PE/images/2/24/Cassini-science-br.jpg
-es_PE/images/2/24/Emile_Durkheim.jpg
-es_PE/images/2/24/Gran_marical_de_ayacucho.jpg
-es_PE/images/2/24/Garciaalan09112006.jpg
-es_PE/images/2/24/TAPA.jpg
-es_PE/images/2/24/Zac_Efron_2007.jpg
-es_PE/images/2/24/Handball_the_ball.jpg
-es_PE/images/2/24/Tiroides_anatomia_01.jpg
-es_PE/images/2/24/Tudanca.JPG
-es_PE/images/2/24/Escudo_de_Euskadi.svg
-es_PE/images/2/24/Escudo_de_Euskadi.svg.jpg
-es_PE/images/2/24/World_1898_empires_colonies_territory.png
-es_PE/images/2/24/OECD-memberstates.png
-es_PE/images/2/2b/Huracán_Hugo.jpg
-es_PE/images/2/2b/First_View_of_Earth_from_Moon.jpg
-es_PE/images/2/2b/1er_vol_de_l'_A380.jpg
-es_PE/images/2/2b/2004_Indian_Ocean_earthquake_Maldives_tsunami_wave.jpg
-es_PE/images/2/2b/Memoria_USB_sony_2.0_Vaio_512_mb.JPG
-es_PE/images/2/2b/Salsa_dancing.jpg
-es_PE/images/2/2b/Colonisation_1800.png
-es_PE/images/2/2b/Coat_of_Arms_of_the_Philippines.svg
-es_PE/images/2/2b/Coat_of_Arms_of_the_Philippines.svg.jpg
-es_PE/images/2/26/Noia_64_apps_wp.png
-es_PE/images/2/26/GilgameshTablet.jpg
-es_PE/images/2/26/Coat_of_arms_of_the_Dominican_Republic.svg
-es_PE/images/2/26/Coat_of_arms_of_the_Dominican_Republic.svg.jpg
-es_PE/images/2/26/Flag_of_East_Timor.svg
-es_PE/images/2/26/30_Seconds_to_Mars.jpg
-es_PE/images/2/26/Plasma-lamp_2.jpg
-es_PE/images/2/26/Jupiter_symbol.svg
-es_PE/images/2/26/Jupiter_symbol.svg.jpg
-es_PE/images/2/26/Coat_of_arms_of_Saudi_Arabia.svg
-es_PE/images/2/26/Coat_of_arms_of_Saudi_Arabia.svg.jpg
-es_PE/images/2/26/Vampire_world_bank_protest16.jpg
-es_PE/images/2/25/H2O.jpg
-es_PE/images/2/25/Nucleus_ER_golgi.jpg
-es_PE/images/2/25/Tradicionalranchero.jpg
-es_PE/images/2/25/Fmrtuebersicht.jpg
-es_PE/images/2/25/Don_Quixote.jpg
-es_PE/images/2/25/Barras_en_el_MFO.JPG
-es_PE/images/2/25/Med_2.png
-es_PE/images/2/25/Evaporación_agua.jpg
-es_PE/images/2/25/LocationDominicanRepublic.svg
-es_PE/images/2/25/LocationDominicanRepublic.svg.jpg
-es_PE/images/2/25/Michel-eyquem-de-montaigne_1.jpg
-es_PE/images/2/25/WWWlogo.png
-es_PE/images/2/25/Franklin-Benjamin-LOC.jpg
-es_PE/images/2/25/Cholesterol.png
-es_PE/images/2/25/Arcoiris.JPG
-es_PE/images/2/25/SaulHudson.jpg
-es_PE/images/2/25/Herring2.jpg
-es_PE/images/2/21/Santa_fe1mxc.jpg
-es_PE/images/2/21/Flag_of_Colombia.svg
-es_PE/images/2/21/Virus-types.png
-es_PE/images/2/21/Flag_of_Vietnam.svg
-es_PE/images/2/21/NL_-_COA.png
-es_PE/images/2/21/Plano_de_sevilla.PNG
-es_PE/images/2/21/David_Hume.jpg
-es_PE/images/2/23/Cell_Cycle.svg
-es_PE/images/2/23/Cell_Cycle.svg.jpg
-es_PE/images/2/23/México_relieve.png
-es_PE/images/2/23/FilmCrew.jpg
-es_PE/images/2/23/Flag_of_New_Caledonia.svg
-es_PE/images/2/23/Flag_of_New_Caledonia.svg.jpg
-es_PE/images/2/23/Gdp_nominal_2006_estimated_world_map.png
-es_PE/images/2/23/Thor.jpg
-es_PE/images/2/23/Pasajes_conductores_sisresp.jpg
-es_PE/images/2/23/Nietzsche1882.jpg
-es_PE/images/2/23/Lake_mapourika_NZ.jpeg
-es_PE/images/2/23/FIAV_100100.svg
-es_PE/images/2/23/Athanasius_Kircher's_Atlantis.gif
-es_PE/images/2/23/Female.svg
-es_PE/images/2/23/Mg-TableImage.png
-es_PE/images/2/2c/Robert_Hooke_portrait.jpg
-es_PE/images/2/2c/Rotating_earth_(large).gif
-es_PE/images/2/2c/Cerro_Batoví.JPG
-es_PE/images/2/2c/Broom_icon.svg
-es_PE/images/2/2c/Broom_icon.svg.jpg
-es_PE/images/2/2c/Piccadilly-Circus-Publicité-Nuit.jpg
-es_PE/images/2/2c/Lineale.jpg
-es_PE/images/2/2c/Gandhi_studio_1931.jpg
-es_PE/images/2/2c/Statue-of-liberty_tysto.jpg
-es_PE/images/2/2c/Flag_of_Morocco.svg
-es_PE/images/2/2c/Flag_of_Morocco.svg.jpg
-es_PE/images/2/2c/Mendel_seven_characters_es.svg
-es_PE/images/2/2c/Mendel_seven_characters_es.svg.jpg
-es_PE/images/2/2c/Ginsberg-dylan2.jpg
-es_PE/images/2/2c/Bandera_cadiz_01.jpg
-es_PE/images/2/22/Da_Vinci_Vitruve_Luc_Viatour.jpg
-es_PE/images/2/22/LocationAsia.png
-es_PE/images/2/22/Electromagnetic_spectrum_(es).gif
-es_PE/images/2/22/Flag_of_the_Second_Spanish_Republic.svg
-es_PE/images/2/22/Flag_of_the_Second_Spanish_Republic.svg.jpg
-es_PE/images/2/22/Cloverfield_at_Mann's_Chinese.jpg
-es_PE/images/2/22/LocationPanama.svg
-es_PE/images/2/22/LocationPanama.svg.jpg
-es_PE/images/2/22/Usb-svg.svg
-es_PE/images/2/22/ATP-3D-vdW.png
-es_PE/images/2/22/Balance.jpg
-es_PE/images/2/27/Flag_of_Paraguay.svg
-es_PE/images/2/27/Flag_of_Paraguay.svg.jpg
-es_PE/images/2/27/O._oeni.jpg
-es_PE/images/2/27/Eighth_note_run.png
-es_PE/images/2/27/Krill.jpg
-es_PE/images/2/27/Flag_of_Moldova.svg
-es_PE/images/2/27/Flag_of_Moldova.svg.jpg
-es_PE/images/2/27/Europe_location_ENG.png
-es_PE/images/2/27/Benito_Juarez_Presidente.jpg
-es_PE/images/2/27/Salvador_Dali_NYWTS.jpg
-es_PE/images/2/27/Simple_Plan_in_Agawam,_MA.jpeg
-es_PE/images/2/27/USB_Male_Plug_Type_A.jpg
-es_PE/images/2/27/Santi_di_Tito_-_Niccolo_Machiavelli's_portrait_headcrop.jpg
-es_PE/images/2/27/Crystal_Clear_mimetype_php.png
-es_PE/images/2/27/Tercer_puesto.png
-es_PE/images/2/27/U2.svg
-es_PE/images/2/27/U2.svg.jpg
-es_PE/images/2/29/Emblem-scales.svg
-es_PE/images/2/29/Emblem-scales.svg.jpg
-es_PE/images/2/29/Nazca-pottery-(01).png
-es_PE/images/2/29/North_America_satellite_orthographic.jpg
-es_PE/images/2/29/H-TableImage.png
-es_PE/images/2/29/Lorrain.seaport.jpg
-es_PE/images/2/29/Crusade_damietta.jpg
-es_PE/images/2/29/MRT_Bild_Multiple_Sklerose_Läsion.jpg
-es_PE/images/2/29/Treponema_pallidum.jpg
-es_PE/images/2/29/SATA_ports.jpg
-es_PE/images/2/29/Aoraki-Mount_Cook_from_Hooker_Valley.jpg
-es_PE/images/2/28/Copernicus.jpg
-es_PE/images/2/28/Trilla_del_trigo_en_el_Antiguo_Egipto.jpg
-es_PE/images/2/28/Expecting_family.jpg
-es_PE/images/2/28/Tipo_Ala_ojival.JPG
-es_PE/images/2/28/Fisiologia_Emociones.jpg
-es_PE/images/2/28/Número_de_desastres_naturales.JPG
-es_PE/images/2/28/Flag_of_Puerto_Rico.svg
-es_PE/images/2/28/Location_France_EU_Europe.png
-es_PE/images/2/28/England_COA.svg
-es_PE/images/2/28/England_COA.svg.jpg
-es_PE/images/2/28/Cenawwe2.jpg
-es_PE/images/2/28/Pinicola_enucleator.jpg
-es_PE/images/2/28/Diamonds_glitter.png
-es_PE/images/2/20/Ceramic_planter_from_the_Ming_Dynasty.jpg
-es_PE/images/2/20/Red_Moon_04.jpg
-es_PE/images/2/20/Flag_of_the_Netherlands.svg
-es_PE/images/2/20/Zeus_Otricoli_Pio-Clementino_Inv257.jpg
-es_PE/images/2/20/Streptococcus_pneumoniae.jpg
-es_PE/images/2/20/LocationTurkey.svg
-es_PE/images/2/20/LocationTurkey.svg.jpg
-es_PE/images/2/20/Escudo_asuncion_beta.png
-es_PE/images/2/20/NAFTA_logo.png
-es_PE/images/2/20/Mozilla_calendar.PNG
-es_PE/images/2/20/Seabirds_longlinersm.jpg.jpeg
-es_PE/images/2/20/Kircher_Tree_of_Life.png
-es_PE/images/2/20/Co-map.png
-es_PE/images/2/20/Organigrama-UNAL.jpg
-es_PE/images/2/2f/Hubble_ultra_deep_field.jpg
-es_PE/images/2/2f/Flag_of_Germany_1933.svg
-es_PE/images/2/2f/HIV-budding.jpg
-es_PE/images/2/2f/Flag_of_the_United_Nations.svg
-es_PE/images/2/2f/Flag_of_the_United_Nations.svg.jpg
-es_PE/images/2/2f/Venn_A_union_B.png
-es_PE/images/2/2f/Flag_of_Armenia.svg
-es_PE/images/2/2f/Au,79.jpg
-es_PE/images/2/2f/Pau_gasol_zz.jpg
-es_PE/images/2/2f/Homere.jpg
-es_PE/images/2/2f/Durometro.JPG
-es_PE/images/2/2d/Bandera_de_Uruguay.jpg
-es_PE/images/2/2d/GWR_'Hall'_5972_'Olton_Hall'_at_Doncaster_Works.JPG
-es_PE/images/2/2d/Flag_of_the_Basque_Country.svg
-es_PE/images/2/2d/ProstitutaBabilonia.jpg
-es_PE/images/2/2d/Venus_Earth_Comparison.png
-es_PE/images/2/2d/Ceratium_hirundinella.jpg
-es_PE/images/2/2d/Largest_ever_Ozone_hole_sept2000_with_scale.jpg
-es_PE/images/2/2d/Anaximenes.jpg
-es_PE/images/c/c7/LocationMexico.svg
-es_PE/images/c/c7/LocationMexico.svg.jpg
-es_PE/images/c/c7/Apfel_partikel.jpg
-es_PE/images/c/c7/User-FastFission-brain.gif
-es_PE/images/c/c7/Herz-Heart.jpg
-es_PE/images/c/c7/LocationGuatemala.svg
-es_PE/images/c/c7/LocationGuatemala.svg.jpg
-es_PE/images/c/c7/Flag_of_the_City_of_London.svg
-es_PE/images/c/c7/Flag_of_the_City_of_London.svg.jpg
-es_PE/images/c/c7/Europe_location_ISL.png
-es_PE/images/c/c7/Hawaii_state_seal.png
-es_PE/images/c/c7/Tesla2.jpg
-es_PE/images/c/c1/Computer-aj_aj_ashton_01.svg
-es_PE/images/c/c1/Computer-aj_aj_ashton_01.svg.jpg
-es_PE/images/c/c1/Arica_battle.jpg
-es_PE/images/c/c1/Wedding.smallgroup.arp.750pix.jpg
-es_PE/images/c/c1/Flag_of_Hungary.svg
-es_PE/images/c/c1/Poisson_distribution_PMF.png
-es_PE/images/c/c1/CT1024_Terminal_System.jpg
-es_PE/images/c/c1/Christopher_Columbus_Face.jpg
-es_PE/images/c/c1/Cundinamarca,_Colombia_(bandera).png
-es_PE/images/c/c1/Korn_MTV_Asia_Awards_2006.jpg
-es_PE/images/c/c1/Freiheitsstatue_NYC_full.jpg
-es_PE/images/c/c6/Tree_Fern.jpg
-es_PE/images/c/c6/Cole_Thomas_The_Architect-s_Dream_1840.jpg
-es_PE/images/c/c6/Moon_symbol_decrescent.svg
-es_PE/images/c/c6/Moon_symbol_decrescent.svg.jpg
-es_PE/images/c/c6/Flag_of_Spain_(1785-1873_and_1875-1931).svg
-es_PE/images/c/c6/Flag_of_Spain_(1785-1873_and_1875-1931).svg.jpg
-es_PE/images/c/c6/Mexico-12-06-07_297.jpg
-es_PE/images/c/c6/Nostradamus_by_Cesar.jpg
-es_PE/images/c/c6/Wien040531w.jpg
-es_PE/images/c/c6/H9991083.jpg
-es_PE/images/c/ca/Kiss_Briseis_Painter_Louvre_G278.jpg
-es_PE/images/c/ca/PRD_party.png
-es_PE/images/c/ca/Supraleitung.jpg
-es_PE/images/c/ca/Surface_analysis.gif
-es_PE/images/c/ca/Flag_of_Iran.svg
-es_PE/images/c/ca/Flag_of_Iran.svg.jpg
-es_PE/images/c/ca/US_13_Star_Betsy_Ross_Flag.svg
-es_PE/images/c/ca/US_13_Star_Betsy_Ross_Flag.svg.jpg
-es_PE/images/c/ca/Popiersie_Edith_Piaf_ssj_20060914.jpg
-es_PE/images/c/c4/Mineral_Antracita_GDFL001.JPG
-es_PE/images/c/c4/Ala_elíptica.JPG
-es_PE/images/c/c4/Topographic30deg_S30W120.png
-es_PE/images/c/c4/Cell_cycle.png
-es_PE/images/c/c4/Antena_gsm.jpg
-es_PE/images/c/c4/AndalusQuran.JPG
-es_PE/images/c/c4/COA_of_Denmark.svg
-es_PE/images/c/c4/COA_of_Denmark.svg.jpg
-es_PE/images/c/c4/Edouard_Manet_059.jpg
-es_PE/images/c/c4/Bandera_de_la_ciudad_de_Córdoba.png
-es_PE/images/c/c2/World_map_pol_2005_v02.svg
-es_PE/images/c/c2/World_map_pol_2005_v02.svg.jpg
-es_PE/images/c/c2/Santaanna1.JPG
-es_PE/images/c/c2/SnowflakesWilsonBentley.jpg
-es_PE/images/c/c2/Curva_de_crecimiento.png
-es_PE/images/c/c2/Burgos_puente_san_pablo_nevado.jpg
-es_PE/images/c/c2/Solar_sys.jpg
-es_PE/images/c/c2/Nebra-1.jpg
-es_PE/images/c/c2/ADN_static.png
-es_PE/images/c/c2/ObamaSouthCarolina.jpg
-es_PE/images/c/c2/C,6.jpg
-es_PE/images/c/c2/Aguilagarza.jpg
-es_PE/images/c/c2/Flag_of_Mexico_1821.png
-es_PE/images/c/c2/Victor_hugo.jpg
-es_PE/images/c/c2/Albania_state_emblem.svg
-es_PE/images/c/c2/Albania_state_emblem.svg.jpg
-es_PE/images/c/c2/Flag_of_Tokyo.svg
-es_PE/images/c/c2/Flag_of_Tokyo.svg.jpg
-es_PE/images/c/c2/Flag_of_Guayaquil.svg
-es_PE/images/c/c2/Flag_of_Guayaquil.svg.jpg
-es_PE/images/c/c8/Alfabeto_gótico_manuscrito.png
-es_PE/images/c/c8/Ahu_Tahai.jpg
-es_PE/images/c/c8/Wikipe-tan_full_length.png
-es_PE/images/c/c8/Tim_burton.jpg
-es_PE/images/c/c8/Al,13.jpg
-es_PE/images/c/c8/Schraube.jpg
-es_PE/images/c/cd/AtmosphericDischarges.jpg
-es_PE/images/c/cd/VanGogh-starry_night.jpg
-es_PE/images/c/cd/Montevideouruguaynasa.jpg
-es_PE/images/c/cd/Kit_right_arm.svg
-es_PE/images/c/cd/Kit_right_arm.svg.jpg
-es_PE/images/c/cd/Coat_of_arms_of_Kosovo.svg
-es_PE/images/c/cd/Coat_of_arms_of_Kosovo.svg.jpg
-es_PE/images/c/cd/Pulley1a.png
-es_PE/images/c/cd/Sistemaurinario.png
-es_PE/images/c/cd/Madonna_logo2.png
-es_PE/images/c/cd/Praha_Bridges.JPG
-es_PE/images/c/cd/FalkirkWheelSide_2004_SeanMcClean.jpg
-es_PE/images/c/cc/Duchenne_de_Boulogne_1.jpg
-es_PE/images/c/cc/P_del_E_Cruise.JPG
-es_PE/images/c/cc/Aileron_roll.gif
-es_PE/images/c/cc/Immanuel_Kant_(portrait).jpg
-es_PE/images/c/cc/Coat_of_arms_of_Nicaragua.svg
-es_PE/images/c/cc/Coat_of_arms_of_Nicaragua.svg.jpg
-es_PE/images/c/cc/Europe_location_SCO.png
-es_PE/images/c/cc/Map_of_USA_TX.svg
-es_PE/images/c/cc/Map_of_USA_TX.svg.jpg
-es_PE/images/c/c0/Field,_corn,_Liechtenstein,_Mountains,_Alps,_Vaduz,_sky,_clouds,_landscape.jpg
-es_PE/images/c/c0/Shamans_Drum.jpg
-es_PE/images/c/c0/Lunar_libration_with_phase2.gif
-es_PE/images/c/c0/Earth-Moon2.jpg
-es_PE/images/c/c0/Bonampak_painting+contrast.jpg
-es_PE/images/c/c0/Scan12weeks.jpg
-es_PE/images/c/c0/Stromatolites.jpg
-es_PE/images/c/c0/Bluetooth_headset.jpg
-es_PE/images/c/c0/Giardia_lamblia.jpg
-es_PE/images/c/c0/Pirate_Flag_of_Rack_Rackham.svg
-es_PE/images/c/c0/Pirate_Flag_of_Rack_Rackham.svg.jpg
-es_PE/images/c/c3/Cellulose_strand.jpg
-es_PE/images/c/c3/Flag_of_France.svg
-es_PE/images/c/c3/Erik_Lemming.jpg
-es_PE/images/c/c3/NGC_4414_(NASA-med).jpg
-es_PE/images/c/c3/USS_Louisana.jpg
-es_PE/images/c/c3/800px-Claims_Of_Demoracy.png
-es_PE/images/c/c3/Crystal_Clear_app_camera.png
-es_PE/images/c/c3/Lindsaylohangfdl.jpg
-es_PE/images/c/c3/Euro_symbol_gold.svg
-es_PE/images/c/c3/Euro_symbol_gold.svg.jpg
-es_PE/images/c/c3/Jordan_by_Lipofsky_16577.jpg
-es_PE/images/c/c3/Loupe-binoculaire-p1030891.jpg
-es_PE/images/c/c3/CONTENEDOR4.jpg
-es_PE/images/c/c3/Medellín,_Antioquia,_Colombia_(ubicación).PNG
-es_PE/images/c/cf/Flag_of_Peru.svg
-es_PE/images/c/cf/HAtomOrbitals.png
-es_PE/images/c/cf/River_Plate.jpg
-es_PE/images/c/cf/Dirac_4.jpg
-es_PE/images/c/cf/Flag_of_Canada.svg
-es_PE/images/c/cf/Digestive_system_diagram_es.svg
-es_PE/images/c/cf/Digestive_system_diagram_es.svg.jpg
-es_PE/images/c/cf/Swamp_lake_Balarus.jpg
-es_PE/images/c/cf/Velocity_vs_time_graph.svg
-es_PE/images/c/cf/Velocity_vs_time_graph.svg.jpg
-es_PE/images/c/cf/Three_apples.svg
-es_PE/images/c/cf/Three_apples.svg.jpg
-es_PE/images/c/cf/Crystal_Clear_app_kaboodle.png
-es_PE/images/c/cf/Flag_of_North_Vietnam.svg
-es_PE/images/c/cf/Icono_listas.png
-es_PE/images/c/cf/Préservatif_féminin.jpg
-es_PE/images/c/cf/Elizabeth_I_Rainbow_Portrait.jpg
-es_PE/images/c/ce/Abbesches_Komparatorprinzip.jpg
-es_PE/images/c/ce/Congreso_del_Perú.JPG
-es_PE/images/c/ce/Flag_of_Catalonia.svg
-es_PE/images/c/ce/Flag_of_Iceland.svg
-es_PE/images/c/ce/Soccerball_current_event.svg
-es_PE/images/c/ce/Soccerball_current_event.svg.jpg
-es_PE/images/c/ce/AminoAcidball.svg
-es_PE/images/c/ce/AminoAcidball.svg.jpg
-es_PE/images/c/ce/Coat_of_arms_of_Rome.svg
-es_PE/images/c/ce/Coat_of_arms_of_Rome.svg.jpg
-es_PE/images/c/ce/Cambio_climatico.jpg
-es_PE/images/c/ce/Rom.gif
-es_PE/images/c/ce/US_flag_34_stars.svg
-es_PE/images/c/ce/US_flag_34_stars.svg.jpg
-es_PE/images/c/ce/Santiago_en_invierno.jpg
-es_PE/images/c/ce/K2_8611.jpg
-es_PE/images/c/ce/Ikata_Nuclear_Powerplant.JPG
-es_PE/images/c/ce/Burgos_Cathedral_2005-05-30.jpg
-es_PE/images/c/c5/Viracocha.jpg
-es_PE/images/c/c5/Ayaw.gif
-es_PE/images/c/c5/Egypt.Giza.Sphinx.01.jpg
-es_PE/images/c/c5/Edison_and_phonograph_edit2.jpg
-es_PE/images/c/c5/Zoso.svg
-es_PE/images/c/c5/Zoso.svg.jpg
-es_PE/images/c/c5/Ciclo-del-agua.jpg
-es_PE/images/c/c5/Birth_rate_figures_for_countries.PNG
-es_PE/images/c/c5/Roasted_coffee_beans.jpg
-es_PE/images/c/c5/Emo_boy_03_in_rage.jpg
-es_PE/images/c/c5/VVM_2007_foto_0061.JPG
-es_PE/images/c/c5/Mediatriz2.svg
-es_PE/images/c/c5/Mediatriz2.svg.jpg
-es_PE/images/c/c5/Malaga,_Spain_location.png
-es_PE/images/c/c5/Zn,30.jpg
-es_PE/images/c/c5/Pipette.jpg
-es_PE/images/c/c9/Penicillium_labeled.jpg
-es_PE/images/c/c9/C-141_Starlifter_contrail.jpg
-es_PE/images/c/c9/Allisvanity.jpg
-es_PE/images/c/c9/Academia_de_la_Lengua.jpg
-es_PE/images/c/c9/Forest1.jpg
-es_PE/images/c/c9/Raumthermometer_Fahrenheit+Celsius.jpg
-es_PE/images/c/c9/Myanmar_coa.gif
-es_PE/images/c/cb/14bis2.jpg
-es_PE/images/c/cb/Nuptse-fromKalarPatar.jpg
-es_PE/images/c/cb/Flag_of_the_Czech_Republic.svg
-es_PE/images/c/cb/Kamasutra1.jpg
-es_PE/images/c/cb/Barack_Obama_at_NH.jpg
-es_PE/images/c/cb/Paramecium.jpg
-es_PE/images/c/cb/Flag_of_the_United_Arab_Emirates.svg
-es_PE/images/c/cb/Flag_of_the_United_Arab_Emirates.svg.jpg
-es_PE/images/c/cb/Escudo_armas_Panama.png
-es_PE/images/c/cb/Neruda1.PNG
-es_PE/images/c/cb/EleanorRooseveltHumanRights.gif
-es_PE/images/c/cb/SCG032.JPG
-es_PE/images/c/cb/IMG_5509.jpg
-es_PE/images/c/cb/Pierre-Auguste_Renoir_112.jpg
-es_PE/images/c/cb/Wikinger.jpg
-es_PE/images/b/ba/EXC._II.jpg
-es_PE/images/b/ba/Flag_of_Germany.svg
-es_PE/images/b/ba/Oil_platform_Norway.jpg
-es_PE/images/b/ba/Experimento_Joule1.png
-es_PE/images/b/ba/Med_1.png
-es_PE/images/b/ba/NosferatuShadow.jpg
-es_PE/images/b/ba/Flag_of_Fiji.svg
-es_PE/images/b/ba/Flag_of_Fiji.svg.jpg
-es_PE/images/b/ba/Distribution-myn.png
-es_PE/images/b/ba/Seal_Of_The_President_Of_The_Unites_States_Of_America.svg
-es_PE/images/b/ba/Seal_Of_The_President_Of_The_Unites_States_Of_America.svg.jpg
-es_PE/images/b/ba/Roman_Empire_map.svg
-es_PE/images/b/ba/Roman_Empire_map.svg.jpg
-es_PE/images/b/ba/Flag_of_New_York_City.svg
-es_PE/images/b/ba/Flag_of_New_York_City.svg.jpg
-es_PE/images/b/ba/Tuebingen-gerstenmuehle.jpg
-es_PE/images/b/ba/IMG_1063.JPG
-es_PE/images/b/bf/Flag_of_Bermuda.svg
-es_PE/images/b/bf/Flag_of_Bermuda.svg.jpg
-es_PE/images/b/bf/Parcie_hydrostatyczne_szkic.svg
-es_PE/images/b/bf/Parcie_hydrostatyczne_szkic.svg.jpg
-es_PE/images/b/bf/Coat_of_arms_of_Brazil.svg
-es_PE/images/b/bf/Coat_of_arms_of_Brazil.svg.jpg
-es_PE/images/b/bf/Flag_of_Romania.png
-es_PE/images/b/bf/Escudo_de_Puerto_Rico_1.svg
-es_PE/images/b/bf/Escudo_de_Puerto_Rico_1.svg.jpg
-es_PE/images/b/bf/Escudo_San_Salvador.jpg
-es_PE/images/b/bf/Flag_of_Bosnia_and_Herzegovina.svg
-es_PE/images/b/bf/Flag_of_Bosnia_and_Herzegovina.svg.jpg
-es_PE/images/b/bf/Dragon_chinois.jpg
-es_PE/images/b/bf/BurjDubainov.jpg
-es_PE/images/b/b6/Herder.jpg
-es_PE/images/b/b6/Electromagnetic_spectrum-es.svg
-es_PE/images/b/b6/Electromagnetic_spectrum-es.svg.jpg
-es_PE/images/b/b6/Nationalencyklopedin2.jpg
-es_PE/images/b/b6/Coal.jpg
-es_PE/images/b/b6/Jules_Verne.jpg
-es_PE/images/b/b6/Countries_by_highest_point_map.PNG
-es_PE/images/b/b3/Three_by_Four.svg
-es_PE/images/b/b3/Three_by_Four.svg.jpg
-es_PE/images/b/b3/BenitoJuarez.jpg
-es_PE/images/b/b3/Auguste_Comte.jpg
-es_PE/images/b/b3/Pollution_de_l'air.jpg
-es_PE/images/b/b3/Pollution_over_east_China.jpg
-es_PE/images/b/b3/Sonnenblume.jpg
-es_PE/images/b/b3/Genesis_on_egg_cropped.jpg
-es_PE/images/b/b3/EM_Spectrum_Properties_es.svg
-es_PE/images/b/b3/EM_Spectrum_Properties_es.svg.jpg
-es_PE/images/b/b3/Miley_Wants_To_Play_Too!.jpg
-es_PE/images/b/b3/Morelos_por_autor_anónimo.jpg
-es_PE/images/b/b3/Europe_location_ANR.png
-es_PE/images/b/b3/Na,11.jpg
-es_PE/images/b/b9/Internet_hosts.PNG
-es_PE/images/b/b9/Football_iu_1996.jpg
-es_PE/images/b/b9/Popocatopetl_sunrise.jpg
-es_PE/images/b/b9/Mate_uruguayo.jpg
-es_PE/images/b/b9/Ogórki_konserwowe.jpg
-es_PE/images/b/b9/Flag_of_Australia.svg
-es_PE/images/b/b9/Flag_of_Australia.svg.jpg
-es_PE/images/b/b9/Coat_of_Arms_of_Cuba.svg
-es_PE/images/b/b9/Coat_of_Arms_of_Cuba.svg.jpg
-es_PE/images/b/b9/Diversity_of_youth_in_Oslo_Norway.jpg
-es_PE/images/b/b9/CoatOfArmsSecondMexicanEmpireMaximilian.JPG
-es_PE/images/b/b9/Terrestrial_planet_size_comparisons.jpg
-es_PE/images/b/b9/Amazonie_deforestation.jpg
-es_PE/images/b/b9/LocationGranada,_Spain.png
-es_PE/images/b/b9/Kit_body_orangehorizontal.png
-es_PE/images/b/b9/Jews.jpg
-es_PE/images/b/b9/NBA_Conferences_Divisions.PNG
-es_PE/images/b/bb/DNA_ORF.gif
-es_PE/images/b/bb/Geodinámico.JPG
-es_PE/images/b/bb/SPQRomani.svg
-es_PE/images/b/bb/SPQRomani.svg.jpg
-es_PE/images/b/bb/Platinum-Iridium_meter_bar.jpg
-es_PE/images/b/bb/Central_Obesity_008.jpg
-es_PE/images/b/bb/David-Oath_of_the_Horatii-1784.jpg
-es_PE/images/b/bb/LocationNicaragua.svg
-es_PE/images/b/bb/LocationNicaragua.svg.jpg
-es_PE/images/b/bb/Tokio_Hotel_live.jpg
-es_PE/images/b/bb/Espresso.jpg
-es_PE/images/b/bb/Infiltrating_ductal_carcinoma_of_the_breast.jpg
-es_PE/images/b/bb/Major_greenhouse_gas_trends.png
-es_PE/images/b/b5/USA_Antelope-Canyon.jpg
-es_PE/images/b/b5/Monedamexico.jpg
-es_PE/images/b/b5/MC68HC11_microcontroller.jpg
-es_PE/images/b/b5/Johnny_Depp_1.JPG
-es_PE/images/b/b5/CGKilogram.jpg
-es_PE/images/b/b5/Vitaminas.jpg
-es_PE/images/b/b5/Green_up.png
-es_PE/images/b/b5/Jh-grave.jpg
-es_PE/images/b/b5/Electroscope.png
-es_PE/images/b/b5/Tupac4.jpg
-es_PE/images/b/bd/PASD_party.png
-es_PE/images/b/bd/Arquitectura_von_Neumann.png
-es_PE/images/b/bd/Angelo_Bronzino_001.jpg
-es_PE/images/b/bd/Water_drop_animation_enhanced_small.gif
-es_PE/images/b/bd/Pythia1.jpg
-es_PE/images/b/bd/Banderagall.jpg
-es_PE/images/b/bd/Rou04.jpg
-es_PE/images/b/bd/Flag_of_Cuba.svg
-es_PE/images/b/bd/ByzantineEmpireGE.PNG
-es_PE/images/b/bd/Vivaldi.jpg
-es_PE/images/b/bd/Sylvester_Stallone_2.jpg
-es_PE/images/b/bd/Coat_of_arms_of_East_Timor.svg
-es_PE/images/b/bd/Coat_of_arms_of_East_Timor.svg.jpg
-es_PE/images/b/bd/Minerwa_from_Bath.jpg
-es_PE/images/b/b0/Physical_World_Map_2004-04-01.jpeg
-es_PE/images/b/b0/Nasa_swift_satellite.jpg
-es_PE/images/b/b0/Galileo-sustermans.jpg
-es_PE/images/b/b0/Atanasoff.jpg
-es_PE/images/b/b0/NewTux.svg
-es_PE/images/b/b0/NewTux.svg.jpg
-es_PE/images/b/b0/Gutenberg_Bible.jpg
-es_PE/images/b/b0/Martin_Luther_by_Lucas_Cranach_der_Ältere.jpeg
-es_PE/images/b/b0/AlexandreLouvre.jpg
-es_PE/images/b/b0/Flag_of_the_Canary_Islands.svg
-es_PE/images/b/b0/Flag_of_the_Canary_Islands.svg.jpg
-es_PE/images/b/b0/Copyright.svg
-es_PE/images/b/b0/Kit_left_arm_manutda0709.png
-es_PE/images/b/b0/Web20_logo.png
-es_PE/images/b/b7/Jean-Jacques_Rousseau_(painted_portrait).jpg
-es_PE/images/b/b7/Common_clownfish.jpg
-es_PE/images/b/b7/Europe_topography_map.png
-es_PE/images/b/b7/Refraction_-_Huygens-Fresnel_principle.svg
-es_PE/images/b/b7/Refraction_-_Huygens-Fresnel_principle.svg.jpg
-es_PE/images/b/b7/Tipo_Ala_doble_delta.JPG
-es_PE/images/b/b7/Female_mallard_nest_-_natures_pics_edit2.jpg
-es_PE/images/b/b7/Flag_of_Europe.svg
-es_PE/images/b/b7/South_Africa_Red_Ensign.png
-es_PE/images/b/b7/AMD_X2_3600.jpg
-es_PE/images/b/b7/Ferrofluid_poles.jpg
-es_PE/images/b/b7/LocationUSSR.png
-es_PE/images/b/b7/Mars_symbol.svg
-es_PE/images/b/b7/Mars_symbol.svg.jpg
-es_PE/images/b/b7/Brosen_city_bicycle.jpg
-es_PE/images/b/b7/024debret.jpg
-es_PE/images/b/b4/SalmonellaNIAID.jpg
-es_PE/images/b/b4/Facu3.jpg
-es_PE/images/b/b4/Flag_of_Turkey.svg
-es_PE/images/b/b4/Beatles_logo.png
-es_PE/images/b/b4/Asus_a8n_VMCSM02.jpg
-es_PE/images/b/b4/Saopaulo_copan.jpg
-es_PE/images/b/b4/Periodic_variation_of_Pauling_electronegativities.png
-es_PE/images/b/b1/Europe_satellite_globe.jpg
-es_PE/images/b/b1/World_population.PNG
-es_PE/images/b/b1/Flag_of_San_Marino.svg
-es_PE/images/b/b1/Flag_of_San_Marino.svg.jpg
-es_PE/images/b/b1/Kit_body_Barca1.png
-es_PE/images/b/b1/NAFTA_signing.jpg
-es_PE/images/b/b1/Glycolysis_enymes_(horizontal).png
-es_PE/images/b/b1/Cimex_lectularius.jpg
-es_PE/images/b/b1/Colouring_pencils.jpg
-es_PE/images/b/b1/Elipse2.png
-es_PE/images/b/b1/Zn-TableImage.png
-es_PE/images/b/b1/Barbie.jpg
-es_PE/images/b/b2/Isaac_Newton.jpeg
-es_PE/images/b/b2/Interiorofawatercooledcomputer.png
-es_PE/images/b/b2/Fracciones.gif
-es_PE/images/b/b2/Popol_vuh.jpg
-es_PE/images/b/b2/Emo_boy_02_with_Girl.jpg
-es_PE/images/b/bc/Flag_of_Finland.svg
-es_PE/images/b/bc/Flag_of_Vanuatu.svg
-es_PE/images/b/bc/Flag_of_Vanuatu.svg.jpg
-es_PE/images/b/bc/Flag_of_Costa_Rica_(state).svg
-es_PE/images/b/bc/Flag_of_Costa_Rica_(state).svg.jpg
-es_PE/images/b/bc/Flag_of_Madagascar.svg
-es_PE/images/b/bc/Slave_laborers_at_Buchenwald.jpg
-es_PE/images/b/bc/Ubuntu-7.10-default-screenshot-800x600.png
-es_PE/images/b/bc/Kidneys_from_behind.jpg
-es_PE/images/b/bc/Kiefer_Holz.JPG
-es_PE/images/b/bc/ElipseAnimada.gif
-es_PE/images/b/bc/Escudo_de_Tabasco.gif
-es_PE/images/b/b8/Deerfire.jpg
-es_PE/images/b/b8/Fidel_Castro5_cropped.JPG
-es_PE/images/b/b8/John_Locke.jpg
-es_PE/images/b/b8/Lower_wisdom_tooth.jpg
-es_PE/images/b/b8/Los_borrachos_o_el_triunfo_de_Baco_1629_Velázquez.jpg
-es_PE/images/b/be/Flag_of_England.svg
-es_PE/images/b/be/US-GreatSeal-Obverse.svg
-es_PE/images/b/be/US-GreatSeal-Obverse.svg.jpg
-es_PE/images/b/be/PH_indicator_paper.jpg
-es_PE/images/b/be/La_Boqueria.JPG
-es_PE/images/b/be/Zapotecos.png
-es_PE/images/b/be/Stalin1.jpg
-es_PE/images/0/0c/Jupiter_Tonans.jpg
-es_PE/images/0/0c/Mitochondria,_mammalian_lung_-_TEM.jpg
-es_PE/images/0/0c/Antarctic_surface_temperature.png
-es_PE/images/0/0c/Acid_rain_woods1.JPG
-es_PE/images/0/0c/Segmento-definicion.png
-es_PE/images/0/0c/Mysql9.JPG
-es_PE/images/0/0c/WilsonVersailles.jpg
-es_PE/images/0/0c/Congo_regions_named.png
-es_PE/images/0/0c/PEGI16.png
-es_PE/images/0/0c/Creatinine.png
-es_PE/images/0/09/Flag_of_Greenland.svg
-es_PE/images/0/09/Flag_of_South_Korea.svg
-es_PE/images/0/09/Flag_of_South_Korea.svg.jpg
-es_PE/images/0/09/Nuvola_apps_edu_phi.png
-es_PE/images/0/09/Departments_of_Uruguay_(map).png
-es_PE/images/0/09/Wrightflyer_highres.jpg
-es_PE/images/0/09/Warsaw2oh.jpg
-es_PE/images/0/09/Crystal_Clear_action_info.png
-es_PE/images/0/09/Marche_berlin002.jpg
-es_PE/images/0/09/Bach_dan.jpg
-es_PE/images/0/09/Johann_Schwarzer_movies_about_1906.jpg
-es_PE/images/0/09/Star_and_Crescent.svg
-es_PE/images/0/09/Sago_pancake_PNG.JPG
-es_PE/images/0/00/Charlie_Chaplin.jpg
-es_PE/images/0/00/Violinista.jpg
-es_PE/images/0/00/North_america.svg
-es_PE/images/0/00/North_america.svg.jpg
-es_PE/images/0/00/Universe_expansion_es.png
-es_PE/images/0/00/Flag_of_the_Vatican_City.svg
-es_PE/images/0/00/Flag_of_the_Vatican_City.svg.jpg
-es_PE/images/0/00/Anarchist.svg
-es_PE/images/0/00/Anarchist.svg.jpg
-es_PE/images/0/00/Location_Portugal_EU_Europe.png
-es_PE/images/0/00/Kit_right_arm_right_nike_Baca.png
-es_PE/images/0/00/Endomembrane_system_diagram.svg
-es_PE/images/0/00/Endomembrane_system_diagram.svg.jpg
-es_PE/images/0/00/Escudo_malaga.jpg
-es_PE/images/0/00/Karte_völkerwanderung.jpg
-es_PE/images/0/06/Wiktionary-logo-es.png
-es_PE/images/0/06/Flag_of_Venezuela.svg
-es_PE/images/0/06/Yokohama_MinatoMirai21.jpg
-es_PE/images/0/06/Universum.jpg
-es_PE/images/0/06/Delaroche_-_Bonaparte_franchissant_les_Alpes.jpg
-es_PE/images/0/06/Coat_of_arms_of_Bolivia.svg
-es_PE/images/0/06/Coat_of_arms_of_Bolivia.svg.jpg
-es_PE/images/0/06/HvadTidelsen.jpeg
-es_PE/images/0/06/Bolsantiago.jpg
-es_PE/images/0/06/SAP_AG_Headquarter_1200.jpg
-es_PE/images/0/07/Mapa_de_lenguas_de_México_+_100_000.png
-es_PE/images/0/07/LuisDonaldoColosio.jpg
-es_PE/images/0/07/Julia_balcony.jpg
-es_PE/images/0/07/World_literacy_map_UNHD_2007_2008.png
-es_PE/images/0/07/Salto_Angel_from_Raton.JPG
-es_PE/images/0/07/Kew.gardens.sugar.cane.arp.jpg
-es_PE/images/0/07/Asado2.jpg
-es_PE/images/0/07/Flag_of_Guam.svg
-es_PE/images/0/07/Flag_of_Guam.svg.jpg
-es_PE/images/0/07/Basketball.jpg
-es_PE/images/0/07/Flag_of_Dubai.svg
-es_PE/images/0/07/Gene.png
-es_PE/images/0/0e/Santa_feconj.jpg
-es_PE/images/0/0e/Bharatanatyam_7.jpg
-es_PE/images/0/0e/Uruguay_mapa.png
-es_PE/images/0/0e/Napoleon4.jpg
-es_PE/images/0/0e/Samurai.jpg
-es_PE/images/0/0e/Milk_glass.jpg
-es_PE/images/0/0e/Federico_García_Lorca.jpg
-es_PE/images/0/0e/StandingBuddha.JPG
-es_PE/images/0/0e/Acute_leukemia-ALL.jpg
-es_PE/images/0/0e/Goethe_(Stieler_1828).jpg
-es_PE/images/0/0e/Nightwish_with_Anette_and_Marco.jpg
-es_PE/images/0/0e/Emogirl.jpg
-es_PE/images/0/02/LocationSouthAmerica.png
-es_PE/images/0/02/Newtons_cradle_animation_smooth.gif
-es_PE/images/0/02/Augustin_Fresnel.jpg
-es_PE/images/0/02/80486dx2-large.jpg
-es_PE/images/0/02/Les_Très_Riches_Heures_du_duc_de_Berry_février.jpg
-es_PE/images/0/02/Marie-Antoinette;_koningin_der_Fransen.jpg
-es_PE/images/0/02/Seal_of_Los_Angeles,_California.svg
-es_PE/images/0/02/Seal_of_Los_Angeles,_California.svg.jpg
-es_PE/images/0/02/Messschraube_01_KMJ.jpg
-es_PE/images/0/05/Olympic_pictogram_Equestrian.png
-es_PE/images/0/05/Structure_bacterienne.png
-es_PE/images/0/05/CDKA_1948.jpg
-es_PE/images/0/05/Flag_of_Brazil.svg
-es_PE/images/0/05/Flag_of_Brazil.svg.jpg
-es_PE/images/0/05/RAM_module.jpg
-es_PE/images/0/05/HONDA_ASIMO.jpg
-es_PE/images/0/05/Veneto-Stemma.png
-es_PE/images/0/05/Hendrix_Caricature.jpg
-es_PE/images/0/05/Na-TableImage.png
-es_PE/images/0/05/Underwoodfive.jpg
-es_PE/images/0/08/Pain_epices_DSC00141.jpg
-es_PE/images/0/08/Convection.gif
-es_PE/images/0/08/Flagella.png
-es_PE/images/0/08/XXX_Cumbre_del_Mercosur_-_Córdoba_-_21JUL06_-_presidenciagovar.jpg
-es_PE/images/0/08/Dna-split.png
-es_PE/images/0/08/Walt_disney_portrait.jpg
-es_PE/images/0/08/Ellis_island_1902.jpg
-es_PE/images/0/08/Hegel_portrait_by_Schlesinger_1831.jpg
-es_PE/images/0/03/Light_beams_in_smoke03.jpg
-es_PE/images/0/03/Anolaima.jpg
-es_PE/images/0/03/Topographic30deg_S30E120.png
-es_PE/images/0/03/Flag_of_Italy.svg
-es_PE/images/0/03/Fe,26.jpg
-es_PE/images/0/03/Worldrecycle.jpg
-es_PE/images/0/03/Sandro_Botticelli_050.jpg
-es_PE/images/0/03/Francisco_de_Goya_y_Lucientes_026.jpg
-es_PE/images/0/03/Oasis_Noel_and_Liam_WF.jpg
-es_PE/images/0/03/Telescope.jpg
-es_PE/images/0/01/Giga1.JPG
-es_PE/images/0/01/Flag_of_Niue.svg
-es_PE/images/0/01/Flag_of_Niue.svg.jpg
-es_PE/images/0/01/Jonas_Brothers.png
-es_PE/images/0/01/Geokeys.jpg
-es_PE/images/0/01/Flag_of_California.svg
-es_PE/images/0/01/Flag_of_California.svg.jpg
-es_PE/images/0/01/Pahoeoe_fountain_original.jpg
-es_PE/images/0/01/Ethanol_CPK_ani.gif
-es_PE/images/0/01/Tornade003.jpg
-es_PE/images/0/0d/Joaquín_Torres_García_-_América_Invertida.jpg
-es_PE/images/0/0d/Saturn's_A_Ring_From_the_Inside_Out.jpg
-es_PE/images/0/0d/BoatSidesNamesInSpanish.PNG
-es_PE/images/0/0d/Adolf_Hitler_in_Yugoslavia_crop.JPG
-es_PE/images/0/0d/Seal_of_New_York_City.png
-es_PE/images/0/0d/Maome.jpg
-es_PE/images/0/0d/Flag_of_Italy_(1861-1946)_crowned.svg
-es_PE/images/0/0d/Flag_of_Italy_(1861-1946)_crowned.svg.jpg
-es_PE/images/0/0d/Bandera_de_Guadalajara.jpg
-es_PE/images/0/0d/Flag_of_Saudi_Arabia.svg
-es_PE/images/0/0d/Flag_of_Saudi_Arabia.svg.jpg
-es_PE/images/0/0d/Europe_location_VAT.png
-es_PE/images/0/0d/Oparin,_1946.jpg
-es_PE/images/0/0d/Coat_of_arms_of_Madagascar.png
-es_PE/images/0/0d/Flag_of_Venezuela_(1836-1859).svg
-es_PE/images/0/0d/Flag_of_Venezuela_(1836-1859).svg.jpg
-es_PE/images/0/0f/Totentanz.gif
-es_PE/images/0/0f/Mergefrom.svg
-es_PE/images/0/0f/Mergefrom.svg.jpg
-es_PE/images/0/0f/Colombia_coa.png
-es_PE/images/0/0f/Circle_cos.svg
-es_PE/images/0/0f/Circle_cos.svg.jpg
-es_PE/images/0/0f/Tangent_to_a_curve.svg
-es_PE/images/0/0f/Jan_van_Eyck_001.jpg
-es_PE/images/0/0f/Seal_of_California.svg
-es_PE/images/0/0f/Seal_of_California.svg.jpg
-es_PE/images/0/0f/Pavillon_royal_de_France.svg
-es_PE/images/0/0f/Pavillon_royal_de_France.svg.jpg
-es_PE/images/0/0f/Bouguereau_venus_detail.jpg
-es_PE/images/0/0f/Praha_CoA_CZ.svg
-es_PE/images/0/0f/Praha_CoA_CZ.svg.jpg
-es_PE/images/0/0f/Crepuscular_rays8_-_NOAA.jpg
-es_PE/images/0/0f/Acetylene-3D-vdW.png
-es_PE/images/0/0f/Beringia_at_Arctica_surface.png
-es_PE/images/0/0a/Flag_of_Jamaica.svg
-es_PE/images/0/0a/AdamSmith.jpg
-es_PE/images/0/0a/Ballot_box_current.svg
-es_PE/images/0/0a/Ballot_box_current.svg.jpg
-es_PE/images/0/0a/Regions_of_Croatia.png
-es_PE/images/0/0a/Rajoy.jpg
-es_PE/images/0/0a/Telluride_Power_Company.JPG
-es_PE/images/0/0a/Coat_of_arms_of_Thailand.png
-es_PE/images/0/0a/Kamee01.jpg
-es_PE/images/0/0b/Positive_angle.svg
-es_PE/images/0/0b/Positive_angle.svg.jpg
-es_PE/images/0/0b/Ltspkr.png
-es_PE/images/0/0b/Monumento-detalle-1812.jpg
-es_PE/images/0/0b/Firmafidel.jpg
-es_PE/images/0/0b/Lazio-Bandiera.png
-es_PE/images/0/0b/Mapa_conceptual_del_software_libre_2.png
-es_PE/images/0/0b/William-Adolphe_Bouguereau_(1825-1905)_-_Homer_and_his_Guide_(1874).jpg
-es_PE/images/0/0b/Bolsavalpo.jpg
-es_PE/images/0/0b/The_How_and_Why_Library_019.jpg
-es_PE/images/0/0b/LocationEastTimor.svg
-es_PE/images/0/0b/LocationEastTimor.svg.jpg
-es_PE/images/0/0b/La_creación_de_Adán.JPG
-es_PE/images/0/0b/Absolute_value.png
-es_PE/images/0/04/Flag_of_Guadeloupe_(local).svg
-es_PE/images/0/04/Flag_of_Guadeloupe_(local).svg.jpg
-es_PE/images/0/04/Primer_puesto.png
-es_PE/images/0/04/Colonias_europea_en_América_siglo_XVI-XVIII.png
-es_PE/images/0/04/MaunaKeaMap.jpg
-es_PE/images/0/04/Black_Sabbath_1999-12-16_Stuttgart.jpg
-es_PE/images/0/04/Kit_body_manutdh0709.png
-es_PE/images/7/71/ErnstHaeckel.jpg
-es_PE/images/7/71/Ant_nebula.jpg
-es_PE/images/7/71/Wolfsburg_VW-Werk.jpg
-es_PE/images/7/71/Map-Latin_America2.png
-es_PE/images/7/71/Biosphere_CZCS_NDVI.jpg
-es_PE/images/7/71/CarnavalBrazilRio2005.jpg
-es_PE/images/7/71/Shakspeare_signature.jpg
-es_PE/images/7/71/Flag_of_Ethiopia.svg
-es_PE/images/7/71/Flag_of_Ethiopia.svg.jpg
-es_PE/images/7/71/Typical_baseball_game.JPG
-es_PE/images/7/71/Flag_of_SFR_Yugoslavia.svg
-es_PE/images/7/71/Jaredletoinconcert2006.jpg
-es_PE/images/7/71/Menschliches_auge.jpg
-es_PE/images/7/71/Angulos_suplementarios.png
-es_PE/images/7/7c/Peugeot_206_WRC.jpg
-es_PE/images/7/7c/Heliconia_latispatha_Río_de_Janeiro.jpg
-es_PE/images/7/7c/BacillusCereus.jpg
-es_PE/images/7/7c/Wikibooks-logo-en.svg
-es_PE/images/7/7c/Wikibooks-logo-en.svg.jpg
-es_PE/images/7/7c/EtaCarinae.jpg
-es_PE/images/7/7c/PregnantWoman.jpg
-es_PE/images/7/7c/Queen_logo.svg
-es_PE/images/7/7c/Queen_logo.svg.jpg
-es_PE/images/7/7c/Penicillin-G.png
-es_PE/images/7/7c/Bosnia_and_Herzegovina_Coats_of_Arms_modified.svg
-es_PE/images/7/7c/Bosnia_and_Herzegovina_Coats_of_Arms_modified.svg.jpg
-es_PE/images/7/7e/AntarcticaLocation.svg
-es_PE/images/7/7e/AntarcticaLocation.svg.jpg
-es_PE/images/7/7e/Descomposicion_de_fuerzas_en_plano_inclinado.png
-es_PE/images/7/7e/Glasmurmel_mit_Schatten_auf_kariertem_Grund_2007_02_14.JPG
-es_PE/images/7/7e/Antarctica.jpg
-es_PE/images/7/7e/Estación_Piedra_Sola_Uruguay.JPG
-es_PE/images/7/7e/Topographic30deg_S0E90.png
-es_PE/images/7/7e/ArbolMorfeo.png
-es_PE/images/7/7e/243_ida.jpg
-es_PE/images/7/7e/National_Emblem_of_the_People's_Republic_of_China.png
-es_PE/images/7/7e/Pipistrellobombing.jpg
-es_PE/images/7/7e/Autorretrato_de_Velazquez.jpg
-es_PE/images/7/7e/Limiteconvergente-continenteycontinente.png
-es_PE/images/7/75/Austral-Ice.jpg
-es_PE/images/7/75/Bandera_del_porfiriato.PNG
-es_PE/images/7/75/Egypt_dauingevekten.jpg
-es_PE/images/7/75/Centro_Piedra_del_Sol.gif
-es_PE/images/7/75/Sparta_ruins.PNG
-es_PE/images/7/75/Planisphæri_cœleste.jpg
-es_PE/images/7/75/Harpy_Eagle2.JPG
-es_PE/images/7/75/Gray654.png
-es_PE/images/7/79/Thompson's_Gazelle.jpeg
-es_PE/images/7/79/Glass_tesseract_still.png
-es_PE/images/7/79/Gram_Stain_Anthrax.jpg
-es_PE/images/7/79/Moneda_mexicana.jpg
-es_PE/images/7/79/LaGloire.jpg
-es_PE/images/7/79/Paris_06_Eiffelturm_4828.jpg
-es_PE/images/7/79/Mapa_tuberculose.png
-es_PE/images/7/79/Gandhi_and_Kasturbhai_1902.jpg
-es_PE/images/7/79/Al-TableImage.png
-es_PE/images/7/79/Ashley_Tisdale_2007.jpg
-es_PE/images/7/79/Escudo_Monterrey.png
-es_PE/images/7/79/LopedeVega.jpg
-es_PE/images/7/79/WTOmap_currentmemberYN.png
-es_PE/images/7/74/Flag_of_Saint-Pierre_and_Miquelon.svg
-es_PE/images/7/74/Flag_of_Saint-Pierre_and_Miquelon.svg.jpg
-es_PE/images/7/74/Flag_of_the_Solomon_Islands.svg
-es_PE/images/7/74/Flag_of_the_Solomon_Islands.svg.jpg
-es_PE/images/7/74/Flag_of_the_Cocos_(Keeling)_Islands.svg
-es_PE/images/7/74/Flag_of_the_Cocos_(Keeling)_Islands.svg.jpg
-es_PE/images/7/74/Line0534.jpg
-es_PE/images/7/74/New_7_Wonders_Winners.png
-es_PE/images/7/74/Grafik_blutkreislauf.jpg
-es_PE/images/7/74/Flag_of_Mexico_(1823-1864,_1867-1968).png
-es_PE/images/7/74/EscudoSevilla3.jpg
-es_PE/images/7/74/Rio_Sar_Pontepedrina_Santiago_Galicia_070310_2.JPG
-es_PE/images/7/74/Saturn_symbol.svg
-es_PE/images/7/74/Saturn_symbol.svg.jpg
-es_PE/images/7/74/Rgb-colorwheel.svg
-es_PE/images/7/74/S-TableImage.png
-es_PE/images/7/74/Escudo_de_Granada.svg
-es_PE/images/7/74/Escudo_de_Granada.svg.jpg
-es_PE/images/7/73/Estructura_celula_vegetal.png
-es_PE/images/7/73/Peroxisoma.png
-es_PE/images/7/73/Mariachii.jpg
-es_PE/images/7/73/Frans_Hals_-_Portret_van_René_Descartes.jpg
-es_PE/images/7/73/Moon_PIA00302.jpg
-es_PE/images/7/73/Topographic30deg_N0W120.png
-es_PE/images/7/73/Flag_of_Romania.svg
-es_PE/images/7/73/Estatua_del_Cid.png
-es_PE/images/7/73/God2-Sistine_Chapel.png
-es_PE/images/7/73/Flag_of_Malta.svg
-es_PE/images/7/73/Flag_of_Malta.svg.jpg
-es_PE/images/7/73/RG-59.jpg
-es_PE/images/7/73/Provincia_de_Granada_-_Bandera.svg
-es_PE/images/7/73/Provincia_de_Granada_-_Bandera.svg.jpg
-es_PE/images/7/72/Flag_of_the_Republic_of_China.svg
-es_PE/images/7/72/Andrea_Faria,_Conrado_e_filha.jpg
-es_PE/images/7/72/Brain_chrischan_300.gif
-es_PE/images/7/72/Montevideo_Panorama.jpg
-es_PE/images/7/72/Disambig.svg
-es_PE/images/7/72/LocationVenezuela.svg
-es_PE/images/7/72/LocationVenezuela.svg.jpg
-es_PE/images/7/72/Mexico_COA_large.svg
-es_PE/images/7/72/Mexico_COA_large.svg.jpg
-es_PE/images/7/72/Average_prokaryote_cell-_es.svg
-es_PE/images/7/72/Average_prokaryote_cell-_es.svg.jpg
-es_PE/images/7/72/Steam_engine_nomenclature.png
-es_PE/images/7/72/Rubén_Darío.jpg
-es_PE/images/7/72/Detalle_tarjeta_red.jpg
-es_PE/images/7/72/Cold_war_europe_economic_alliances_map_en.png
-es_PE/images/7/72/Alcoholic_hepatitis.jpg
-es_PE/images/7/72/Emo_Boy_02_posing_01.jpg
-es_PE/images/7/72/Sticker_Counter-Strike.jpg
-es_PE/images/7/7b/Lueger.jpg
-es_PE/images/7/7b/Cáncer1.png
-es_PE/images/7/7b/Coa_GDL.png
-es_PE/images/7/7b/Penicillin_3D_Model.png
-es_PE/images/7/7b/Erosion.jpg
-es_PE/images/7/7b/Engels_1856.jpg
-es_PE/images/7/7d/Mexico.DF.Coyoacan.MiguelHidalgo.Statue.01.jpg
-es_PE/images/7/7d/Air_Force_One_over_Mt._Rushmore.jpg
-es_PE/images/7/7d/Bluesky2.jpg
-es_PE/images/7/7d/Dgv-surfbal.gif
-es_PE/images/7/7d/Marx_color.jpg
-es_PE/images/7/7d/Standing_wave_2.gif
-es_PE/images/7/7d/Pila-osi-es.svg
-es_PE/images/7/7d/Cu-TableImage.png
-es_PE/images/7/7d/Mergedisputed.svg
-es_PE/images/7/7d/RightRiemann2.PNG
-es_PE/images/7/7f/Mexican_Libertad_reverse.JPG
-es_PE/images/7/7f/La_Independencia_del_Perú.jpg
-es_PE/images/7/7f/Betelgeuse_star_(Hubble).jpg
-es_PE/images/7/7f/Kit_left_arm.svg
-es_PE/images/7/7f/Kit_left_arm.svg.jpg
-es_PE/images/7/7f/Debian4.png
-es_PE/images/7/7f/Mapa_habitat_casitodo.PNG
-es_PE/images/7/7f/John_F._Kennedy_signature.gif
-es_PE/images/7/7f/Cortes-Hernan-LOC.jpg
-es_PE/images/7/7f/Perez_galdos.jpg
-es_PE/images/7/7a/Cantarell_2.jpg
-es_PE/images/7/7a/Philosophie-Epochen.png
-es_PE/images/7/7a/Esclapius_stick.svg
-es_PE/images/7/7a/Esclapius_stick.svg.jpg
-es_PE/images/7/7a/Rioplatense_Spanish_area_main_cities.jpg
-es_PE/images/7/7a/Topographic30deg_S0E150.png
-es_PE/images/7/7a/Flag_of_the_Habsburg_Monarchy.svg
-es_PE/images/7/7a/Flag_of_the_Habsburg_Monarchy.svg.jpg
-es_PE/images/7/7a/Rev_collage.png
-es_PE/images/7/7a/Panicum_virgatum.jpg
-es_PE/images/7/7a/Isotopes_and_half-life.PNG
-es_PE/images/7/7a/LocationAlaska.png
-es_PE/images/7/7a/Smilodon_californicus.jpg
-es_PE/images/7/7a/Anarchy-symbol.svg
-es_PE/images/7/78/WW2_Japonese_Surrender_USS-Missouri.jpg
-es_PE/images/7/78/Fusión_solar.png
-es_PE/images/7/78/Flag_of_Chile.svg
-es_PE/images/7/78/LocationBrazil.svg
-es_PE/images/7/78/LocationBrazil.svg.jpg
-es_PE/images/7/78/Multiple_icon_selection.png
-es_PE/images/7/78/Jan_van_Eyck_059.jpg
-es_PE/images/7/78/Undertaker.jpg
-es_PE/images/7/78/Vuilnis.JPG
-es_PE/images/7/78/Percentage_population_undernourished_world_map.PNG
-es_PE/images/7/78/Retrato_de_Francisco_de_Quevedo.jpg
-es_PE/images/7/78/Codex_claromontanus_latin.jpg
-es_PE/images/7/78/Developed_nation.png
-es_PE/images/7/78/Alco_RSD-16_NCA_Baradero.JPG
-es_PE/images/7/76/Almendro.jpg
-es_PE/images/7/76/Roundel_of_Uruguay.svg
-es_PE/images/7/76/DiagramaFlujoLampara.svg
-es_PE/images/7/76/Michael_Jackson_1984(2).jpg
-es_PE/images/7/76/Kohlenstoffnanoroehre_Animation.gif
-es_PE/images/7/76/Capacitorsseries.png
-es_PE/images/7/77/Sistemaselectronics.JPG
-es_PE/images/7/77/Continental_models.gif
-es_PE/images/7/77/Flag_of_Algeria.svg
-es_PE/images/7/77/Escut_de_Catalunya(apuntat).svg
-es_PE/images/7/77/Escut_de_Catalunya(apuntat).svg.jpg
-es_PE/images/7/77/Flag_of_the_Iroquois_Confederacy.svg
-es_PE/images/7/77/Flag_of_the_Iroquois_Confederacy.svg.jpg
-es_PE/images/7/77/Pluto_and_charon.jpg
-es_PE/images/7/70/BanderaSevilla1.svg
-es_PE/images/7/70/BanderaSevilla1.svg.jpg
-es_PE/images/7/70/Sun_Type_5c_keyboard_layout_(US).svg
-es_PE/images/7/70/Sun_Type_5c_keyboard_layout_(US).svg.jpg
-es_PE/images/7/70/Wikipedia-es.png
-es_PE/images/7/70/USB2.0_PCI_Card_Asus-2.jpg
-es_PE/images/7/70/Addis_Ababa-8e00855u-original.jpg
-es_PE/images/7/70/Bogota_Cundinamarca.png
-es_PE/images/7/70/Demokrit.jpeg
-es_PE/images/7/70/Icecube.jpg
-es_PE/images/9/97/The_Earth_seen_from_Apollo_17.jpg
-es_PE/images/9/97/Christopher_Columbus3.jpg
-es_PE/images/9/97/Christ_Carrying_the_Cross_1580.jpg
-es_PE/images/9/97/WifiAccessPoint.jpg
-es_PE/images/9/97/FemOS.png
-es_PE/images/9/97/LocationParaguay.svg
-es_PE/images/9/97/LocationParaguay.svg.jpg
-es_PE/images/9/97/A_New_System_of_Chemical_Philosophy_fp.jpg
-es_PE/images/9/97/LocationSaudiArabia.svg
-es_PE/images/9/97/LocationSaudiArabia.svg.jpg
-es_PE/images/9/97/Gavel.png
-es_PE/images/9/97/Mg,12.jpg
-es_PE/images/9/96/Antoine_lavoisier.jpg
-es_PE/images/9/96/Diamond_animation.gif
-es_PE/images/9/96/Efectos_alta_tensión.jpg
-es_PE/images/9/96/Bogota_(escudo).svg
-es_PE/images/9/96/Escudo_de_Asturias.svg
-es_PE/images/9/96/Escudo_de_Asturias.svg.jpg
-es_PE/images/9/96/Jacques-Louis_David_004.jpg
-es_PE/images/9/96/Approaching_Omaha.jpg
-es_PE/images/9/96/SNES_800.jpg
-es_PE/images/9/96/FIFA_World_Cup_01.jpg
-es_PE/images/9/96/Mangueira-1998.jpg
-es_PE/images/9/93/Human.svg
-es_PE/images/9/93/Human.svg.jpg
-es_PE/images/9/93/CMYK_farbwuerfel.jpg
-es_PE/images/9/93/Rauchen_Verboten.svg
-es_PE/images/9/93/OOo-2.0-Base-ca.png
-es_PE/images/9/93/Clinical_thermometer_38.7.JPG
-es_PE/images/9/93/Jakarta_slumlife65.JPG
-es_PE/images/9/93/InternalIntegratedCircuit2.JPG
-es_PE/images/9/93/Centroamerica-ubicacion.png
-es_PE/images/9/93/Intersecting_Planes.PNG
-es_PE/images/9/93/Esquema_de_un_tsunami.png
-es_PE/images/9/93/Sarcophage_Promethee.jpg
-es_PE/images/9/93/Gustave_Moreau_005.jpg
-es_PE/images/9/93/Kafka1906.jpg
-es_PE/images/9/9a/Helium_atom_with_charge-smaller.jpg
-es_PE/images/9/9a/Durer-self-portrait-at-the-age-of-thirteen.jpg
-es_PE/images/9/9a/Peso_Mexicano_1921.jpg
-es_PE/images/9/9a/PVEM_party.png
-es_PE/images/9/9a/Mare_Imbrium-Apollo17.jpg
-es_PE/images/9/9a/Flag_of_Bulgaria.svg
-es_PE/images/9/9a/Flag_of_Tonga.svg
-es_PE/images/9/9a/Flag_of_Spain.svg
-es_PE/images/9/9a/Flag_of_Spain.svg.jpg
-es_PE/images/9/9a/Flag_of_Afghanistan.svg
-es_PE/images/9/9a/Flag_of_Afghanistan.svg.jpg
-es_PE/images/9/9a/Flag_of_Mercosur.svg
-es_PE/images/9/9a/Flag_of_Mercosur.svg.jpg
-es_PE/images/9/9a/Mercosur.png
-es_PE/images/9/91/Wikiversity-logo.svg
-es_PE/images/9/91/Wikiversity-logo.svg.jpg
-es_PE/images/9/91/Flujo_de_datos.png
-es_PE/images/9/91/Subestación_electricidad.jpg
-es_PE/images/9/91/Tipo_se_fuselajes.JPG
-es_PE/images/9/91/Kit_body_unknown.png
-es_PE/images/9/91/Wikipedia_rss_with_mozilla_thunderbird.PNG
-es_PE/images/9/91/Crystal_Clear_app_aktion.png
-es_PE/images/9/91/Brujula.jpg
-es_PE/images/9/91/DaftAlive.jpeg
-es_PE/images/9/94/Guerra.png
-es_PE/images/9/94/Division_politica_mexico.svg
-es_PE/images/9/94/Division_politica_mexico.svg.jpg
-es_PE/images/9/94/Wire-grid-polarizer.svg
-es_PE/images/9/94/Namib_desert_dunes.jpg
-es_PE/images/9/94/H,1.jpg
-es_PE/images/9/94/Text.jpg
-es_PE/images/9/94/Sanzio_01.jpg
-es_PE/images/9/94/SMAW.welding.af.ncs.jpg
-es_PE/images/9/94/Pandora.jpg
-es_PE/images/9/94/Fall_Out_Boy_in_concert.jpg
-es_PE/images/9/94/Sanzio_00.jpg
-es_PE/images/9/99/Flag_of_Guyana.svg
-es_PE/images/9/99/Inukshuk_Monterrey_1.jpg
-es_PE/images/9/99/Queue.at.london.airport.arp.cropped.jpg
-es_PE/images/9/99/European_regions.png
-es_PE/images/9/99/Med_3.png
-es_PE/images/9/99/Flag_of_the_Philippines.svg
-es_PE/images/9/99/Flag_of_the_Philippines.svg.jpg
-es_PE/images/9/99/Slipknot.jpg
-es_PE/images/9/99/EM_of_pap_virus,_2C_basal_tissue_grafted_to_mouse.jpg
-es_PE/images/9/99/Venn0001.svg
-es_PE/images/9/99/Emiliano_Zapata4.jpg
-es_PE/images/9/99/Bombay-Stock-Exchange.jpg
-es_PE/images/9/90/Mexico_states_evolution.gif
-es_PE/images/9/90/Mexico.RodolfoNeriVela.01.jpg
-es_PE/images/9/90/Supermassiveblackhole_nasajpl.jpg
-es_PE/images/9/90/G-Protein.png
-es_PE/images/9/90/CO2-Temp.png
-es_PE/images/9/90/Porfirio_Diaz.jpg
-es_PE/images/9/90/Seal_of_the_Government_of_Mexico.svg
-es_PE/images/9/90/Seal_of_the_Government_of_Mexico.svg.jpg
-es_PE/images/9/90/Blink182.jpg
-es_PE/images/9/90/Alaskastateseal.jpg
-es_PE/images/9/9c/Hopi_woman_dressing_hair_of_unmarried_girl.jpg
-es_PE/images/9/9c/Physical_world.jpg
-es_PE/images/9/9c/Castros.jpg
-es_PE/images/9/9c/Aldrin_Apollo_11.jpg
-es_PE/images/9/9c/Flag_of_the_Community_of_Madrid.svg
-es_PE/images/9/9c/Flag_of_the_Community_of_Madrid.svg.jpg
-es_PE/images/9/9c/Flag_of_Denmark.svg
-es_PE/images/9/9c/Nazi_Swastika.svg
-es_PE/images/9/9c/ShellMartinez-refi.jpg
-es_PE/images/9/9c/Puhagan_geothermal_plant.jpg
-es_PE/images/9/9c/Cronica_pinatense.jpg
-es_PE/images/9/9c/Geometrie_quadrilataire.png
-es_PE/images/9/9d/Cholera_bacteria_SEM.jpg
-es_PE/images/9/9d/Viruscomplejo.png
-es_PE/images/9/9d/Paul_Cézanne_-_La_Maison_du_pendu.jpg
-es_PE/images/9/9d/France_Strasbourg_Magi.jpg
-es_PE/images/9/9d/Yvoire_cadran_solaire.jpg
-es_PE/images/9/9d/LocationBosniaAndHerzegovina.svg
-es_PE/images/9/9d/LocationBosniaAndHerzegovina.svg.jpg
-es_PE/images/9/95/Murgas_(Vazquez,_Marzo_2005_-2).jpg
-es_PE/images/9/95/Ala_trapezoidal.JPG
-es_PE/images/9/95/La_grande_Epidemie_de_PORNOGRAPHIE.gif
-es_PE/images/9/95/Columbus_Taking_Possession.jpg
-es_PE/images/9/95/Slayerlive2.jpg
-es_PE/images/9/95/Lesser_Coat_of_Arms_of_Ukraine.svg
-es_PE/images/9/95/Lesser_Coat_of_Arms_of_Ukraine.svg.jpg
-es_PE/images/9/92/Black_triggerfish.jpg
-es_PE/images/9/92/Paris-LOC_cph_3b40741.jpg
-es_PE/images/9/92/Filzstifte1.jpg
-es_PE/images/9/92/Ares_Galaxy_v2.0.PNG
-es_PE/images/9/92/Rocknroll-dancing-somersault-worldgames2005.jpg
-es_PE/images/9/92/Rutherford_atom.svg
-es_PE/images/9/92/LA_County_Incorporated_Areas_Los_Angeles_highlighted.svg
-es_PE/images/9/92/LA_County_Incorporated_Areas_Los_Angeles_highlighted.svg.jpg
-es_PE/images/9/92/Hemispheres.png
-es_PE/images/9/92/741_op-amp_in_TO-5_metal_can_package_close-up.jpg
-es_PE/images/9/9b/Palacio_Legislativo.JPG
-es_PE/images/9/9b/Flag_of_Paris.svg
-es_PE/images/9/9b/Einstein_gyro_gravity_probe_b.jpg
-es_PE/images/9/9b/Exponencial_gráfico.png
-es_PE/images/9/9b/Leibnitz_signature.jpg
-es_PE/images/9/9b/Krasnoyarsk_hydroelectric_station.jpg
-es_PE/images/9/9b/EKGI.png
-es_PE/images/9/98/Tipo_Ala_delta.JPG
-es_PE/images/9/98/Escudo_de_la_Republica_Argentina.svg
-es_PE/images/9/98/Escudo_de_la_Republica_Argentina.svg.jpg
-es_PE/images/9/98/Chromosomes_in_mitosis_and_meiosis.png
-es_PE/images/9/98/USS_Los_Angeles;0868802.jpg
-es_PE/images/9/98/Sanzio_01_Plato_Aristotle.jpg
-es_PE/images/9/98/Cu,29.jpg
-es_PE/images/9/98/Threephasepolemountclose.jpg
-es_PE/images/9/98/LocationHaiti.svg
-es_PE/images/9/98/LocationHaiti.svg.jpg
-es_PE/images/9/9e/Sleep_EEG_Stage_1.jpg
-es_PE/images/9/9e/Flag_of_Japan.svg
-es_PE/images/9/9e/Possible_Self-Portrait_of_Leonardo_da_Vinci.jpg
-es_PE/images/9/9e/Peripheral_nerve,_cross_section.jpg
-es_PE/images/9/9e/Obesity-waist_circumference.PNG
-es_PE/images/9/9e/Dosen-barometer.jpg
-es_PE/images/9/9e/Bcamazonica.jpg
-es_PE/images/9/9e/LC_3.JPG
-es_PE/images/9/9f/Flag_of_the_Dominican_Republic.svg
-es_PE/images/9/9f/Flag_of_the_Dominican_Republic.svg.jpg
-es_PE/images/9/9f/Flag_of_Indonesia.svg
-es_PE/images/9/9f/Miniesbozo.png
-es_PE/images/9/9f/Sir_Isaac_Newton_1702.jpg
-es_PE/images/9/9f/José_Luis_Rodríguez_Zapatero_-_Royal_&_Zapatero's_meeting_in_Toulouse_for_the_2007_French_presidential_election_0205_2007-04-19.jpg
-es_PE/images/9/9f/Crystal_128_camera.png
-es_PE/images/9/9f/Leyre_portico.jpg
-es_PE/images/9/9f/Joey_Ramone_and_Johnny_Ramone.jpg
-es_PE/images/a/a9/Atom.svg
-es_PE/images/a/a9/Atom.svg.jpg
-es_PE/images/a/a9/Wikipedia_growth.png
-es_PE/images/a/a9/World_geologic_provinces.jpg
-es_PE/images/a/a9/Atacama1.jpg
-es_PE/images/a/a9/Polarlicht.jpg
-es_PE/images/a/a9/Flag_of_the_Soviet_Union.svg
-es_PE/images/a/a9/Flag_of_the_Soviet_Union.svg.jpg
-es_PE/images/a/a9/Flag_of_Thailand.svg
-es_PE/images/a/a9/Flag_of_England_(bordered).svg
-es_PE/images/a/a9/Monumento_a_Gerardo_Diego.jpg
-es_PE/images/a/a9/New_Harmony_by_F._Bate_(View_of_a_Community,_as_proposed_by_Robert_Owen)_printed_1838.jpg
-es_PE/images/a/a9/Ionic_bonding.png
-es_PE/images/a/a9/Emblem_of_the_Papacy.svg
-es_PE/images/a/a9/Emblem_of_the_Papacy.svg.jpg
-es_PE/images/a/a0/LocationOceania.png
-es_PE/images/a/a0/Atomicclock.jpg
-es_PE/images/a/a0/Templeofthegoldenpavilion.jpg
-es_PE/images/a/a0/Parque_Rodó2.jpg
-es_PE/images/a/a0/DeepSiltOffMirabeau.jpg
-es_PE/images/a/a0/Télescope_Sky_Watcher.JPG
-es_PE/images/a/a0/TOYOTA_ist_Pikachu_Car.jpg
-es_PE/images/a/a0/Ohms_law_voltage_source.svg
-es_PE/images/a/a0/Ohms_law_voltage_source.svg.jpg
-es_PE/images/a/a0/Sinapsis.png
-es_PE/images/a/a0/Programming_language_textbooks.jpg
-es_PE/images/a/a0/Atmospheric_Water_Vapor_Mean.2005.030.jpg
-es_PE/images/a/a0/Avatars.jpg
-es_PE/images/a/a0/Austria_Bundesadler.svg
-es_PE/images/a/a0/Austria_Bundesadler.svg.jpg
-es_PE/images/a/a0/Buenos_Aires_-_Bolsa_de_Comercio.jpg
-es_PE/images/a/a0/Dante_alighieri.jpg
-es_PE/images/a/a0/Government_Ensign_of_the_United_Kingdom.svg
-es_PE/images/a/a0/Government_Ensign_of_the_United_Kingdom.svg.jpg
-es_PE/images/a/a0/Locator_map_of_Santiago,_Chile.png
-es_PE/images/a/a1/MapS.png
-es_PE/images/a/a1/Wikiproyecto-Perú.png
-es_PE/images/a/a1/LocationSouthAfrica.svg
-es_PE/images/a/a1/LocationSouthAfrica.svg.jpg
-es_PE/images/a/a1/Violin_-_open_strings_notes.PNG
-es_PE/images/a/a1/Hk_map_18.png
-es_PE/images/a/a8/MapW.png
-es_PE/images/a/a8/Derivative1.png
-es_PE/images/a/a8/Tango-Show-Buenos-Aires-01.jpg
-es_PE/images/a/a8/Hannah-Point.jpg
-es_PE/images/a/a8/Location_Italy_EU_Europe.png
-es_PE/images/a/a8/Crystal_Clear_action_playlist.png
-es_PE/images/a/a8/LynnSpears_cropped.jpg
-es_PE/images/a/a8/BernoullisLawDerivationDiagram.png
-es_PE/images/a/a8/Map-Romance_Language_World.png
-es_PE/images/a/a8/View_of_a_Skull.jpg
-es_PE/images/a/a8/Vermeer_-_The_Milkmaid.jpg
-es_PE/images/a/af/Urbanizacion_mundo.png
-es_PE/images/a/af/Cancun_Beach.jpg
-es_PE/images/a/af/Different_minerals.jpg
-es_PE/images/a/af/Bust_Pericles_Chiaramonti.jpg
-es_PE/images/a/af/Animation_polariseur_2.gif
-es_PE/images/a/af/Geologists-tools_hg.jpg
-es_PE/images/a/af/Flag_of_South_Africa.svg
-es_PE/images/a/af/Kit_shorts.svg
-es_PE/images/a/af/Einstein1921_by_F_Schmutzer_2.jpg
-es_PE/images/a/af/Tour_eiffel_at_sunrise_from_the_trocadero.jpg
-es_PE/images/a/af/Provincia_di_Venezia-Stemma.png
-es_PE/images/a/af/Evanescence_Oct_24,_2006.jpg
-es_PE/images/a/af/Buchdruck-15-jahrhundert_1.jpg
-es_PE/images/a/af/LSD-2D,_3D.png
-es_PE/images/a/af/All_Gizah_Pyramids.jpg
-es_PE/images/a/a7/Olympic_flag.svg
-es_PE/images/a/a7/Chlorofl.jpg
-es_PE/images/a/a7/Max_Planck_(1858-1947).jpg
-es_PE/images/a/a7/Eugène_Delacroix_-_La_liberté_guidant_le_peuple.jpg
-es_PE/images/a/a7/Topographic30deg_S30E150.png
-es_PE/images/a/a7/Segundo_puesto.png
-es_PE/images/a/a7/Carl_Spitzweg_003.jpg
-es_PE/images/a/a7/Skeleton.jpg
-es_PE/images/a/a7/Psi-stylized.png
-es_PE/images/a/a7/Brad_Pitt_at_Incirlik2.jpg
-es_PE/images/a/ac/SubtractiveColorMixing.png
-es_PE/images/a/ac/Uruguay_T2.png
-es_PE/images/a/ac/Download_Feastival_2006_-1.jpg
-es_PE/images/a/ac/Square_compasses.svg
-es_PE/images/a/ac/Square_compasses.svg.jpg
-es_PE/images/a/ac/Cholesterol-3d.png
-es_PE/images/a/ac/PIA04866_modest.jpg
-es_PE/images/a/ab/Turgor_pressure_on_plant_cells_diagram.svg
-es_PE/images/a/ab/Turgor_pressure_on_plant_cells_diagram.svg.jpg
-es_PE/images/a/ab/Palaciojusticiaperu.jpg
-es_PE/images/a/ab/Flag_of_Panama.svg
-es_PE/images/a/ab/LocationEcuador.svg
-es_PE/images/a/ab/LocationEcuador.svg.jpg
-es_PE/images/a/ab/WorldMapLongLat-eq-circles-tropics-non.png
-es_PE/images/a/ab/Hierarchical_clustering_diagram.png
-es_PE/images/a/ab/Escudo_de_la_Ciudad_de_Panamá.png
-es_PE/images/a/ab/21_trisomy_-_Down_syndrome.png
-es_PE/images/a/ab/Lutherrose.svg
-es_PE/images/a/ab/Lutherrose.svg.jpg
-es_PE/images/a/ab/Marilyn_Manson_en_concierto_en_Festimad_2005,_otra_vez..jpg
-es_PE/images/a/ab/EU_location_CZE.png
-es_PE/images/a/ab/Andy_Warhol_1977.jpg
-es_PE/images/a/ab/Evangelização.jpg
-es_PE/images/a/aa/CodexMendoza01.jpg
-es_PE/images/a/aa/Ägyptischer_Maler_um_1400_v._Chr._001.jpg
-es_PE/images/a/aa/Sun920607.jpg
-es_PE/images/a/aa/Bloque_optico.JPG
-es_PE/images/a/aa/Flammulina_velutipes.JPG
-es_PE/images/a/aa/Mercosur_-_Montevideo_(2).jpg
-es_PE/images/a/aa/Global_Warming_Predictions.png
-es_PE/images/a/aa/Merge-arrow.svg
-es_PE/images/a/aa/Merge-arrow.svg.jpg
-es_PE/images/a/aa/D-glucose.png
-es_PE/images/a/aa/Esquema_sistema_de_informacion.png
-es_PE/images/a/aa/Vietnam_Saigon_Child_in_the_Street.jpg
-es_PE/images/a/aa/Rammstein_blue_lights.jpg
-es_PE/images/a/aa/Green_Day_in_concert.jpg
-es_PE/images/a/aa/Polarlicht_2.jpg
-es_PE/images/a/aa/Mexico_topo.jpg
-es_PE/images/a/a5/MSH80_eruption_mount_st_helens_05-18-80.jpg
-es_PE/images/a/a5/Flag_of_the_International_Brigades.svg
-es_PE/images/a/a5/Flag_of_the_International_Brigades.svg.jpg
-es_PE/images/a/a5/LightningVolt_Deep_Blue_Sea.jpg
-es_PE/images/a/a5/MarilynMonroe-YANK1945.jpg
-es_PE/images/a/a5/Escudo_Vera_Cruz_Plus_Ultra_Ch.png
-es_PE/images/a/a5/Johndalton.jpg
-es_PE/images/a/a5/Identidades_trigonométricas_fundamentales.gif
-es_PE/images/a/a5/Chuck_Norris_cropped.jpg
-es_PE/images/a/ae/Flag_of_the_United_Kingdom.svg
-es_PE/images/a/ae/MexicoSnowandSunshine.jpg
-es_PE/images/a/ae/FoodMeat.jpg
-es_PE/images/a/ae/Location_Germany_EU_Europe.png
-es_PE/images/a/ae/EdisonDictaphone.jpg
-es_PE/images/a/ae/Nicotiana_Tobacco_Plants_1909px.jpg
-es_PE/images/a/ae/Coat_of_arms_of_Finland.svg
-es_PE/images/a/ae/Coat_of_arms_of_Finland.svg.jpg
-es_PE/images/a/ae/Metal_movable_type.jpg
-es_PE/images/a/a4/Socrates_Louvre.jpg
-es_PE/images/a/a4/Velazquez-Meninas.jpg
-es_PE/images/a/a4/Bordetella_bronchiseptica.jpg
-es_PE/images/a/a4/Ngc1316_hst.jpg
-es_PE/images/a/a4/Couscous-1.jpg
-es_PE/images/a/a4/DownTown_Toronto1.jpg
-es_PE/images/a/a4/Flag_of_the_United_States.svg
-es_PE/images/a/a4/Text_document_with_red_question_mark.svg
-es_PE/images/a/a4/Text_document_with_red_question_mark.svg.jpg
-es_PE/images/a/a4/Moon_eclipse.gif
-es_PE/images/a/a4/DSCF0360.JPG
-es_PE/images/a/a4/ARCOIRIS.jpg
-es_PE/images/a/a4/EM_of_influenza_virus.jpg
-es_PE/images/a/a4/Aerosmith_B.jpg
-es_PE/images/a/a3/Electricity_consumption_per_country_map.PNG
-es_PE/images/a/a3/Coronagraph_example.gif
-es_PE/images/a/a3/Geological_Dike_Cross-Island_Trail_Alaska.jpg
-es_PE/images/a/a3/Spqrstone.jpg
-es_PE/images/a/a3/Recycling_symbol2.svg
-es_PE/images/a/a3/Recycling_symbol2.svg.jpg
-es_PE/images/a/a3/Polea-simple-fija.jpg
-es_PE/images/a/a3/Pancreas.jpg
-es_PE/images/a/a3/St_Vitus_Cathedral_from_south.jpg
-es_PE/images/a/a2/Morfología_bacteriana.jpg
-es_PE/images/a/a2/View_of_loch_lomond.JPG
-es_PE/images/a/a2/Farming_near_Klingerstown,_Pennsylvania.jpg
-es_PE/images/a/a2/Carboxylic.Acids.Melting.&.Boiling.Points.jpg
-es_PE/images/a/a2/Shakespeare.jpg
-es_PE/images/a/a6/CopanNSouthCatherwood.jpg
-es_PE/images/a/a6/Location_Spain_EU_Europe.png
-es_PE/images/a/a6/El_Salvador_COA.svg
-es_PE/images/a/a6/El_Salvador_COA.svg.jpg
-es_PE/images/a/a6/Flag_of_Ukrainian_SSR.svg
-es_PE/images/a/a6/Flag_of_Ukrainian_SSR.svg.jpg
-es_PE/images/a/a6/World_Bank_building_at_Washington.jpg
-es_PE/images/a/a6/Escaños_congreso_de_España_1977-2008.png
-es_PE/images/a/a6/Abraham_Lincoln_signature.JPG
-es_PE/images/a/a6/US_long_grain_rice.jpg
-es_PE/images/a/a6/Mujer_maltratada_con_un_bastón_(Goya).jpg
-es_PE/images/a/a6/Chloroplasten.jpg
-es_PE/images/a/a6/Digital_Multimeter_Aka.jpg
-es_PE/images/a/a6/Cádiz_a_lo_lejos.JPG
-es_PE/images/a/a6/Mediatriz1.svg
-es_PE/images/a/a6/Mediatriz1.svg.jpg
-es_PE/images/a/a6/Coat_of_arms_of_Iran.svg
-es_PE/images/a/a6/Coat_of_arms_of_Iran.svg.jpg
-es_PE/images/a/a6/390029_'City_of_Stoke-on-Trent'_at_Birmingham_New_Street.JPG
-es_PE/images/a/ad/Glissement-terrain-Langevin.JPG
-es_PE/images/a/ad/Flag_of_Italy_(1861-1946).svg
-es_PE/images/a/ad/Flag_of_Italy_(1861-1946).svg.jpg
-es_PE/images/a/ad/Cargas_electricas.png
-es_PE/images/a/ad/D-fructose.png
-es_PE/images/a/ad/Sociedad_Limitada.jpg
-es_PE/images/a/ad/Europe_location_ALB.png
-es_PE/images/a/ad/Tower_crane_colorize.png
-es_PE/images/a/ad/LocationIraq.svg
-es_PE/images/a/ad/LocationIraq.svg.jpg
-es_PE/images/a/ad/Arnold_Schwarzenegger.JPG
-es_PE/images/1/10/Thetriumphofdeath.jpg
-es_PE/images/1/10/Skawa_River,_Poland,_flood_2001.jpg
-es_PE/images/1/10/Flag_of_Scotland.svg
-es_PE/images/1/10/Achilles_by_Lycomedes_Louvre_Ma2120.jpg
-es_PE/images/1/10/Copabra.jpg
-es_PE/images/1/11/Tables_generales_aritmetique_MG_2108.jpg
-es_PE/images/1/11/Albert_Einstein_photo_1921.jpg
-es_PE/images/1/11/Trees_and_sunshine.JPG
-es_PE/images/1/11/Åšw._Walenty.jpg
-es_PE/images/1/11/Flag_of_Lithuania.svg
-es_PE/images/1/11/Napoleon_Bonaparte.jpg
-es_PE/images/1/11/Escudo_de_Barcelona.svg
-es_PE/images/1/11/Escudo_de_Barcelona.svg.jpg
-es_PE/images/1/11/Bandera-diputacion-sevilla.jpg
-es_PE/images/1/11/1282378378_ffb5eba3bd_o.jpg
-es_PE/images/1/11/Villanuevania.jpg
-es_PE/images/1/11/Pope_Benedictus_XVI_january,20_2006_(2)_mod.jpg
-es_PE/images/1/17/MapL.png
-es_PE/images/1/17/Cork_Micrographia_Hooke.png
-es_PE/images/1/17/Vitruvian.jpg
-es_PE/images/1/17/Grav.lens1.arp.750pix.jpg
-es_PE/images/1/17/Santelia01.jpg
-es_PE/images/1/17/RXT.jpg
-es_PE/images/1/17/Autograph-ImmanuelKant.png
-es_PE/images/1/17/Covalent.svg
-es_PE/images/1/17/Covalent.svg.jpg
-es_PE/images/1/17/Union_flag_1606_(Kings_Colors).svg
-es_PE/images/1/17/Navstar.jpg
-es_PE/images/1/1a/BlankMap-Europe.png
-es_PE/images/1/1a/Biological_cell.svg
-es_PE/images/1/1a/Biological_cell.svg.jpg
-es_PE/images/1/1a/Flag_of_Argentina.svg
-es_PE/images/1/1a/Flag_of_Argentina.svg.jpg
-es_PE/images/1/1a/Eshu-statue.jpg
-es_PE/images/1/1a/Estacion_Central_Montevideo.jpg
-es_PE/images/1/1a/US_flag_48_stars.svg
-es_PE/images/1/1a/US_flag_48_stars.svg.jpg
-es_PE/images/1/1a/LocationCuba.svg
-es_PE/images/1/1a/LocationCuba.svg.jpg
-es_PE/images/1/1a/Kapitolinischer_Pythagoras_adjusted.jpg
-es_PE/images/1/1a/LocationPuertoRico.svg
-es_PE/images/1/1a/LocationPuertoRico.svg.jpg
-es_PE/images/1/1a/Michelangelo_portrait.JPG
-es_PE/images/1/1a/Flag_of_New_York.svg
-es_PE/images/1/1a/Flag_of_New_York.svg.jpg
-es_PE/images/1/1a/Crystal_Clear_app_mouse.png
-es_PE/images/1/1a/Traqueticopabloescobar.png
-es_PE/images/1/15/Roosters_2005-06.jpg
-es_PE/images/1/15/Apollo_15_Tsiolkovsky_crater.jpg
-es_PE/images/1/15/Henri_de_Toulouse-Lautrec_-_Madame_Palmyre_with_Her_Dog,_1897.jpg
-es_PE/images/1/15/Comet_P1_McNaught04_-_23-01-07.jpg
-es_PE/images/1/15/Topographic30deg_N0E90.png
-es_PE/images/1/15/PurkinjeCell.jpg
-es_PE/images/1/15/Petersdom_von_Engelsburg_gesehen.jpg
-es_PE/images/1/15/Human_skeleton_diagram.png
-es_PE/images/1/15/Giulio-cesare-enhanced_1-800x1450.jpg
-es_PE/images/1/15/Regionen_japans.png
-es_PE/images/1/15/BolsaMadrid.jpg
-es_PE/images/1/1c/Japanese_Wikipedia.png
-es_PE/images/1/1c/Tamales_mexicanos_navidad2004.jpg
-es_PE/images/1/1c/KingMerrimanNLA.jpg
-es_PE/images/1/1c/Blizzard.jpg
-es_PE/images/1/1c/Flag_of_Serbia_(1882-1918).svg
-es_PE/images/1/1c/Flag_of_Serbia_(1882-1918).svg.jpg
-es_PE/images/1/1c/Flag_of_Palaeologus_Emperor.svg
-es_PE/images/1/1c/Flag_of_Palaeologus_Emperor.svg.jpg
-es_PE/images/1/1c/Revolving_light_microscope.jpg
-es_PE/images/1/1c/TPI1_structure.png
-es_PE/images/1/1c/Maná.jpg
-es_PE/images/1/1c/Sistema-reproductor-femenino.png
-es_PE/images/1/1c/Bandera_de_Medellin-Colombia.PNG
-es_PE/images/1/14/AdditiveColorMixing.png
-es_PE/images/1/14/Image-Frankfurt,_European_Central_Bank_with_Euro-2.jpg
-es_PE/images/1/14/Greco_Bautismo_de_Cristo_1597.jpg
-es_PE/images/1/14/Redshift.png
-es_PE/images/1/14/Tipo_Ala_delta_con_canard.JPG
-es_PE/images/1/14/Flag_of_Spain_1945_1977.svg
-es_PE/images/1/14/Flag_of_Spain_1945_1977.svg.jpg
-es_PE/images/1/14/Flag_of_PalaeologusEmperor.svg
-es_PE/images/1/14/Flag_of_PalaeologusEmperor.svg.jpg
-es_PE/images/1/14/Kit_body_3lightbluestripes.png
-es_PE/images/1/14/Gears_animation.gif
-es_PE/images/1/14/Graduated_cylinder.jpg
-es_PE/images/1/1d/PRI_party.png
-es_PE/images/1/1d/Lokale_Gruppe_3D_Nachbarschaft.png
-es_PE/images/1/1d/Latin_America_terrain.jpg
-es_PE/images/1/1d/Pietro_Longhi_021.jpg
-es_PE/images/1/1d/512k_en_bits.JPG
-es_PE/images/1/1d/Cadiz,_Spain_location.png
-es_PE/images/1/1b/Sport_football.png
-es_PE/images/1/1b/Williams-Point.jpg
-es_PE/images/1/1b/Flag_of_Croatia.svg
-es_PE/images/1/1b/Flag_of_Croatia.svg.jpg
-es_PE/images/1/1b/Provincia_di_Roma-Stemma.png
-es_PE/images/1/1b/Busch_Stadium2.jpg
-es_PE/images/1/1b/Jimi_Hendrix_Statue(2).jpg
-es_PE/images/1/1b/Au-TableImage.png
-es_PE/images/1/1b/Natural_gas_production_world.PNG
-es_PE/images/1/1b/Maya.svg
-es_PE/images/1/1b/Maya.svg.jpg
-es_PE/images/1/1b/LocationIran.svg
-es_PE/images/1/1b/LocationIran.svg.jpg
-es_PE/images/1/1b/Myanmar_long_form.png
-es_PE/images/1/13/Personal_computer,_exploded_4.svg
-es_PE/images/1/13/Personal_computer,_exploded_4.svg.jpg
-es_PE/images/1/13/Phylogenetic_tree_of_life_2.svg
-es_PE/images/1/13/Phylogenetic_tree_of_life_2.svg.jpg
-es_PE/images/1/13/M57_The_Ring_Nebula.JPG
-es_PE/images/1/13/Redbloodcells.jpg
-es_PE/images/1/13/Guadalupano.jpg
-es_PE/images/1/13/Nucleus_ER.png
-es_PE/images/1/13/Flag_of_the_Soviet_Union_1923.svg
-es_PE/images/1/13/Flag_of_the_Soviet_Union_1923.svg.jpg
-es_PE/images/1/13/Human_skin_structure.jpg
-es_PE/images/1/13/Sudoku-by-L2G-20050714.gif
-es_PE/images/1/13/Coat_of_arms_of_Hungary.png
-es_PE/images/1/1e/William-Adolphe_Bouguereau_(1825-1905)_-_Maternal_Admiration_(1869).jpg
-es_PE/images/1/1e/James_Clerk_Maxwell_big.jpg
-es_PE/images/1/1e/Flag_of_Canada-1868-Red.svg
-es_PE/images/1/1e/Flag_of_Canada-1868-Red.svg.jpg
-es_PE/images/1/1e/Wolfgang-amadeus-mozart_1.jpg
-es_PE/images/1/1e/LocationTawantinsuyu.PNG
-es_PE/images/1/1e/Cadiz-logo.jpg
-es_PE/images/1/12/Edward_Burnett_Tylor.jpg
-es_PE/images/1/12/Barras_YUV.JPG
-es_PE/images/1/12/Mapa_Geografico_de_America_Meridional_(1790).jpg
-es_PE/images/1/12/Flag_of_Poland.svg
-es_PE/images/1/12/2004_Indonesia_Tsunami_100px.gif
-es_PE/images/1/12/Flag_of_the_Holy_Roman_Empire.png
-es_PE/images/1/12/Juan_Gris_003.jpg
-es_PE/images/1/12/Venezuela1811.gif
-es_PE/images/1/12/PhenotypeNIH_es.png
-es_PE/images/1/12/Plano_de_malaga.PNG
-es_PE/images/1/16/Melting_icecubes.gif
-es_PE/images/1/16/TreponemaPallidum.jpg
-es_PE/images/1/16/Nevin-Nihan-Hasan_Sami_Bolak_..._Avanos-_22_Eylül_2006.jpg
-es_PE/images/1/16/Simon_Bolivar.jpg
-es_PE/images/1/16/Hailstorm.jpg
-es_PE/images/1/16/Rhcp-live-pinkpop05.jpg
-es_PE/images/1/16/Spain_region_Sevilla_highlighted.jpg
-es_PE/images/1/16/Max_Weber_1894.jpg
-es_PE/images/1/16/Cancerous_lung.jpg
-es_PE/images/1/16/Ozzy_Osboune.jpg
-es_PE/images/1/16/LocationUkraine.svg
-es_PE/images/1/16/LocationUkraine.svg.jpg
-es_PE/images/1/19/Ciclo_celular_de_Escherichia_coli.jpg
-es_PE/images/1/19/Flag_of_Nicaragua.svg
-es_PE/images/1/19/Flag_of_Nicaragua.svg.jpg
-es_PE/images/1/19/Flag_of_Andorra.svg
-es_PE/images/1/19/Flag_of_Andorra.svg.jpg
-es_PE/images/1/19/Unidades_de_poliestireno.jpg
-es_PE/images/1/19/London_Skyline.jpg
-es_PE/images/1/19/Nirvana_around_1992.jpg
-es_PE/images/1/19/Flag_of_Poland_corrected.svg
-es_PE/images/1/19/PacificWhiteSidedDolphine.jpg
-es_PE/images/1/19/Kit_body_manutda0709.png
-es_PE/images/1/19/Ãguila_calva.jpg
-es_PE/images/1/1f/Brandenburger_Tor_Blaue_Stunde.jpg
-es_PE/images/1/1f/Flag_of_Kosovo.svg
-es_PE/images/1/1f/Flag_of_Kosovo.svg.jpg
-es_PE/images/1/1f/Tarjeta_red_isa.jpg
-es_PE/images/1/1f/Kit_left_arm_left_nike_Baca.png
-es_PE/images/1/1f/Important2.svg
-es_PE/images/1/1f/Important2.svg.jpg
-es_PE/images/1/1f/Util.png
-es_PE/images/1/1f/Colombia_departments_english.png
-es_PE/images/1/18/HalfMoon.jpg
-es_PE/images/1/18/Torun_ss_Janow_sklepienia.jpg
-es_PE/images/1/18/Aedes_Aegypty.jpg
-es_PE/images/1/18/Lazarillo_de_Tormes.gif
-es_PE/images/1/18/COA_of_the_Second_Spanish_Republic.svg
-es_PE/images/1/18/COA_of_the_Second_Spanish_Republic.svg.jpg
-es_PE/images/1/18/Piano.jpg
-es_PE/images/1/18/Batwa.jpg
-es_PE/images/1/18/Recta_real.svg
-es_PE/images/1/18/Recta_real.svg.jpg
-es_PE/images/1/18/Unibicameral_Map.png
-es_PE/images/e/e9/Banco_Hispano_Americano_(Madrid)_03.jpg
-es_PE/images/e/e9/LocationEurope.png
-es_PE/images/e/e9/Schieramenti_WWI.png
-es_PE/images/e/e9/Representaciones_del_metano.JPG
-es_PE/images/e/e9/Form_of_Government.png
-es_PE/images/e/e9/Flag_of_South_Vietnam.svg
-es_PE/images/e/e9/Dampflok-p8.jpg
-es_PE/images/e/e7/Raffael_053.jpg
-es_PE/images/e/e7/Earth_symbol.svg
-es_PE/images/e/e7/Earth_symbol.svg.jpg
-es_PE/images/e/e7/Pediastrumboryanum.jpg
-es_PE/images/e/e7/Flag_of_Belize.svg
-es_PE/images/e/e7/Flag_of_Belize.svg.jpg
-es_PE/images/e/e7/Coat_of_arms_of_Ecuador.svg
-es_PE/images/e/e7/Coat_of_arms_of_Ecuador.svg.jpg
-es_PE/images/e/e7/Domenico-Fetti_Archimedes_1620.jpg
-es_PE/images/e/e7/Jalisco_coat.png
-es_PE/images/e/e7/MobiusStrip-01.png
-es_PE/images/e/e7/Charlie_Chaplin_I.jpg
-es_PE/images/e/e4/Prokaryote_cell_diagram_international.svg
-es_PE/images/e/e4/Prokaryote_cell_diagram_international.svg.jpg
-es_PE/images/e/e4/CellMembraneDrawing_(es).png
-es_PE/images/e/e4/Avionprat.jpg
-es_PE/images/e/e4/Liberty-statue-with-manhattan.jpg
-es_PE/images/e/e4/EscudoSanJose.gif
-es_PE/images/e/e4/LocationJamaica.svg
-es_PE/images/e/e4/LocationJamaica.svg.jpg
-es_PE/images/e/e4/Table_of_Hydraulics_and_Hydrostatics,_Cyclopaedia,_Volume_1.jpg
-es_PE/images/e/e4/HOOKE_Robert.jpg
-es_PE/images/e/e4/Sine_waves_different_frequencies.png
-es_PE/images/e/e4/Nelly_Furtado_-_Manchester_Arena_2007.png
-es_PE/images/e/e4/Roentgen-x-ray-von-kollikers-hand.jpg
-es_PE/images/e/e3/Miguel_Hidalgo_y_Costilla.jpg
-es_PE/images/e/e3/Krishna.jpg
-es_PE/images/e/e3/Montesquieu_2.png
-es_PE/images/e/e3/Kheops-Pyramid.jpg
-es_PE/images/e/e3/Flag_of_Papua_New_Guinea.svg
-es_PE/images/e/e3/Flag_of_Papua_New_Guinea.svg.jpg
-es_PE/images/e/e3/Ottoman_Flag.svg
-es_PE/images/e/e3/Ottoman_Flag.svg.jpg
-es_PE/images/e/e3/Pablo_picasso.jpg
-es_PE/images/e/e3/8_marzo_managua_1.jpg
-es_PE/images/e/e3/Costa_Rica_COA.svg
-es_PE/images/e/e3/Costa_Rica_COA.svg.jpg
-es_PE/images/e/e3/St-thomas-aquinas.jpg
-es_PE/images/e/e3/Question_book-3.svg
-es_PE/images/e/e3/Question_book-3.svg.jpg
-es_PE/images/e/e3/Saturn_from_Cassini_Orbiter_(2004-10-06).jpg
-es_PE/images/e/e3/San_Martín_de_Frómista.JPG
-es_PE/images/e/e3/Stephen_King,_Comicon.jpg
-es_PE/images/e/e3/LosAngeles06.jpg
-es_PE/images/e/ee/Braun_HF_1.jpg
-es_PE/images/e/ee/Filogenia-vida-plantas-verdes.gif
-es_PE/images/e/ee/Dust.devil.mars.arp.750pix.jpg
-es_PE/images/e/ee/Kit_socks.svg
-es_PE/images/e/ee/Isaac_Newton_signature.png
-es_PE/images/e/ee/Solar_eclips_1999_6.jpg
-es_PE/images/e/ee/Ammonium.svg
-es_PE/images/e/ee/Ammonium.svg.jpg
-es_PE/images/e/ee/Tundra_coastal_vegetation_Alaska.jpg
-es_PE/images/e/ee/Celestina2.gif
-es_PE/images/e/ee/Lange-MigrantMother.jpg
-es_PE/images/e/ee/Photo-CarBattery.jpg
-es_PE/images/e/e5/Madero_en_Cuernavaca.jpg
-es_PE/images/e/e5/Pristina_SubStation-02_2004.jpg
-es_PE/images/e/e5/Uruguay_fisico.png
-es_PE/images/e/e5/Centro_Montevideo8.jpg
-es_PE/images/e/e5/Topographic30deg_S0W150.png
-es_PE/images/e/e5/Sanfranciscoearthquake1906.jpg
-es_PE/images/e/e5/STS-114_Steve_Robinson_on_Canadarm2.jpg
-es_PE/images/e/e5/Jeff_Hardy_2.jpg
-es_PE/images/e/e5/A_mother_with_her_child_in_a_village_in_Malawi.jpg
-es_PE/images/e/e5/Blade_Runner_icon.svg
-es_PE/images/e/e5/LocationNewZealand.png
-es_PE/images/e/ec/Traducción.png
-es_PE/images/e/ec/Enchilada_Rice_Beans.jpg
-es_PE/images/e/ec/Europe_gdp_map.png
-es_PE/images/e/ec/Flag_of_Guatemala.svg
-es_PE/images/e/ec/Flag_of_Guatemala.svg.jpg
-es_PE/images/e/ec/LocationPRChina.png
-es_PE/images/e/ec/Flag_of_the_German_Empire.svg
-es_PE/images/e/ec/WikimediaMosaicCapture.png
-es_PE/images/e/ec/Atmospheric_ozone.svg
-es_PE/images/e/ec/Atmospheric_ozone.svg.jpg
-es_PE/images/e/ec/MMONROE1.jpg
-es_PE/images/e/ec/Flag_of_Berlin.svg
-es_PE/images/e/ec/Flag_of_Berlin.svg.jpg
-es_PE/images/e/ef/ISO_639_Icon_en.svg
-es_PE/images/e/ef/Flag_of_Hawaii.svg
-es_PE/images/e/ef/Flag_of_Hawaii.svg.jpg
-es_PE/images/e/ef/Location_United_States.svg
-es_PE/images/e/ef/Location_United_States.svg.jpg
-es_PE/images/e/ef/Flag_of_Barbados.svg
-es_PE/images/e/ef/Flag_of_Barbados.svg.jpg
-es_PE/images/e/ef/Flag_of_the_FARC-EP.svg
-es_PE/images/e/ef/Flag_of_the_FARC-EP.svg.jpg
-es_PE/images/e/ef/Escudo_de_Puebla.svg
-es_PE/images/e/ef/Escudo_de_Puebla.svg.jpg
-es_PE/images/e/ef/Raspberry_port.jpg
-es_PE/images/e/ef/Tasa_natalidad_mundo.png
-es_PE/images/e/ef/CompilationScheme-Spanish.png
-es_PE/images/e/ef/Comunidad_de_Madrid_cartel.jpg
-es_PE/images/e/ef/Area_51_28_August_1968_6.jpg
-es_PE/images/e/ef/LocationHongKong.png
-es_PE/images/e/e8/Flag_of_Ecuador.svg
-es_PE/images/e/e8/Flag_of_Ecuador.svg.jpg
-es_PE/images/e/e8/TIROS-1-Earth.png
-es_PE/images/e/e8/Ivansmall.jpg
-es_PE/images/e/e8/Newtons_cradle_animation_book.gif
-es_PE/images/e/e8/Classical_Guitar_two_views.jpg
-es_PE/images/e/e8/DubaiSkyscrapers2.jpg
-es_PE/images/e/e8/ProcesamientoDatos.png
-es_PE/images/e/e8/Adherence.png
-es_PE/images/e/e8/Escherichia_coli_Gram.jpg
-es_PE/images/e/e8/Foo_Fighters_2007.jpg
-es_PE/images/e/e8/Frederic_Chopin_photo.jpeg
-es_PE/images/e/e1/D_orbitals.svg
-es_PE/images/e/e1/D_orbitals.svg.jpg
-es_PE/images/e/e1/MyPyramid1.png
-es_PE/images/e/e1/Iglesia_Atlantida_Dieste_1.jpg
-es_PE/images/e/e1/LondonSmog.jpg
-es_PE/images/e/e1/Mapa_ciudades_Grecia_antigua.JPG
-es_PE/images/e/e1/Snow_crystals_2b.jpg
-es_PE/images/e/e1/Cannabis_sativa.jpg
-es_PE/images/e/e1/Jimi_Hendrix,_5th_Avenue,_Seattle.jpg
-es_PE/images/e/e1/Banner_of_the_Inca_Empire_(center).svg
-es_PE/images/e/e1/Blinddarm-01.jpg
-es_PE/images/e/e2/Crystal_Clear_app_package_favourite.png
-es_PE/images/e/e2/Full_moon.png
-es_PE/images/e/e2/Salmonlarvakils.jpg
-es_PE/images/e/e2/Flag_of_Japan_-_variant.svg
-es_PE/images/e/e2/Lie_In_15_--_John_rehearses_Give_Peace_A_Chance.jpg
-es_PE/images/e/e2/Deep_Purple_in_2004.jpg
-es_PE/images/e/e2/Jupiter.jpg
-es_PE/images/e/e2/Futsal_players.jpg
-es_PE/images/e/e2/Flag_of_Poland_(bordered).svg
-es_PE/images/e/ed/Moreau,_Europa_and_the_Bull.jpg
-es_PE/images/e/ed/Flag_of_Micronesia.svg
-es_PE/images/e/ed/AntonioMachado.JPG
-es_PE/images/e/ed/Gdansk_flag.svg
-es_PE/images/e/ed/Gdansk_flag.svg.jpg
-es_PE/images/e/ed/GreeceLaconia.png
-es_PE/images/e/ed/Coat_of_arms_of_the_Czech_Republic.svg
-es_PE/images/e/ed/Coat_of_arms_of_the_Czech_Republic.svg.jpg
-es_PE/images/e/ed/Parmenides.jpg
-es_PE/images/e/ea/Notas_musicales_teclado_piano.gif
-es_PE/images/e/ea/Ngc1427AIrregulargalaxy.jpg
-es_PE/images/e/ea/Torreantel.JPG
-es_PE/images/e/ea/5783metric-micrometer.jpg
-es_PE/images/e/ea/Adhémar_de_Monteil_à_Antioche.jpeg
-es_PE/images/e/ea/Commons_screenshot.png
-es_PE/images/e/ea/Rocas-rafax.JPG
-es_PE/images/e/ea/Flag_of_Monaco.svg
-es_PE/images/e/e6/Noh3.jpg
-es_PE/images/e/e6/European_Union_as_a_single_entity.png
-es_PE/images/e/e6/Flag_of_Greece_(1828-1978).svg
-es_PE/images/e/e6/Flag_of_Greece_(1828-1978).svg.jpg
-es_PE/images/e/e6/Flag_of_Slovakia.svg
-es_PE/images/e/e6/Flag_of_Slovakia.svg.jpg
-es_PE/images/e/e6/WWEheadquarters9July2007.jpg
-es_PE/images/e/e6/Angulos_complementarios.png
-es_PE/images/e/e6/SchoolRugbyMatch.JPG
-es_PE/images/e/e6/Discovery_of_neon_isotopes.JPG
-es_PE/images/e/e6/Flag_of_Alaska.svg
-es_PE/images/e/e6/Flag_of_Alaska.svg.jpg
-es_PE/images/e/e6/Wheel_Iran.jpg
-es_PE/images/e/eb/Perou-Lima_9906a.jpg
-es_PE/images/e/eb/Brockhaus_Lexikon.jpg
-es_PE/images/e/eb/Sunspot-2004.jpeg
-es_PE/images/e/eb/Iron_Maiden_-_bass_and_guitars_30nov2006.jpg
-es_PE/images/e/eb/Plasma.jpg
-es_PE/images/e/eb/Stephen_Hawking.StarChild.jpg
-es_PE/images/e/eb/Bandera_de_la_provincia_de_Cádiz.gif
-es_PE/images/e/eb/Fleurs_des_Champs.jpg
-es_PE/images/e/e0/El_Inca_Garcilaso_de_la_Vega.gif
-es_PE/images/e/e0/Sunset02.jpg
-es_PE/images/e/e0/Nagasakibomb.jpg
-es_PE/images/e/e0/Flag_of_the_Northern_Mariana_Islands.svg
-es_PE/images/e/e0/Flag_of_the_Northern_Mariana_Islands.svg.jpg
-es_PE/images/e/e0/Logarithms.png
-es_PE/images/e/e0/Submerged-and-Displacing.png
-es_PE/images/e/e0/Piramide_del_Sol_072006.JPG
-es_PE/images/e/e0/MONUMENTO_A_LOS_CAIDOS_EL_19_DE_SEPTIEMBRE_DE_1985.jpg
-es_PE/images/e/e0/Coffee_Bean_Structure.svg
-es_PE/images/e/e0/Coffee_Bean_Structure.svg.jpg
-es_PE/images/e/e0/Triiodothyronine.svg
-es_PE/images/e/e0/Triiodothyronine.svg.jpg
-es_PE/images/e/e0/Provincia_Córdoba.png
-es_PE/images/4/4f/PieChartFraction_threeFourths_oneFourth-colored_differently.svg
-es_PE/images/4/4f/Urueña_almendro2_lou.jpg
-es_PE/images/4/4f/Heath_Ledger.jpg
-es_PE/images/4/4f/Eclipse_anular.gif
-es_PE/images/4/4f/Jalisco_coat.PNG
-es_PE/images/4/4f/MileyCyrus_signature.png
-es_PE/images/4/4f/Peace_symbol.svg
-es_PE/images/4/4b/Lightning3.jpg
-es_PE/images/4/4b/Ursa_major_star_name.png
-es_PE/images/4/4b/Restaurant.jpg
-es_PE/images/4/4b/Antarctica_satellite_globe.jpg
-es_PE/images/4/4b/Aztecempirelocation.png
-es_PE/images/4/4b/Shakira_by_Jose_Miguel_Serrano_(cropped_version).png
-es_PE/images/4/4b/Localización_de_Canarias.png
-es_PE/images/4/4b/Flag_of_Chad.svg
-es_PE/images/4/4b/Toltecas.png
-es_PE/images/4/4b/Ubuntu_full_logo.png
-es_PE/images/4/4b/50_cent_retouched.png
-es_PE/images/4/4b/Timezones.png
-es_PE/images/4/48/LeafAnt.jpg
-es_PE/images/4/48/Basketball.jpeg
-es_PE/images/4/48/Flag_of_Bolivia.svg
-es_PE/images/4/48/Flag_of_Bolivia.svg.jpg
-es_PE/images/4/48/Forja.jpg
-es_PE/images/4/48/Thermus_aquaticus.JPG
-es_PE/images/4/48/Old_woman_with_young_baby_boy.JPG
-es_PE/images/4/48/Aptch.gif
-es_PE/images/4/48/Flag_of_Palau.svg
-es_PE/images/4/48/Flag_of_Norfolk_Island.svg
-es_PE/images/4/48/Flag_of_Norfolk_Island.svg.jpg
-es_PE/images/4/48/Flag_of_Singapore.svg
-es_PE/images/4/48/Buddha.jpg
-es_PE/images/4/48/Kit_right_arm_blueline.png
-es_PE/images/4/48/EU_location_DEN.png
-es_PE/images/4/48/Alexander_Blok_-_Noch,_ulica,_fonar,_apteka.jpg
-es_PE/images/4/48/Jolie.png
-es_PE/images/4/48/Jennifer_Lopez_2004.jpg
-es_PE/images/4/48/Charles_Dickens_3.jpg
-es_PE/images/4/40/TEATROPUBLICO.jpg
-es_PE/images/4/40/Edouard_Manet_022.jpg
-es_PE/images/4/40/Å koda_Fabia_WRC_Cyprus_Rally_2005_1.jpg
-es_PE/images/4/40/DNA_double_helix_vertikal.PNG
-es_PE/images/4/40/Moon_PIA00305.jpg
-es_PE/images/4/40/Tabare_Vasquez.jpeg
-es_PE/images/4/40/FIAV_normal.png
-es_PE/images/4/40/Pila_Cu_Ag.PNG
-es_PE/images/4/4c/Wikisource-logo.svg
-es_PE/images/4/4c/Wikisource-logo.svg.jpg
-es_PE/images/4/4c/Ebohr1.svg
-es_PE/images/4/4c/Ebohr1.svg.jpg
-es_PE/images/4/4c/Calvario_copacabana.jpg
-es_PE/images/4/4c/Flag_of_Sweden.svg
-es_PE/images/4/4c/Europe_antarctica_size.png
-es_PE/images/4/4c/Emblem-important.svg
-es_PE/images/4/4c/Emblem-important.svg.jpg
-es_PE/images/4/4c/Template-info.svg
-es_PE/images/4/4c/Template-info.svg.jpg
-es_PE/images/4/4c/Simple_polygon.png
-es_PE/images/4/4c/Roman_Empire_map.gif
-es_PE/images/4/4c/Mareelaflotteiledere.gif
-es_PE/images/4/4c/Iturbide.jpg
-es_PE/images/4/4a/Commons-logo.svg
-es_PE/images/4/4a/Commons-logo.svg.jpg
-es_PE/images/4/4a/Algoritmo_de_la_resta.JPG
-es_PE/images/4/4a/Kamasutra5.jpg
-es_PE/images/4/4a/LocationSwitzerland.svg
-es_PE/images/4/4a/LocationSwitzerland.svg.jpg
-es_PE/images/4/4a/Pi-unrolled_slow.gif
-es_PE/images/4/4a/FNL_Flag.svg
-es_PE/images/4/4a/Violin_peg_strings.jpg
-es_PE/images/4/46/Archaea_membrane.svg
-es_PE/images/4/46/Archaea_membrane.svg.jpg
-es_PE/images/4/46/Diversity_of_plants_image_version_3.png
-es_PE/images/4/46/Calligraphy.malmesbury.bible.arp.jpg
-es_PE/images/4/46/Mond_Phasen.jpg
-es_PE/images/4/46/Kwashiorkor_6903.jpg
-es_PE/images/4/46/EU_location_MLT.png
-es_PE/images/4/46/Federball_natur.jpg
-es_PE/images/4/46/Watchtower-brooklyn.jpg
-es_PE/images/4/4d/Mexico0047.jpg
-es_PE/images/4/4d/Tamaños_relativos.jpg
-es_PE/images/4/4d/Streptococcus_mutans_Gram.jpg
-es_PE/images/4/4d/NASA_Apollo_17_Lunar_Roving_Vehicle.jpg
-es_PE/images/4/4d/Earth-lighting-winter-solstice_EN.png
-es_PE/images/4/4d/Sinclair_ZX_Spectrum.jpg
-es_PE/images/4/4d/EnglandLondon.png
-es_PE/images/4/4d/Heme.svg
-es_PE/images/4/4d/Heme.svg.jpg
-es_PE/images/4/4d/Angel_Dark.jpg
-es_PE/images/4/4d/Oaxaca_escudo.svg
-es_PE/images/4/4d/Oaxaca_escudo.svg.jpg
-es_PE/images/4/4d/Karte_berliner_mauer_es.jpg
-es_PE/images/4/4d/EU_location_HUN.png
-es_PE/images/4/4d/World_population_density_map.PNG
-es_PE/images/4/4d/HortaELWI.jpg
-es_PE/images/4/41/Snowboarding_pictogram.svg
-es_PE/images/4/41/Snowboarding_pictogram.svg.jpg
-es_PE/images/4/41/Bearded_man_Uruk_Louvre_AO5718.jpg
-es_PE/images/4/41/Tipo_Ala_en_flecha_negativa.JPG
-es_PE/images/4/41/Slaughterhouse.jpg
-es_PE/images/4/41/Flag_of_India.svg
-es_PE/images/4/41/Flag_of_India.svg.jpg
-es_PE/images/4/41/Topographic30deg_N0W150.png
-es_PE/images/4/41/Flag_of_Austria-Hungary_1869-1918.svg
-es_PE/images/4/41/Flag_of_Austria-Hungary_1869-1918.svg.jpg
-es_PE/images/4/41/Adam_Smith.jpg
-es_PE/images/4/41/Flag_of_Austria.svg
-es_PE/images/4/41/Chicony_Wireless_Keyboard_KBR0108.jpg
-es_PE/images/4/41/Commons-logo-en.svg
-es_PE/images/4/41/Sigmund_Freud,_New_York_Times,_1922.JPG
-es_PE/images/4/41/Cocaine.svg
-es_PE/images/4/41/Cocaine.svg.jpg
-es_PE/images/4/41/Real_Casa_de_Correos_(Madrid)_01.jpg
-es_PE/images/4/41/Personal_computer,_exploded_5.svg
-es_PE/images/4/41/Personal_computer,_exploded_5.svg.jpg
-es_PE/images/4/41/2005-11-21_U2_@_MSG_by_ZG.JPG
-es_PE/images/4/4e/Pleiades_large.jpg
-es_PE/images/4/4e/PT_party.png
-es_PE/images/4/4e/Surveyor_3-Apollo_12.jpg
-es_PE/images/4/4e/Chocomap.jpg
-es_PE/images/4/4e/Vegetarian_diet.jpg
-es_PE/images/4/4e/Prise_de_la_Bastille.jpg
-es_PE/images/4/4e/Coat_of_arms_of_Andorra.svg
-es_PE/images/4/4e/Coat_of_arms_of_Andorra.svg.jpg
-es_PE/images/4/4e/ReyMysterio.jpg
-es_PE/images/4/4e/ISO_members.png
-es_PE/images/4/4e/System_of_a_Down,_Download_Festival_2005_(1).JPG
-es_PE/images/4/4e/Association_football_history.png
-es_PE/images/4/4e/Allah-green.svg
-es_PE/images/4/4e/Allah-green.svg.jpg
-es_PE/images/4/49/Raffael-58a.jpg
-es_PE/images/4/49/Columpio_Veracruz_059.jpg
-es_PE/images/4/49/Human_brain_NIH.jpg
-es_PE/images/4/49/Parinacota.jpg
-es_PE/images/4/49/Fredmeyer_edit_1.jpg
-es_PE/images/4/49/Flag_of_Ukraine.svg
-es_PE/images/4/49/Lucía_Lapiedra.JPG
-es_PE/images/4/49/LocationIsrael.svg
-es_PE/images/4/49/LocationIsrael.svg.jpg
-es_PE/images/4/49/Fibreoptic.jpg
-es_PE/images/4/49/Bulbgraph_Off.png
-es_PE/images/4/49/Escudo_de_chihuahua.png
-es_PE/images/4/49/Escudo_de_la_Comunidad_de_Madrid.svg
-es_PE/images/4/49/Escudo_de_la_Comunidad_de_Madrid.svg.jpg
-es_PE/images/4/49/Uranometria_orion.jpg
-es_PE/images/4/49/Panama_Canal_under_construction,_1907.jpg
-es_PE/images/4/47/Vista-mymac.png
-es_PE/images/4/47/Sound-icon.svg
-es_PE/images/4/47/Sound-icon.svg.jpg
-es_PE/images/4/47/Frankfurt_am_Main.jpg
-es_PE/images/4/47/Flag_RSFSR_1918.svg
-es_PE/images/4/47/Flag_RSFSR_1918.svg.jpg
-es_PE/images/4/47/Flag_of_Liechtenstein.svg
-es_PE/images/4/47/Flag_of_Liechtenstein.svg.jpg
-es_PE/images/4/47/Mika_at_V_Festival_2007.jpg
-es_PE/images/4/47/George_Washington_Signature.png
-es_PE/images/4/44/Earth_seafloor_crust_age_1996.gif
-es_PE/images/4/44/Golden-Section.png
-es_PE/images/4/44/Abraham_Lincoln_head_on_shoulders_photo_portrait.jpg
-es_PE/images/4/44/Ellen_Page.jpg
-es_PE/images/4/44/Exponentials.svg
-es_PE/images/4/44/Exponentials.svg.jpg
-es_PE/images/4/44/New_York_Stock_Exchange_Flags.jpg
-es_PE/images/4/44/Arctic_Monkeys_live.jpg
-es_PE/images/4/45/Topographic30deg_N0E120.png
-es_PE/images/4/45/Flag_of_Ireland.svg
-es_PE/images/4/45/Thales.jpg
-es_PE/images/4/45/YellowFeverVirus.jpg
-es_PE/images/4/45/Glider.svg
-es_PE/images/4/45/Glider.svg.jpg
-es_PE/images/4/45/Henry-VIII-kingofengland_1491-1547.jpg
-es_PE/images/4/45/Iceland_coa1.gif
-es_PE/images/4/45/AguileraDublin2.jpg
-es_PE/images/4/45/LeftHand.jpg
-es_PE/images/4/43/Immanuel_Kant_(painted_portrait).jpg
-es_PE/images/4/43/Feed-icon.svg
-es_PE/images/4/43/2006-01-14_Surface_waves.jpg
-es_PE/images/4/43/Lenin_CL.jpg
-es_PE/images/4/43/Templarsign.jpg
-es_PE/images/4/43/Peace_dove.svg
-es_PE/images/4/43/Peace_dove.svg.jpg
-es_PE/images/4/43/AguilaMuseoLarco.jpg
-es_PE/images/4/42/Gabriel_Marquez_Signature.png
-es_PE/images/4/42/ASCII_full.svg
-es_PE/images/4/42/ASCII_full.svg.jpg
-es_PE/images/4/42/Louis_Pasteur.jpg
-es_PE/images/4/42/MMVA2007_Hilary_Duff_3A2V0147.jpg
-es_PE/images/4/42/Antoni_gaudi.jpg
-es_PE/images/4/42/The_ROCK.jpg
-es_PE/images/4/42/Retinol_structure.svg
-es_PE/images/4/42/Retinol_structure.svg.jpg
-es_PE/images/4/42/Wikimedia-Server.jpg
-es_PE/images/8/88/Astronaut-EVA.jpg
-es_PE/images/8/88/Peru_Machu_Picchu_Sunset.jpg
-es_PE/images/8/88/Flag_of_the_Pitcairn_Islands.svg
-es_PE/images/8/88/Flag_of_the_Pitcairn_Islands.svg.jpg
-es_PE/images/8/88/Ship_diagram-numbers.svg
-es_PE/images/8/88/Ship_diagram-numbers.svg.jpg
-es_PE/images/8/88/Byzantinische_Dromone.PNG
-es_PE/images/8/88/At_sign.svg
-es_PE/images/8/88/At_sign.svg.jpg
-es_PE/images/8/88/Plano.png
-es_PE/images/8/88/Comic-sketch.jpg
-es_PE/images/8/88/CSA_FLAG_4.3.1861-21.5.1861.svg
-es_PE/images/8/88/CSA_FLAG_4.3.1861-21.5.1861.svg.jpg
-es_PE/images/8/88/Debate_Anatel.jpg
-es_PE/images/8/88/Horse_hjerl_hede_2004_ubt.jpeg
-es_PE/images/8/88/Allori_Venus_Cupido.jpg
-es_PE/images/8/8b/Subtraction01.svg
-es_PE/images/8/8b/Subtraction01.svg.jpg
-es_PE/images/8/8b/Bandera_Uruguay_Colonia_del_Sacramento.jpg
-es_PE/images/8/8b/Green_Arrow_Up_Darker.svg
-es_PE/images/8/8b/GDP-worldmap-2006-es.svg
-es_PE/images/8/8b/GDP-worldmap-2006-es.svg.jpg
-es_PE/images/8/8b/C-TableImage.png
-es_PE/images/8/8b/LocationHonduras.svg
-es_PE/images/8/8b/LocationHonduras.svg.jpg
-es_PE/images/8/8b/Édouard-Henri_Avril_(28).jpg
-es_PE/images/8/81/Wikimedia-logo.svg
-es_PE/images/8/81/Oceans.png
-es_PE/images/8/81/Tvwithantenna.jpg
-es_PE/images/8/81/Flag_of_Serbia_(state).svg
-es_PE/images/8/81/Flag_of_Serbia_(state).svg.jpg
-es_PE/images/8/81/Nucleus_ER_golgi_ex.jpg
-es_PE/images/8/81/Deutschland1939.png
-es_PE/images/8/81/Engine_belts.jpg
-es_PE/images/8/81/Sanzio_01_Euclid.jpg
-es_PE/images/8/81/Forbes_building_in_NYC.jpg
-es_PE/images/8/87/Climats_dans_le_Monde.svg
-es_PE/images/8/87/Climats_dans_le_Monde.svg.jpg
-es_PE/images/8/87/Saami_Family_1900.jpg
-es_PE/images/8/87/TangoCouple.jpg
-es_PE/images/8/87/Flag_of_American_Samoa.svg
-es_PE/images/8/87/Flag_of_American_Samoa.svg.jpg
-es_PE/images/8/87/Televideo925Terminal.jpg
-es_PE/images/8/87/Bandera_de_Madrid.svg
-es_PE/images/8/87/Bandera_de_Madrid.svg.jpg
-es_PE/images/8/87/Christian_cross.svg
-es_PE/images/8/87/Christian_cross.svg.jpg
-es_PE/images/8/87/VCR_motor_style_2.jpg
-es_PE/images/8/87/Old_book_bindings.jpg
-es_PE/images/8/87/PET_scan_Parkinson's_Disease.jpg
-es_PE/images/8/87/Lymphocyte_GL.jpg
-es_PE/images/8/80/Microtuble.jpg
-es_PE/images/8/80/Ãrbol_genealógico_dioses_olímpicos_.JPG
-es_PE/images/8/80/Coat_of_Arms_of_Germany.svg
-es_PE/images/8/80/Zodiaco_Chino.jpg
-es_PE/images/8/80/Circular_Rainbow_209.jpg
-es_PE/images/8/80/Faravahar.png
-es_PE/images/8/80/Breast_DCIS_histopathology_(1).jpg
-es_PE/images/8/82/Ribosome_structure.png
-es_PE/images/8/82/ALU_symbol.svg
-es_PE/images/8/82/ALU_symbol.svg.jpg
-es_PE/images/8/82/Armillary_sphere.png
-es_PE/images/8/82/Flag_of_Honduras.svg
-es_PE/images/8/82/LocationAmericas.png
-es_PE/images/8/82/SevenWondersOfTheWorld.jpg
-es_PE/images/8/82/LocationRussia.svg
-es_PE/images/8/82/LocationRussia.svg.jpg
-es_PE/images/8/82/Elvis_Presley_1970.jpg
-es_PE/images/8/82/Emo_girl_02_posing_01.jpg
-es_PE/images/8/82/LocationMadagascar.svg
-es_PE/images/8/82/LocationMadagascar.svg.jpg
-es_PE/images/8/83/SAM_pol.png
-es_PE/images/8/83/Tequila-barrel.JPG
-es_PE/images/8/83/Antoni_van_Leeuwenhoek.png
-es_PE/images/8/83/MercatormapFullEurope16thcentury.jpg
-es_PE/images/8/83/Montevideo_Playa_Pocitos.JPG
-es_PE/images/8/83/Vietcong.jpg
-es_PE/images/8/83/Clockimportant.svg
-es_PE/images/8/83/Clockimportant.svg.jpg
-es_PE/images/8/83/Aedes_aegypti_during_blood_meal.jpg
-es_PE/images/8/83/Smoking_equipment.jpg
-es_PE/images/8/83/Hip_hop.jpg
-es_PE/images/8/83/Coat_of_Arms_of_Switzerland.svg
-es_PE/images/8/83/Location_Austria_EU_Europe.png
-es_PE/images/8/8f/Flag_of_Estonia.svg
-es_PE/images/8/8f/Illu_epithelium.jpg
-es_PE/images/8/8f/Location_Veracruz_Llave.png
-es_PE/images/8/8f/Emma_Watson_serge.jpg
-es_PE/images/8/8f/IT_room_Marling.jpg
-es_PE/images/8/8f/LocationHawaii.png
-es_PE/images/8/8f/Ebass.jpg
-es_PE/images/8/8d/Qgis08_grass6_toolbox.png
-es_PE/images/8/8d/Education_index_UN_HDR_2007_2008.PNG
-es_PE/images/8/8d/Young_monks_of_Drepung.jpg
-es_PE/images/8/8d/Extent_of_Western_Roman_Empire_395.png
-es_PE/images/8/8d/ACDC-Hughes-long_ago.jpg
-es_PE/images/8/8d/San_Andreas.jpg
-es_PE/images/8/8d/PrefSymbol-Tokyo.png
-es_PE/images/8/8d/Impressionism_monet.jpg
-es_PE/images/8/8c/Insulincrystals.jpg
-es_PE/images/8/8c/Mouse_brain.jpg
-es_PE/images/8/8c/Europei_di_pallavolo_2005_-_Italia-Russia.jpg
-es_PE/images/8/8c/Honduras_coa.png
-es_PE/images/8/8c/Standard_deviation_diagram.svg
-es_PE/images/8/8c/Standard_deviation_diagram.svg.jpg
-es_PE/images/8/8c/Flag_of_Myanmar.svg
-es_PE/images/8/8c/Flag_of_Myanmar.svg.jpg
-es_PE/images/8/8c/Euklid2.jpg
-es_PE/images/8/8c/Barograph_01.jpg
-es_PE/images/8/89/AS8-13-2344.jpg
-es_PE/images/8/89/SEM_Lymphocyte.jpg
-es_PE/images/8/89/SaltInWaterSolutionLiquid.jpg
-es_PE/images/8/89/Alizee_Jacotey_-_chanteuse_francaise_-_Paris_-_3_decembre_2007_-_DSC_1665bis.jpg
-es_PE/images/8/89/US_flag_21_stars.svg
-es_PE/images/8/89/US_flag_21_stars.svg.jpg
-es_PE/images/8/89/Praha_Staroměstské_náměstí.jpg
-es_PE/images/8/84/MDR_Kripo_live.jpg
-es_PE/images/8/84/Flag_of_Latvia.svg
-es_PE/images/8/84/HTML.svg
-es_PE/images/8/84/HTML.svg.jpg
-es_PE/images/8/84/Britney_Spears.jpg
-es_PE/images/8/84/Periodic_table.svg
-es_PE/images/8/84/Periodic_table.svg.jpg
-es_PE/images/8/84/UK_Royal_Coat_of_Arms.svg
-es_PE/images/8/84/UK_Royal_Coat_of_Arms.svg.jpg
-es_PE/images/8/84/Martin_Luther_King_Jr_NYWTS.jpg
-es_PE/images/8/84/AnemiaFrote.jpg
-es_PE/images/8/84/Popiersie_Jimi_Hendrix_ssj_20060914.jpg
-es_PE/images/8/84/Electoral_map.svg
-es_PE/images/8/84/Electoral_map.svg.jpg
-es_PE/images/8/84/IodoAtomico.JPG
-es_PE/images/8/84/13colonias.jpg
-es_PE/images/8/84/Fr_1617-Schlegel_19var.jpg
-es_PE/images/8/84/Rublev's_saviour.jpg
-es_PE/images/8/8e/Aradtruck.JPG
-es_PE/images/8/8e/Quuen_band.jpg
-es_PE/images/8/8e/Germany_Laender_Berlin.png
-es_PE/images/8/8e/Morfoanatomia_celula_vegetal.png
-es_PE/images/8/8e/Flag_of_the_City_of_Granada.png
-es_PE/images/8/8e/Danieldaylewis.jpg
-es_PE/images/8/8a/Topographic30deg_S30E90.png
-es_PE/images/8/8a/Triple_expansion_engine_animation.gif
-es_PE/images/8/8a/11866.0.Biological_classification_L_Pengo_es.svg
-es_PE/images/8/8a/11866.0.Biological_classification_L_Pengo_es.svg.jpg
-es_PE/images/8/8a/ABO_sangre_tipo.svg
-es_PE/images/8/8a/ABO_sangre_tipo.svg.jpg
-es_PE/images/8/8a/Kit_right_arm_manutda0709.png
-es_PE/images/8/85/Tornade002.jpg
-es_PE/images/8/85/Galileo_by_leoni.jpg
-es_PE/images/8/85/Canadian_Coat_of_Arms_Shield.svg
-es_PE/images/8/85/Canadian_Coat_of_Arms_Shield.svg.jpg
-es_PE/images/8/85/Mexico_City_Palacio_de_bellas_artes.jpg
-es_PE/images/8/85/Map_of_New_York_Highlighting_New_York_City.png
-es_PE/images/8/85/BatistaFA.jpg
-es_PE/images/8/85/Flag_of_Belarus.svg
-es_PE/images/8/85/Flag_of_Belarus.svg.jpg
-es_PE/images/8/85/Breakup_of_Yugoslavia.gif
-es_PE/images/8/85/Mona_Lisa.jpeg
-es_PE/images/8/85/Flower-Power_Bus.jpg
-es_PE/images/8/85/Flag_of_Los_Angeles,_California.svg
-es_PE/images/8/85/Flag_of_Los_Angeles,_California.svg.jpg
-es_PE/images/8/86/Neandertal.jpg
-es_PE/images/8/86/LocationElSalvador.svg
-es_PE/images/8/86/LocationElSalvador.svg.jpg
-es_PE/images/8/86/Sperm-egg.jpg
-es_PE/images/8/86/Juan_Ramón_Jiménez.jpg
-es_PE/images/8/86/Filtration_diagram.svg
-es_PE/images/8/86/Filtration_diagram.svg.jpg
-es_PE/images/5/50/Heinrich_Rudolf_Hertz.jpg
-es_PE/images/5/50/Attributes_of_painting,_sculpture_&_architecture.jpg
-es_PE/images/5/50/Venezuela_coat_of_arms.png
-es_PE/images/5/50/AmyWinehouseBerlin2007.jpg
-es_PE/images/5/50/Vista-mouse.png
-es_PE/images/5/50/Location_Netherlands_EU_Europe.png
-es_PE/images/5/50/Theo_van_Doesburg_Dadamatinée.jpg
-es_PE/images/5/50/Brahma_Halebid.jpg
-es_PE/images/5/50/Triple_H_Pointing_Melbourne_10.11.2007.jpg
-es_PE/images/5/50/Turandot_en_el_Luna_Park.jpg
-es_PE/images/5/50/Gregory_XIII.jpg
-es_PE/images/5/50/Voelkerwanderungkarte.png
-es_PE/images/5/5c/Addition01.svg
-es_PE/images/5/5c/Addition01.svg.jpg
-es_PE/images/5/5c/Bolsa_Mexicana_de_Valores.jpg
-es_PE/images/5/5c/Newspapers_FT_SvD_IHT_WSJ.jpg
-es_PE/images/5/5c/Volvo460.JPG
-es_PE/images/5/5c/Flag_of_Portugal.svg
-es_PE/images/5/5c/Flag_of_Portugal.svg.jpg
-es_PE/images/5/5c/Flag_of_Greece.svg
-es_PE/images/5/5c/Claude_Monet,_Impression,_soleil_levant,_1872.jpg
-es_PE/images/5/5c/Wright_R1820_Cyclone.jpg
-es_PE/images/5/5c/Grand_Union_Flag.svg
-es_PE/images/5/5c/The_Spring.jpg
-es_PE/images/5/5c/Croatian_Coat_of_Arms.svg
-es_PE/images/5/5c/Croatian_Coat_of_Arms.svg.jpg
-es_PE/images/5/5c/Panama-Canal-rough-diagram-quick.jpg
-es_PE/images/5/51/Gottlieb-Jews_Praying_in_the_Synagogue_on_Yom_Kippur.jpg
-es_PE/images/5/51/Mandarin.duck.arp.jpg
-es_PE/images/5/51/Uri.svg
-es_PE/images/5/51/Un_sol_de_1889.JPG
-es_PE/images/5/51/Colo_do_sac_1.jpg
-es_PE/images/5/51/Gliese.JPG
-es_PE/images/5/51/Apple_Adjustable_Keyboard.jpg
-es_PE/images/5/51/Austria-Hungary-flag-1869-1918-naval-1786-1869-war.svg
-es_PE/images/5/51/Austria-Hungary-flag-1869-1918-naval-1786-1869-war.svg.jpg
-es_PE/images/5/51/Sexual_cycle.svg
-es_PE/images/5/51/Sexual_cycle.svg.jpg
-es_PE/images/5/51/Diodos_LED_Simbolo.png
-es_PE/images/5/51/Sarre-Liga-de-Naciones.gif
-es_PE/images/5/51/Flag_of_North_Korea.svg
-es_PE/images/5/51/Flag_of_North_Korea.svg.jpg
-es_PE/images/5/51/Venus-real.jpg
-es_PE/images/5/51/ZPraha-07.JPG
-es_PE/images/5/54/Floridaserversfront1.jpg
-es_PE/images/5/54/PAN_party.png
-es_PE/images/5/54/Castillo_Piria.jpg
-es_PE/images/5/54/Aids_virus.jpg
-es_PE/images/5/54/Newfoundland_Red_Ensign.png
-es_PE/images/5/54/Location_Ireland_EU_Europe.png
-es_PE/images/5/54/John_paul_2_coa.svg
-es_PE/images/5/54/John_paul_2_coa.svg.jpg
-es_PE/images/5/54/Gray_111_-_Vertebral_column-coloured.png
-es_PE/images/5/5a/Monterrey_nightview.png
-es_PE/images/5/5a/PET2.jpg
-es_PE/images/5/5a/Mapa_Perú_Ioannem_Ianssonium.jpg
-es_PE/images/5/5a/Wilderbeest.jpg
-es_PE/images/5/5a/Topographic30deg_S0W120.png
-es_PE/images/5/5a/KomodoDragon.jpg
-es_PE/images/5/5a/Prinsenvlag.svg
-es_PE/images/5/5a/EUR_1_(2007_issue).png
-es_PE/images/5/5a/Tarangire-Natpark800600.jpg
-es_PE/images/5/5a/Escudo-echenique3.gif
-es_PE/images/5/5a/Reagan_vor_dem_Brandenburger_Tor.png
-es_PE/images/5/52/Canon_del_Sumideiro_2.jpg
-es_PE/images/5/52/Filippo_Brunelleschi,_cutaway_of_the_Dome_of_Florence_Cathedral_(Santa_Maria_del_Fiore).JPG
-es_PE/images/5/52/Merge-arrows.svg
-es_PE/images/5/52/Merge-arrows.svg.jpg
-es_PE/images/5/52/Flag_of_Martinique.svg
-es_PE/images/5/52/Flag_of_Martinique.svg.jpg
-es_PE/images/5/52/Gabogarciamarquez1.png
-es_PE/images/5/52/LocationBolivia.svg
-es_PE/images/5/52/LocationBolivia.svg.jpg
-es_PE/images/5/52/Unibibliotek_Salzburg_Artes_liberales_Geometria.jpg
-es_PE/images/5/52/Paramore.jpg
-es_PE/images/5/52/Museo_del_Prado.jpg
-es_PE/images/5/52/OpenOffice.org_2_icon.png
-es_PE/images/5/52/Gran_Colombia_map.jpg
-es_PE/images/5/57/Galunggung.jpg
-es_PE/images/5/57/Staphylococcus_aureus_01.jpg
-es_PE/images/5/57/Magnet0873.png
-es_PE/images/5/57/Aztekischer_Kalenderstein.jpg
-es_PE/images/5/57/USB_to_PS2_mouse_adapter.jpg
-es_PE/images/5/57/Flag_of_Malaga,_Spain.png
-es_PE/images/5/5f/Entrevista_a_Del_Toro_para_TRAMA_39.jpg
-es_PE/images/5/5f/Septem-artes-liberales_Herrad-von-Landsberg_Hortus-delicarium_1180.jpg
-es_PE/images/5/5f/Valentineanddisciples.jpg
-es_PE/images/5/5f/Flag_of_Quebec.svg
-es_PE/images/5/5f/Flag_of_Quebec.svg.jpg
-es_PE/images/5/5f/Simbolo_reciclar.svg
-es_PE/images/5/5f/Simbolo_reciclar.svg.jpg
-es_PE/images/5/5f/Lab_bench.jpg
-es_PE/images/5/5f/Microsoft_wordmark.svg
-es_PE/images/5/5f/Microsoft_wordmark.svg.jpg
-es_PE/images/5/5f/Rosa_sp.273.jpg
-es_PE/images/5/5f/Acetylene.png
-es_PE/images/5/55/Phylogenetic_tree-es.png
-es_PE/images/5/55/Family_trip.jpg
-es_PE/images/5/55/Emblem_of_India.svg
-es_PE/images/5/55/Emblem_of_India.svg.jpg
-es_PE/images/5/55/Spargel_4106.JPG
-es_PE/images/5/55/Milkau_Oberer_Teil_der_Stele_mit_dem_Text_von_Hammurapis_Gesetzescode_369-2.jpg
-es_PE/images/5/55/Hepatitis_B_virus_01.jpg
-es_PE/images/5/55/OPEC01.jpg
-es_PE/images/5/58/3D_Wavefunction_(2,2,2).gif
-es_PE/images/5/58/Camaras_TV.JPG
-es_PE/images/5/58/Playa_El_Sauzal.jpg
-es_PE/images/5/58/Scribe-accroupi.jpg
-es_PE/images/5/58/Freud_Sofa.JPG
-es_PE/images/5/58/WWE_Championship.jpg
-es_PE/images/5/58/Smelines.jpg
-es_PE/images/5/58/T-Rex2.jpg
-es_PE/images/5/58/Lichenes_rock_Meneham_ecological_niches_dscn1884.jpg
-es_PE/images/5/58/DowntownAucklandNight.jpg
-es_PE/images/5/58/Steinadler_Aquila_chrysaetos_closeup1_Richard_Bartz.jpg
-es_PE/images/5/58/Jose_Marti.jpg
-es_PE/images/5/59/Henri_de_Saint-simon_portrait.jpg
-es_PE/images/5/59/Sun_spot_diag_Lmb.png
-es_PE/images/5/59/Charles_Darwin.jpg
-es_PE/images/5/59/LocationColombia.svg
-es_PE/images/5/59/LocationColombia.svg.jpg
-es_PE/images/5/59/Current_event_marker.svg
-es_PE/images/5/59/Current_event_marker.svg.jpg
-es_PE/images/5/59/Flag_of_Lebanon.svg
-es_PE/images/5/59/Flag_of_Lebanon.svg.jpg
-es_PE/images/5/59/Kit_left_arm_blueline.png
-es_PE/images/5/59/Staphylococcus_aureus_(AB_Test).jpg
-es_PE/images/5/59/VolleyballRotation.svg
-es_PE/images/5/59/VolleyballRotation.svg.jpg
-es_PE/images/5/59/Saabaghiberti.jpg
-es_PE/images/5/59/Sow_with_piglet.jpg
-es_PE/images/5/5b/Atome_de_Rutherford.png
-es_PE/images/5/5b/GoldNuggetUSGOV.jpg
-es_PE/images/5/5b/USS_Seawolf_(SSN-575).jpg
-es_PE/images/5/5b/Caspar_David_Friedrich_032.jpg
-es_PE/images/5/5b/Coat_of_arms_of_Chile.svg
-es_PE/images/5/5b/Coat_of_arms_of_Chile.svg.jpg
-es_PE/images/5/5b/Flag_of_Hong_Kong.svg
-es_PE/images/5/5b/BCN02.jpg
-es_PE/images/5/5b/Nile_Valley.jpg
-es_PE/images/5/5b/Europe_location_SRB.png
-es_PE/images/5/5b/Kkk1928.jpg
-es_PE/images/5/5b/Battle_of_Fort_Hindman.png
-es_PE/images/5/5b/Star_of_life2.svg
-es_PE/images/5/5b/Star_of_life2.svg.jpg
-es_PE/images/5/5b/Lorenz_attractor_yb.svg
-es_PE/images/5/5b/Lorenz_attractor_yb.svg.jpg
-es_PE/images/5/5b/Flag_of_New_Granada.svg
-es_PE/images/5/53/Jordens_inre.svg
-es_PE/images/5/53/Jordens_inre.svg.jpg
-es_PE/images/5/53/Flag_of_Tokelau_(local).svg
-es_PE/images/5/53/Flag_of_Tokelau_(local).svg.jpg
-es_PE/images/5/53/Island_of_California.jpg
-es_PE/images/5/53/Colosseum_in_Rome,_Italy_-_April_2007.jpg
-es_PE/images/5/53/Netzwerktopologie_Stern.png
-es_PE/images/5/5d/Religionesdelmundo.jpg
-es_PE/images/5/5d/Sanisidro_12.jpg
-es_PE/images/5/5d/Newtons_laws_in_latin.jpg
-es_PE/images/5/5d/BullExurgeDomine.jpg
-es_PE/images/5/5d/FAD_FADH2_equlibrium.png
-es_PE/images/5/5d/Haliaeetus_leucocephalus2_(softeis).jpg
-es_PE/images/5/5d/Berlinermauer.jpg
-es_PE/images/5/5d/LocationMyanmar.svg
-es_PE/images/5/5d/LocationMyanmar.svg.jpg
-es_PE/images/5/5e/Sleep_EEG_REM.png
-es_PE/images/5/5e/United_Nations_Members.PNG
-es_PE/images/5/5e/John_F._Kennedy,_White_House_photo_portrait,_looking_up.jpg
-es_PE/images/5/5e/JBde-Lamarck.jpg
-es_PE/images/5/56/Flag_of_Haiti.svg
-es_PE/images/5/56/Flag_of_Haiti.svg.jpg
-es_PE/images/5/56/DNA_Overview_es.png
-es_PE/images/5/56/William-Adolphe_Bouguereau_(1825-1905)_-_The_Difficult_Lesson_(1884).jpg
-es_PE/images/5/56/KISS_in_concert_Boston_2004.jpg
-es_PE/images/5/56/Mars_Valles_Marineris.jpeg
-es_PE/images/5/56/Spammed-mail-folder.png
-bin/tidy
-bin/tidy.conf
-bin/blahtex
diff --git a/NEWS b/NEWS
deleted file mode 100755
index 0ad7d5a..0000000
--- a/NEWS
+++ /dev/null
@@ -1,49 +0,0 @@
-10
-
-* Attempt to solve thread closing problems via Thread.setDaemon(True).
-
-9
-
-* Remove inappropriate images.
-* Fix math rendering.
-
-8
-
-* Don't return template pages in search results.
-* Translate "Search results for.." to Spanish.
-* Add a copy of Web's translations, for the browser UI.
-
-7
-
-* Switch to mathml via blahtex for rendering math.
-* Use xpcom to turn off "offline mode" detection
-* Switch to rsvg for SVG processing,
-
-6
-
-* Use xpcom to set a 5M RAM cache limit, avoiding OOM crashes.
-* Fix template blacklisting code.
-* New CSS file.
-
-5
-
-* Fix crashers
-* Use threads to handle synchronizing startup/exit for client<->server
-* Add links to report rendering problems and inappropriate content.
-
-4
-
-* Reorganize directory structure.
-
-3
-
-* Add link-checking -- links not present in the index are in green.
-* Add portal page by Madeleine Price Ball.
-
-2
-
-* Added search toolbar to activity toolbar.
-
-1
-
-* Preview release of activity wrapper for wikiserver.
diff --git a/_wp.so b/_wp.so
deleted file mode 100755
index cfdc0d7..0000000
--- a/_wp.so
+++ /dev/null
Binary files differ
diff --git a/activity.py b/activity.py
deleted file mode 100644
index 42b3bbb..0000000
--- a/activity.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright (C) 2007, One Laptop Per Child
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-from gettext import gettext as _
-
-import os
-import sys
-import server
-
-from sugar.activity import registry
-activity_info = registry.get_registry().get_activity('org.laptop.WebActivity')
-
-sys.path.append(activity_info.path)
-import webactivity
-
-from searchtoolbar import SearchToolbar
-
-# Default settings.
-HTTP_PORT = '8000'
-WIKIDB = 'es_PE/es_PE.xml.bz2'
-HOME_PAGE = '/static/'
-
-# Activity class, extends WebActivity.
-class HelpActivity(webactivity.WebActivity):
- def __init__(self, handle):
-
- print "Starting server...\n"
-
- os.chdir(os.environ['SUGAR_BUNDLE_PATH'])
-
- server.load_db(WIKIDB)
- server.run_server(WIKIDB, int(HTTP_PORT))
-
- handle.uri = 'http://localhost:%s%s' % (HTTP_PORT, HOME_PAGE)
-
- webactivity.WebActivity.__init__(self, handle)
-
- # Use xpcom to set a RAM cache limit. (Trac #7081.)
- from xpcom import components
- from xpcom.components import interfaces
- cls = components.classes['@mozilla.org/preferences-service;1']
- pref_service = cls.getService(interfaces.nsIPrefService)
- branch = pref_service.getBranch("browser.cache.memory.")
- branch.setIntPref("capacity", "5000")
-
- # Use xpcom to turn off "offline mode" detection, which disables
- # access to localhost for no good reason. (Trac #6250.)
- ios_class = components.classes["@mozilla.org/network/io-service;1"]
- io_service = ios_class.getService(interfaces.nsIIOService2)
- io_service.manageOfflineStatus = False
-
- self.searchtoolbar = SearchToolbar(self)
- # WTB: Hacked to use hardcoded Spanish localization for WikiBrowse release.
- self.toolbox.add_toolbar('Buscar', self.searchtoolbar)
- self.searchtoolbar.show()
diff --git a/activity/activity-help.svg b/activity/activity-help.svg
deleted file mode 100644
index 296267d..0000000
--- a/activity/activity-help.svg
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [
- <!ENTITY stroke_color "#000">
- <!ENTITY fill_color "#eee">
-]><svg height="55px" viewBox="0 0 55 55" width="55px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" stroke="&stroke_color;" fill="&fill_color;">
- <path d="M 27.904 11.023 L 27.902 11.023 C 27.902 11.021 26.192 8.97 18.526 8.519 C 10.86 8.07 6.843 10.121 6.84 10.122 C 4.942 10.741 3.345 11.857 3.345 13.616 L 3.345 41.318 C 3.345 43.343 4.58 44.812 6.84 44.812 C 6.843 44.812 11.25 43.462 16.844 43.462 C 22.433 43.461 27.905 45.715 27.905 45.715 " />
- <path d="M 27.898 11.023 L 27.898 11.023 C 27.898 11.021 29.613 8.97 37.275 8.519 C 44.943 8.07 48.961 10.121 48.963 10.122 C 50.86 10.741 52.457 11.857 52.457 13.616 L 52.457 41.318 C 52.457 43.343 51.224 44.812 48.963 44.812 C 48.96 44.812 44.554 43.462 38.959 43.462 C 33.37 43.461 27.897 45.715 27.897 45.715 " />
- <path d="M 27.7747 10.8997 L 28.0233 11.1407 " fill="none" />
- <path d="M 32.566 44.275 C 32.566 44.275 32.535 47.181 27.9 47.181 C 23.268 47.181 23.237 44.275 23.237 44.275 " fill="none" />
- <path d="M 48.3856 14.3653 C 48.3856 14.5145 48.3383 14.6492 48.2473 14.7729 C 48.1526 14.8931 48.0544 14.9549 47.9415 14.9549 C 47.0352 15.0423 46.2891 15.3335 45.714 15.8321 C 45.1353 16.3271 44.542 17.2771 43.9269 18.6747 L 34.5364 39.8361 C 34.4746 40.0326 34.3035 40.1309 34.0196 40.1309 C 33.7976 40.1309 33.6265 40.0326 33.5028 39.8361 L 28.2361 28.8223 L 22.1796 39.8361 C 22.0558 40.0326 21.8848 40.1309 21.6627 40.1309 C 21.3934 40.1309 21.2151 40.0326 21.1277 39.8361 L 11.901 18.6747 C 11.3259 17.3608 10.7181 16.4436 10.0775 15.9231 C 9.44055 15.4026 8.54881 15.0787 7.40958 14.9549 C 7.31131 14.9549 7.21668 14.904 7.13296 14.7984 C 7.04561 14.6965 7.00193 14.5764 7.00193 14.4417 C 7.00193 14.096 7.1002 13.9249 7.29675 13.9249 C 8.11933 13.9249 8.9783 13.9613 9.87731 14.0341 C 10.7108 14.1105 11.497 14.1469 12.2322 14.1469 C 12.982 14.1469 13.8664 14.1105 14.8856 14.0341 C 15.952 13.9613 16.8983 13.9249 17.7209 13.9249 C 17.9175 13.9249 18.0157 14.096 18.0157 14.4417 C 18.0157 14.7839 17.9539 14.9549 17.8337 14.9549 C 17.0112 15.0168 16.3633 15.2279 15.8901 15.581 C 15.417 15.9377 15.1804 16.4035 15.1804 16.9823 C 15.1804 17.2771 15.2787 17.6447 15.4752 18.0851 L 23.1004 35.3046 L 27.4281 27.1298 L 23.3952 18.6747 C 22.6709 17.1679 22.074 16.1924 21.6081 15.7557 C 21.1423 15.3225 20.4362 15.0532 19.4898 14.9549 C 19.4025 14.9549 19.3224 14.904 19.2423 14.7984 C 19.1622 14.6965 19.1222 14.5764 19.1222 14.4417 C 19.1222 14.096 19.2059 13.9249 19.3806 13.9249 C 20.2032 13.9249 20.9566 13.9613 21.6445 14.0341 C 22.307 14.1105 23.0131 14.1469 23.7629 14.1469 C 24.4981 14.1469 25.277 14.1105 26.0996 14.0341 C 26.9476 13.9613 27.7811 13.9249 28.6037 13.9249 C 28.8002 13.9249 28.8985 14.096 28.8985 14.4417 C 28.8985 14.7839 28.8403 14.9549 28.7165 14.9549 C 27.0714 15.0678 26.2488 15.5336 26.2488 16.3562 C 26.2488 16.7238 26.4381 17.2953 26.8202 18.0669 L 29.4881 23.4828 L 32.1415 18.5291 C 32.5091 17.8303 32.6947 17.2407 32.6947 16.7602 C 32.6947 15.6319 31.8722 15.0314 30.227 14.9549 C 30.0778 14.9549 30.005 14.7839 30.005 14.4417 C 30.005 14.318 30.0414 14.2015 30.1142 14.0923 C 30.1906 13.9795 30.2634 13.9249 30.3362 13.9249 C 30.9258 13.9249 31.6501 13.9613 32.5091 14.0341 C 33.3317 14.1105 34.0087 14.1469 34.5364 14.1469 C 34.915 14.1469 35.4755 14.1142 36.2107 14.0523 C 37.1425 13.9686 37.925 13.9249 38.5511 13.9249 C 38.6966 13.9249 38.7694 14.0705 38.7694 14.3653 C 38.7694 14.7584 38.6348 14.9549 38.3654 14.9549 C 37.4082 15.0532 36.6366 15.3189 36.0542 15.7484 C 35.4718 16.1779 34.7439 17.1533 33.874 18.6747 L 30.3362 25.2153 L 35.1261 34.9734 L 42.1981 18.5291 C 42.4419 17.9286 42.5657 17.3754 42.5657 16.8731 C 42.5657 15.6683 41.7431 15.0314 40.0979 14.9549 C 39.9487 14.9549 39.8759 14.7839 39.8759 14.4417 C 39.8759 14.096 39.9851 13.9249 40.2071 13.9249 C 40.8077 13.9249 41.5211 13.9613 42.3436 14.0341 C 43.1043 14.1105 43.7449 14.1469 44.2581 14.1469 C 44.8005 14.1469 45.4265 14.1105 46.1362 14.0341 C 46.8751 13.9613 47.5375 13.9249 48.1272 13.9249 C 48.2982 13.9249 48.3856 14.0705 48.3856 14.3653 Z " fill="&stroke_color;" stroke="none" />
- <path d="M 27.8925 40.4059 L 27.9055 45.7225 " fill="none" />
-</svg> \ No newline at end of file
diff --git a/activity/activity.info b/activity/activity.info
deleted file mode 100644
index 15a6cd6..0000000
--- a/activity/activity.info
+++ /dev/null
@@ -1,6 +0,0 @@
-[Activity]
-name = Help
-activity_version = 10
-service_name = org.laptop.HelpActivity
-icon = activity-help
-exec = sugar-activity activity.HelpActivity
diff --git a/bin/blahtex b/bin/blahtex
deleted file mode 100755
index e76c52e..0000000
--- a/bin/blahtex
+++ /dev/null
Binary files differ
diff --git a/bin/tidy b/bin/tidy
deleted file mode 100755
index 22bd2b9..0000000
--- a/bin/tidy
+++ /dev/null
Binary files differ
diff --git a/bin/tidy.conf b/bin/tidy.conf
deleted file mode 100644
index 5260577..0000000
--- a/bin/tidy.conf
+++ /dev/null
@@ -1,7 +0,0 @@
-new-inline-tags: cfif, cfelse, math, mroot,
- mrow, mi, mn, mo, msqrt, mfrac, msubsup, munderover,
- munder, mover, mmultiscripts, msup, msub, mtext,
- mprescripts, mtable, mtr, mtd, mth, mspace, merror,
- mstyle, blahtex, mathml, markup,
-new-blocklevel-tags: cfoutput, cfquery
-
diff --git a/blahtexml/GNU-FDL b/blahtexml/GNU-FDL
deleted file mode 100644
index 4a0fe1c..0000000
--- a/blahtexml/GNU-FDL
+++ /dev/null
@@ -1,397 +0,0 @@
- GNU Free Documentation License
- Version 1.2, November 2002
-
-
- Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document "free" in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License. Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein. The "Document", below,
-refers to any such manual or work. Any member of the public is a
-licensee, and is addressed as "you". You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (Thus, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License. If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant. The Document may contain zero
-Invariant Sections. If the Document does not identify any Invariant
-Sections then there are none.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License. A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-An image format is not Transparent if used for any substantial amount
-of text. A copy that is not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML, PostScript or PDF designed for human modification. Examples of
-transparent image formats include PNG, XCF and JPG. Opaque formats
-include proprietary formats that can be read and edited only by
-proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML, PostScript or PDF produced by some word
-processors for output purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-A section "Entitled XYZ" means a named subunit of the Document whose
-title either is precisely XYZ or contains XYZ in parentheses following
-text that translates XYZ in another language. (Here XYZ stands for a
-specific section name mentioned below, such as "Acknowledgements",
-"Dedications", "Endorsements", or "History".) To "Preserve the Title"
-of such a section when you modify the Document means that it remains a
-section "Entitled XYZ" according to this definition.
-
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document. These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
-
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has fewer than five),
- unless they release you from this requirement.
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section Entitled "History", Preserve its Title, and add
- to it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section Entitled "History" in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the "History" section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.
-K. For any section Entitled "Acknowledgements" or "Dedications",
- Preserve the Title of the section, and preserve in the section all
- the substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.
-M. Delete any section Entitled "Endorsements". Such a section
- may not be included in the Modified Version.
-N. Do not retitle any existing section to be Entitled "Endorsements"
- or to conflict in title with any Invariant Section.
-O. Preserve any Warranty Disclaimers.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections Entitled "History"
-in the various original documents, forming one section Entitled
-"History"; likewise combine any sections Entitled "Acknowledgements",
-and any sections Entitled "Dedications". You must delete all sections
-Entitled "Endorsements".
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an "aggregate" if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included in an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License, and all the license notices in the
-Document, and any Warranty Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers. In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled "Acknowledgements",
-"Dedications", or "History", the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
- Copyright (c) YEAR YOUR NAME.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.2
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
- A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the "with...Texts." line with this:
-
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
-
-If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
diff --git a/blahtexml/GNU-GPL b/blahtexml/GNU-GPL
deleted file mode 100644
index 3912109..0000000
--- a/blahtexml/GNU-GPL
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/blahtexml/HTML+Blahtex.xml b/blahtexml/HTML+Blahtex.xml
deleted file mode 100644
index 5ee3d14..0000000
--- a/blahtexml/HTML+Blahtex.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:b="http://gva.noekeon.org/blahtexml"
- xml:lang="en">
-<head>
- <meta http-equiv="Content-Type" content="text/xml; charset=UTF-8"/>
- <title>Example of Blahtex's processing</title>
-</head>
-<style type="text/css">
-.ieq, .eq {
- color: blue;
-}
-</style>
-<body>
-<h1>Using <code>blahtexml --xmlin</code></h1>
-
-<p>In general, the distance of a point with coordinates <span class="ieq" b:inline="(x,y)"/> to the origin <span class="ieq" b:inline="(0,0)"/> is <span class="ieq" b:inline="\sqrt{x^2+y^2}"/>. A circle of radius <span class="ieq" b:inline="r"/> is the set of points that are at a distance <span class="ieq" b:inline="r"/> of its center. So, the equation of a circle of radius <span class="ieq" b:inline="r"/> centered at the origin is <span class="eq" b:block="x^2+y^2=r^2\text{.}"/></p>
-
-</body>
-
-</html>
diff --git a/blahtexml/HTML+MathML.xml b/blahtexml/HTML+MathML.xml
deleted file mode 100644
index 9d33038..0000000
--- a/blahtexml/HTML+MathML.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://gva.noekeon.org/blahtexml" xml:lang="en">
-<head>
- <meta http-equiv="Content-Type" content="text/xml; charset=UTF-8"></meta>
- <title>Example of Blahtex's processing</title>
-</head>
-<style type="text/css">
-.ieq, .eq {
- color: blue;
-}
-</style>
-<body>
-<h1>Using <code>blahtexml --xmlin</code></h1>
-
-<p>In general, the distance of a point with coordinates <span class="ieq"><math xmlns="http://www.w3.org/1998/Math/MathML"><mo lspace="0" rspace="0" stretchy="false">(</mo><mi>x</mi><mo lspace="0" rspace="0.167em">,</mo><mi>y</mi><mo lspace="0" rspace="0" stretchy="false">)</mo></math></span> to the origin <span class="ieq"><math xmlns="http://www.w3.org/1998/Math/MathML"><mo lspace="0" rspace="0" stretchy="false">(</mo><mn>0</mn><mo lspace="0" rspace="0.167em">,</mo><mn>0</mn><mo lspace="0" rspace="0" stretchy="false">)</mo></math></span> is <span class="ieq"><math xmlns="http://www.w3.org/1998/Math/MathML"><msqrt><msup><mi>x</mi><mn>2</mn></msup><mo lspace="0.222em" rspace="0.222em">+</mo><msup><mi>y</mi><mn>2</mn></msup></msqrt></math></span>. A circle of radius <span class="ieq"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi></math></span> is the set of points that are at a distance <span class="ieq"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi></math></span> of its center. So, the equation of a circle of radius <span class="ieq"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi></math></span> centered at the origin is <span class="eq"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><msup><mi>x</mi><mn>2</mn></msup><mo lspace="0.222em" rspace="0.222em">+</mo><msup><mi>y</mi><mn>2</mn></msup><mo lspace="0.278em" rspace="0.278em">=</mo><msup><mi>r</mi><mn>2</mn></msup><mtext>.</mtext></math></span></p>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/blahtexml/ISTtoTeX.xslt b/blahtexml/ISTtoTeX.xslt
deleted file mode 100644
index 3d297a0..0000000
--- a/blahtexml/ISTtoTeX.xslt
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-// File "ISTtoTeX.xslt"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
-
-<xsl:output method="text" indent="no" encoding="UTF-8"/>
-
-<xsl:template match="symbols">
-<xsl:text>\begin{longtable}{|l|l|l|}
-\hline
-Symbol &amp; Unicode &amp; Translated as \\
-\endhead
-\hline
-</xsl:text>
- <xsl:apply-templates select="symbol"/>
-<xsl:text>\end{longtable}
-</xsl:text>
-</xsl:template>
-
-<xsl:template match="symbol">
- <xsl:text>$</xsl:text>
- <xsl:value-of select="@tex"/>
- <xsl:text>$ &amp; \texttt{</xsl:text>
- <xsl:value-of select="@unicode"/>
- <xsl:text>} &amp; \verb|</xsl:text>
- <xsl:value-of select="@tex"/>
- <xsl:text>| \\
-\hline
-</xsl:text>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/blahtexml/InputSymbolTranslation.tex b/blahtexml/InputSymbolTranslation.tex
deleted file mode 100644
index 95a3244..0000000
--- a/blahtexml/InputSymbolTranslation.tex
+++ /dev/null
@@ -1,694 +0,0 @@
-\begin{longtable}{|l|l|l|}
-\hline
-Symbol & Unicode & Translated as \\
-\endhead
-\hline
-$\lnot$ & \texttt{000000AC} & \verb|\lnot| \\
-\hline
-$\pm$ & \texttt{000000B1} & \verb|\pm| \\
-\hline
-$\times$ & \texttt{000000D7} & \verb|\times| \\
-\hline
-$\div$ & \texttt{000000F7} & \verb|\div| \\
-\hline
-$\Gamma$ & \texttt{00000393} & \verb|\Gamma| \\
-\hline
-$\Delta$ & \texttt{00000394} & \verb|\Delta| \\
-\hline
-$\Theta$ & \texttt{00000398} & \verb|\Theta| \\
-\hline
-$\Lambda$ & \texttt{0000039B} & \verb|\Lambda| \\
-\hline
-$\Xi$ & \texttt{0000039E} & \verb|\Xi| \\
-\hline
-$\Pi$ & \texttt{000003A0} & \verb|\Pi| \\
-\hline
-$\Sigma$ & \texttt{000003A3} & \verb|\Sigma| \\
-\hline
-$\Upsilon$ & \texttt{000003A5} & \verb|\Upsilon| \\
-\hline
-$\Phi$ & \texttt{000003A6} & \verb|\Phi| \\
-\hline
-$\Psi$ & \texttt{000003A8} & \verb|\Psi| \\
-\hline
-$\Omega$ & \texttt{000003A9} & \verb|\Omega| \\
-\hline
-$\alpha$ & \texttt{000003B1} & \verb|\alpha| \\
-\hline
-$\beta$ & \texttt{000003B2} & \verb|\beta| \\
-\hline
-$\gamma$ & \texttt{000003B3} & \verb|\gamma| \\
-\hline
-$\delta$ & \texttt{000003B4} & \verb|\delta| \\
-\hline
-$\varepsilon$ & \texttt{000003B5} & \verb|\varepsilon| \\
-\hline
-$\zeta$ & \texttt{000003B6} & \verb|\zeta| \\
-\hline
-$\eta$ & \texttt{000003B7} & \verb|\eta| \\
-\hline
-$\theta$ & \texttt{000003B8} & \verb|\theta| \\
-\hline
-$\iota$ & \texttt{000003B9} & \verb|\iota| \\
-\hline
-$\kappa$ & \texttt{000003BA} & \verb|\kappa| \\
-\hline
-$\lambda$ & \texttt{000003BB} & \verb|\lambda| \\
-\hline
-$\mu$ & \texttt{000003BC} & \verb|\mu| \\
-\hline
-$\nu$ & \texttt{000003BD} & \verb|\nu| \\
-\hline
-$\xi$ & \texttt{000003BE} & \verb|\xi| \\
-\hline
-$\pi$ & \texttt{000003C0} & \verb|\pi| \\
-\hline
-$\rho$ & \texttt{000003C1} & \verb|\rho| \\
-\hline
-$\varsigma$ & \texttt{000003C2} & \verb|\varsigma| \\
-\hline
-$\sigma$ & \texttt{000003C3} & \verb|\sigma| \\
-\hline
-$\tau$ & \texttt{000003C4} & \verb|\tau| \\
-\hline
-$\upsilon$ & \texttt{000003C5} & \verb|\upsilon| \\
-\hline
-$\varphi$ & \texttt{000003C6} & \verb|\varphi| \\
-\hline
-$\chi$ & \texttt{000003C7} & \verb|\chi| \\
-\hline
-$\psi$ & \texttt{000003C8} & \verb|\psi| \\
-\hline
-$\omega$ & \texttt{000003C9} & \verb|\omega| \\
-\hline
-$\vartheta$ & \texttt{000003D1} & \verb|\vartheta| \\
-\hline
-$\phi$ & \texttt{000003D5} & \verb|\phi| \\
-\hline
-$\varpi$ & \texttt{000003D6} & \verb|\varpi| \\
-\hline
-$\digamma$ & \texttt{000003DD} & \verb|\digamma| \\
-\hline
-$\varkappa$ & \texttt{000003F0} & \verb|\varkappa| \\
-\hline
-$\varrho$ & \texttt{000003F1} & \verb|\varrho| \\
-\hline
-$\epsilon$ & \texttt{000003F5} & \verb|\epsilon| \\
-\hline
-$\backepsilon$ & \texttt{000003F6} & \verb|\backepsilon| \\
-\hline
-$\dagger$ & \texttt{00002020} & \verb|\dagger| \\
-\hline
-$\ddagger$ & \texttt{00002021} & \verb|\ddagger| \\
-\hline
-$\bullet$ & \texttt{00002022} & \verb|\bullet| \\
-\hline
-$\dots$ & \texttt{00002026} & \verb|\dots| \\
-\hline
-$\prime$ & \texttt{00002032} & \verb|\prime| \\
-\hline
-$\backprime$ & \texttt{00002035} & \verb|\backprime| \\
-\hline
-$\leftarrow$ & \texttt{00002190} & \verb|\leftarrow| \\
-\hline
-$\uparrow$ & \texttt{00002191} & \verb|\uparrow| \\
-\hline
-$\rightarrow$ & \texttt{00002192} & \verb|\rightarrow| \\
-\hline
-$\downarrow$ & \texttt{00002193} & \verb|\downarrow| \\
-\hline
-$\leftrightarrow$ & \texttt{00002194} & \verb|\leftrightarrow| \\
-\hline
-$\updownarrow$ & \texttt{00002195} & \verb|\updownarrow| \\
-\hline
-$\nwarrow$ & \texttt{00002196} & \verb|\nwarrow| \\
-\hline
-$\nearrow$ & \texttt{00002197} & \verb|\nearrow| \\
-\hline
-$\searrow$ & \texttt{00002198} & \verb|\searrow| \\
-\hline
-$\swarrow$ & \texttt{00002199} & \verb|\swarrow| \\
-\hline
-$\nleftarrow$ & \texttt{0000219A} & \verb|\nleftarrow| \\
-\hline
-$\nrightarrow$ & \texttt{0000219B} & \verb|\nrightarrow| \\
-\hline
-$\rightsquigarrow$ & \texttt{0000219D} & \verb|\rightsquigarrow| \\
-\hline
-$\twoheadleftarrow$ & \texttt{0000219E} & \verb|\twoheadleftarrow| \\
-\hline
-$\twoheadrightarrow$ & \texttt{000021A0} & \verb|\twoheadrightarrow| \\
-\hline
-$\leftarrowtail$ & \texttt{000021A2} & \verb|\leftarrowtail| \\
-\hline
-$\rightarrowtail$ & \texttt{000021A3} & \verb|\rightarrowtail| \\
-\hline
-$\mapsto$ & \texttt{000021A6} & \verb|\mapsto| \\
-\hline
-$\hookleftarrow$ & \texttt{000021A9} & \verb|\hookleftarrow| \\
-\hline
-$\hookrightarrow$ & \texttt{000021AA} & \verb|\hookrightarrow| \\
-\hline
-$\looparrowleft$ & \texttt{000021AB} & \verb|\looparrowleft| \\
-\hline
-$\looparrowright$ & \texttt{000021AC} & \verb|\looparrowright| \\
-\hline
-$\leftrightsquigarrow$ & \texttt{000021AD} & \verb|\leftrightsquigarrow| \\
-\hline
-$\nleftrightarrow$ & \texttt{000021AE} & \verb|\nleftrightarrow| \\
-\hline
-$\Lsh$ & \texttt{000021B0} & \verb|\Lsh| \\
-\hline
-$\Rsh$ & \texttt{000021B1} & \verb|\Rsh| \\
-\hline
-$\curvearrowleft$ & \texttt{000021B6} & \verb|\curvearrowleft| \\
-\hline
-$\curvearrowright$ & \texttt{000021B7} & \verb|\curvearrowright| \\
-\hline
-$\circlearrowleft$ & \texttt{000021BA} & \verb|\circlearrowleft| \\
-\hline
-$\circlearrowright$ & \texttt{000021BB} & \verb|\circlearrowright| \\
-\hline
-$\leftharpoonup$ & \texttt{000021BC} & \verb|\leftharpoonup| \\
-\hline
-$\leftharpoondown$ & \texttt{000021BD} & \verb|\leftharpoondown| \\
-\hline
-$\upharpoonright$ & \texttt{000021BE} & \verb|\upharpoonright| \\
-\hline
-$\upharpoonleft$ & \texttt{000021BF} & \verb|\upharpoonleft| \\
-\hline
-$\rightharpoonup$ & \texttt{000021C0} & \verb|\rightharpoonup| \\
-\hline
-$\rightharpoondown$ & \texttt{000021C1} & \verb|\rightharpoondown| \\
-\hline
-$\downharpoonright$ & \texttt{000021C2} & \verb|\downharpoonright| \\
-\hline
-$\downharpoonleft$ & \texttt{000021C3} & \verb|\downharpoonleft| \\
-\hline
-$\rightleftarrows$ & \texttt{000021C4} & \verb|\rightleftarrows| \\
-\hline
-$\leftrightarrows$ & \texttt{000021C6} & \verb|\leftrightarrows| \\
-\hline
-$\leftleftarrows$ & \texttt{000021C7} & \verb|\leftleftarrows| \\
-\hline
-$\upuparrows$ & \texttt{000021C8} & \verb|\upuparrows| \\
-\hline
-$\rightrightarrows$ & \texttt{000021C9} & \verb|\rightrightarrows| \\
-\hline
-$\downdownarrows$ & \texttt{000021CA} & \verb|\downdownarrows| \\
-\hline
-$\leftrightharpoons$ & \texttt{000021CB} & \verb|\leftrightharpoons| \\
-\hline
-$\rightleftharpoons$ & \texttt{000021CC} & \verb|\rightleftharpoons| \\
-\hline
-$\nLeftarrow$ & \texttt{000021CD} & \verb|\nLeftarrow| \\
-\hline
-$\nLeftrightarrow$ & \texttt{000021CE} & \verb|\nLeftrightarrow| \\
-\hline
-$\nRightarrow$ & \texttt{000021CF} & \verb|\nRightarrow| \\
-\hline
-$\Leftarrow$ & \texttt{000021D0} & \verb|\Leftarrow| \\
-\hline
-$\Uparrow$ & \texttt{000021D1} & \verb|\Uparrow| \\
-\hline
-$\Rightarrow$ & \texttt{000021D2} & \verb|\Rightarrow| \\
-\hline
-$\Downarrow$ & \texttt{000021D3} & \verb|\Downarrow| \\
-\hline
-$\Leftrightarrow$ & \texttt{000021D4} & \verb|\Leftrightarrow| \\
-\hline
-$\Updownarrow$ & \texttt{000021D5} & \verb|\Updownarrow| \\
-\hline
-$\Lleftarrow$ & \texttt{000021DA} & \verb|\Lleftarrow| \\
-\hline
-$\Rrightarrow$ & \texttt{000021DB} & \verb|\Rrightarrow| \\
-\hline
-$\leadsto$ & \texttt{000021DD} & \verb|\leadsto| \\
-\hline
-$\forall$ & \texttt{00002200} & \verb|\forall| \\
-\hline
-$\complement$ & \texttt{00002201} & \verb|\complement| \\
-\hline
-$\exists$ & \texttt{00002203} & \verb|\exists| \\
-\hline
-$\nexists$ & \texttt{00002204} & \verb|\nexists| \\
-\hline
-$\nabla$ & \texttt{00002207} & \verb|\nabla| \\
-\hline
-$\in$ & \texttt{00002208} & \verb|\in| \\
-\hline
-$\notin$ & \texttt{00002209} & \verb|\notin| \\
-\hline
-$\ni$ & \texttt{0000220B} & \verb|\ni| \\
-\hline
-$\prod$ & \texttt{0000220F} & \verb|\prod| \\
-\hline
-$\coprod$ & \texttt{00002210} & \verb|\coprod| \\
-\hline
-$\sum$ & \texttt{00002211} & \verb|\sum| \\
-\hline
-$\mp$ & \texttt{00002213} & \verb|\mp| \\
-\hline
-$\dotplus$ & \texttt{00002214} & \verb|\dotplus| \\
-\hline
-$\circ$ & \texttt{00002218} & \verb|\circ| \\
-\hline
-$\surd$ & \texttt{0000221A} & \verb|\surd| \\
-\hline
-$\propto$ & \texttt{0000221D} & \verb|\propto| \\
-\hline
-$\angle$ & \texttt{00002220} & \verb|\angle| \\
-\hline
-$\measuredangle$ & \texttt{00002221} & \verb|\measuredangle| \\
-\hline
-$\sphericalangle$ & \texttt{00002222} & \verb|\sphericalangle| \\
-\hline
-$\nmid$ & \texttt{00002224} & \verb|\nmid| \\
-\hline
-$\parallel$ & \texttt{00002225} & \verb|\parallel| \\
-\hline
-$\nparallel$ & \texttt{00002226} & \verb|\nparallel| \\
-\hline
-$\wedge$ & \texttt{00002227} & \verb|\wedge| \\
-\hline
-$\vee$ & \texttt{00002228} & \verb|\vee| \\
-\hline
-$\cap$ & \texttt{00002229} & \verb|\cap| \\
-\hline
-$\cup$ & \texttt{0000222A} & \verb|\cup| \\
-\hline
-$\int$ & \texttt{0000222B} & \verb|\int| \\
-\hline
-$\iint$ & \texttt{0000222C} & \verb|\iint| \\
-\hline
-$\iiint$ & \texttt{0000222D} & \verb|\iiint| \\
-\hline
-$\oint$ & \texttt{0000222E} & \verb|\oint| \\
-\hline
-$\therefore$ & \texttt{00002234} & \verb|\therefore| \\
-\hline
-$\because$ & \texttt{00002235} & \verb|\because| \\
-\hline
-$\sim$ & \texttt{0000223C} & \verb|\sim| \\
-\hline
-$\backsim$ & \texttt{0000223D} & \verb|\backsim| \\
-\hline
-$\wr$ & \texttt{00002240} & \verb|\wr| \\
-\hline
-$\nsim$ & \texttt{00002241} & \verb|\nsim| \\
-\hline
-$\eqsim$ & \texttt{00002242} & \verb|\eqsim| \\
-\hline
-$\simeq$ & \texttt{00002243} & \verb|\simeq| \\
-\hline
-$\cong$ & \texttt{00002245} & \verb|\cong| \\
-\hline
-$\ncong$ & \texttt{00002247} & \verb|\ncong| \\
-\hline
-$\approx$ & \texttt{00002248} & \verb|\approx| \\
-\hline
-$\approxeq$ & \texttt{0000224A} & \verb|\approxeq| \\
-\hline
-$\Bumpeq$ & \texttt{0000224E} & \verb|\Bumpeq| \\
-\hline
-$\bumpeq$ & \texttt{0000224F} & \verb|\bumpeq| \\
-\hline
-$\doteq$ & \texttt{00002250} & \verb|\doteq| \\
-\hline
-$\doteqdot$ & \texttt{00002251} & \verb|\doteqdot| \\
-\hline
-$\fallingdotseq$ & \texttt{00002252} & \verb|\fallingdotseq| \\
-\hline
-$\risingdotseq$ & \texttt{00002253} & \verb|\risingdotseq| \\
-\hline
-$\eqcirc$ & \texttt{00002256} & \verb|\eqcirc| \\
-\hline
-$\circeq$ & \texttt{00002257} & \verb|\circeq| \\
-\hline
-$\triangleq$ & \texttt{0000225C} & \verb|\triangleq| \\
-\hline
-$\neq$ & \texttt{00002260} & \verb|\neq| \\
-\hline
-$\equiv$ & \texttt{00002261} & \verb|\equiv| \\
-\hline
-$\leq$ & \texttt{00002264} & \verb|\leq| \\
-\hline
-$\geq$ & \texttt{00002265} & \verb|\geq| \\
-\hline
-$\leqq$ & \texttt{00002266} & \verb|\leqq| \\
-\hline
-$\geqq$ & \texttt{00002267} & \verb|\geqq| \\
-\hline
-$\lneqq$ & \texttt{00002268} & \verb|\lneqq| \\
-\hline
-$\gneqq$ & \texttt{00002269} & \verb|\gneqq| \\
-\hline
-$\ll$ & \texttt{0000226A} & \verb|\ll| \\
-\hline
-$\gg$ & \texttt{0000226B} & \verb|\gg| \\
-\hline
-$\between$ & \texttt{0000226C} & \verb|\between| \\
-\hline
-$\nless$ & \texttt{0000226E} & \verb|\nless| \\
-\hline
-$\ngtr$ & \texttt{0000226F} & \verb|\ngtr| \\
-\hline
-$\nleq$ & \texttt{00002270} & \verb|\nleq| \\
-\hline
-$\ngeq$ & \texttt{00002271} & \verb|\ngeq| \\
-\hline
-$\lesssim$ & \texttt{00002272} & \verb|\lesssim| \\
-\hline
-$\gtrsim$ & \texttt{00002273} & \verb|\gtrsim| \\
-\hline
-$\lessgtr$ & \texttt{00002276} & \verb|\lessgtr| \\
-\hline
-$\gtrless$ & \texttt{00002277} & \verb|\gtrless| \\
-\hline
-$\prec$ & \texttt{0000227A} & \verb|\prec| \\
-\hline
-$\succ$ & \texttt{0000227B} & \verb|\succ| \\
-\hline
-$\preccurlyeq$ & \texttt{0000227C} & \verb|\preccurlyeq| \\
-\hline
-$\succcurlyeq$ & \texttt{0000227D} & \verb|\succcurlyeq| \\
-\hline
-$\precsim$ & \texttt{0000227E} & \verb|\precsim| \\
-\hline
-$\succsim$ & \texttt{0000227F} & \verb|\succsim| \\
-\hline
-$\nprec$ & \texttt{00002280} & \verb|\nprec| \\
-\hline
-$\nsucc$ & \texttt{00002281} & \verb|\nsucc| \\
-\hline
-$\subset$ & \texttt{00002282} & \verb|\subset| \\
-\hline
-$\supset$ & \texttt{00002283} & \verb|\supset| \\
-\hline
-$\subseteq$ & \texttt{00002286} & \verb|\subseteq| \\
-\hline
-$\supseteq$ & \texttt{00002287} & \verb|\supseteq| \\
-\hline
-$\nsubseteq$ & \texttt{00002288} & \verb|\nsubseteq| \\
-\hline
-$\nsupseteq$ & \texttt{00002289} & \verb|\nsupseteq| \\
-\hline
-$\subsetneq$ & \texttt{0000228A} & \verb|\subsetneq| \\
-\hline
-$\supsetneq$ & \texttt{0000228B} & \verb|\supsetneq| \\
-\hline
-$\uplus$ & \texttt{0000228E} & \verb|\uplus| \\
-\hline
-$\sqsubset$ & \texttt{0000228F} & \verb|\sqsubset| \\
-\hline
-$\sqsupset$ & \texttt{00002290} & \verb|\sqsupset| \\
-\hline
-$\sqsubseteq$ & \texttt{00002291} & \verb|\sqsubseteq| \\
-\hline
-$\sqsupseteq$ & \texttt{00002292} & \verb|\sqsupseteq| \\
-\hline
-$\sqcap$ & \texttt{00002293} & \verb|\sqcap| \\
-\hline
-$\sqcup$ & \texttt{00002294} & \verb|\sqcup| \\
-\hline
-$\oplus$ & \texttt{00002295} & \verb|\oplus| \\
-\hline
-$\ominus$ & \texttt{00002296} & \verb|\ominus| \\
-\hline
-$\otimes$ & \texttt{00002297} & \verb|\otimes| \\
-\hline
-$\oslash$ & \texttt{00002298} & \verb|\oslash| \\
-\hline
-$\odot$ & \texttt{00002299} & \verb|\odot| \\
-\hline
-$\circledcirc$ & \texttt{0000229A} & \verb|\circledcirc| \\
-\hline
-$\circledast$ & \texttt{0000229B} & \verb|\circledast| \\
-\hline
-$\circleddash$ & \texttt{0000229D} & \verb|\circleddash| \\
-\hline
-$\boxplus$ & \texttt{0000229E} & \verb|\boxplus| \\
-\hline
-$\boxminus$ & \texttt{0000229F} & \verb|\boxminus| \\
-\hline
-$\boxtimes$ & \texttt{000022A0} & \verb|\boxtimes| \\
-\hline
-$\boxdot$ & \texttt{000022A1} & \verb|\boxdot| \\
-\hline
-$\vdash$ & \texttt{000022A2} & \verb|\vdash| \\
-\hline
-$\dashv$ & \texttt{000022A3} & \verb|\dashv| \\
-\hline
-$\top$ & \texttt{000022A4} & \verb|\top| \\
-\hline
-$\bot$ & \texttt{000022A5} & \verb|\bot| \\
-\hline
-$\models$ & \texttt{000022A7} & \verb|\models| \\
-\hline
-$\vDash$ & \texttt{000022A8} & \verb|\vDash| \\
-\hline
-$\Vdash$ & \texttt{000022A9} & \verb|\Vdash| \\
-\hline
-$\Vvdash$ & \texttt{000022AA} & \verb|\Vvdash| \\
-\hline
-$\nvdash$ & \texttt{000022AC} & \verb|\nvdash| \\
-\hline
-$\nvDash$ & \texttt{000022AD} & \verb|\nvDash| \\
-\hline
-$\nVdash$ & \texttt{000022AE} & \verb|\nVdash| \\
-\hline
-$\nVDash$ & \texttt{000022AF} & \verb|\nVDash| \\
-\hline
-$\lhd$ & \texttt{000022B2} & \verb|\lhd| \\
-\hline
-$\rhd$ & \texttt{000022B3} & \verb|\rhd| \\
-\hline
-$\unlhd$ & \texttt{000022B4} & \verb|\unlhd| \\
-\hline
-$\unrhd$ & \texttt{000022B5} & \verb|\unrhd| \\
-\hline
-$\multimap$ & \texttt{000022B8} & \verb|\multimap| \\
-\hline
-$\intercal$ & \texttt{000022BA} & \verb|\intercal| \\
-\hline
-$\veebar$ & \texttt{000022BB} & \verb|\veebar| \\
-\hline
-$\bigwedge$ & \texttt{000022C0} & \verb|\bigwedge| \\
-\hline
-$\bigvee$ & \texttt{000022C1} & \verb|\bigvee| \\
-\hline
-$\bigcap$ & \texttt{000022C2} & \verb|\bigcap| \\
-\hline
-$\bigcup$ & \texttt{000022C3} & \verb|\bigcup| \\
-\hline
-$\diamond$ & \texttt{000022C4} & \verb|\diamond| \\
-\hline
-$\cdot$ & \texttt{000022C5} & \verb|\cdot| \\
-\hline
-$\star$ & \texttt{000022C6} & \verb|\star| \\
-\hline
-$\divideontimes$ & \texttt{000022C7} & \verb|\divideontimes| \\
-\hline
-$\bowtie$ & \texttt{000022C8} & \verb|\bowtie| \\
-\hline
-$\ltimes$ & \texttt{000022C9} & \verb|\ltimes| \\
-\hline
-$\rtimes$ & \texttt{000022CA} & \verb|\rtimes| \\
-\hline
-$\leftthreetimes$ & \texttt{000022CB} & \verb|\leftthreetimes| \\
-\hline
-$\rightthreetimes$ & \texttt{000022CC} & \verb|\rightthreetimes| \\
-\hline
-$\backsimeq$ & \texttt{000022CD} & \verb|\backsimeq| \\
-\hline
-$\curlyvee$ & \texttt{000022CE} & \verb|\curlyvee| \\
-\hline
-$\curlywedge$ & \texttt{000022CF} & \verb|\curlywedge| \\
-\hline
-$\Subset$ & \texttt{000022D0} & \verb|\Subset| \\
-\hline
-$\Supset$ & \texttt{000022D1} & \verb|\Supset| \\
-\hline
-$\Cap$ & \texttt{000022D2} & \verb|\Cap| \\
-\hline
-$\Cup$ & \texttt{000022D3} & \verb|\Cup| \\
-\hline
-$\pitchfork$ & \texttt{000022D4} & \verb|\pitchfork| \\
-\hline
-$\lessdot$ & \texttt{000022D6} & \verb|\lessdot| \\
-\hline
-$\gtrdot$ & \texttt{000022D7} & \verb|\gtrdot| \\
-\hline
-$\lll$ & \texttt{000022D8} & \verb|\lll| \\
-\hline
-$\ggg$ & \texttt{000022D9} & \verb|\ggg| \\
-\hline
-$\lesseqgtr$ & \texttt{000022DA} & \verb|\lesseqgtr| \\
-\hline
-$\gtreqless$ & \texttt{000022DB} & \verb|\gtreqless| \\
-\hline
-$\curlyeqprec$ & \texttt{000022DE} & \verb|\curlyeqprec| \\
-\hline
-$\curlyeqsucc$ & \texttt{000022DF} & \verb|\curlyeqsucc| \\
-\hline
-$\lnsim$ & \texttt{000022E6} & \verb|\lnsim| \\
-\hline
-$\gnsim$ & \texttt{000022E7} & \verb|\gnsim| \\
-\hline
-$\precnsim$ & \texttt{000022E8} & \verb|\precnsim| \\
-\hline
-$\succnsim$ & \texttt{000022E9} & \verb|\succnsim| \\
-\hline
-$\ntriangleleft$ & \texttt{000022EA} & \verb|\ntriangleleft| \\
-\hline
-$\ntriangleright$ & \texttt{000022EB} & \verb|\ntriangleright| \\
-\hline
-$\ntrianglelefteq$ & \texttt{000022EC} & \verb|\ntrianglelefteq| \\
-\hline
-$\ntrianglerighteq$ & \texttt{000022ED} & \verb|\ntrianglerighteq| \\
-\hline
-$\vdots$ & \texttt{000022EE} & \verb|\vdots| \\
-\hline
-$\cdots$ & \texttt{000022EF} & \verb|\cdots| \\
-\hline
-$\ddots$ & \texttt{000022F1} & \verb|\ddots| \\
-\hline
-$\barwedge$ & \texttt{00002305} & \verb|\barwedge| \\
-\hline
-$\doublebarwedge$ & \texttt{00002306} & \verb|\doublebarwedge| \\
-\hline
-$\lceil$ & \texttt{00002308} & \verb|\lceil| \\
-\hline
-$\rceil$ & \texttt{00002309} & \verb|\rceil| \\
-\hline
-$\lfloor$ & \texttt{0000230A} & \verb|\lfloor| \\
-\hline
-$\rfloor$ & \texttt{0000230B} & \verb|\rfloor| \\
-\hline
-$\ulcorner$ & \texttt{0000231C} & \verb|\ulcorner| \\
-\hline
-$\urcorner$ & \texttt{0000231D} & \verb|\urcorner| \\
-\hline
-$\llcorner$ & \texttt{0000231E} & \verb|\llcorner| \\
-\hline
-$\lrcorner$ & \texttt{0000231F} & \verb|\lrcorner| \\
-\hline
-$\frown$ & \texttt{00002322} & \verb|\frown| \\
-\hline
-$\smile$ & \texttt{00002323} & \verb|\smile| \\
-\hline
-$\langle$ & \texttt{000027E8} & \verb|\langle| \\
-\hline
-$\rangle$ & \texttt{000027E9} & \verb|\rangle| \\
-\hline
-$\square$ & \texttt{000025A1} & \verb|\square| \\
-\hline
-$\triangle$ & \texttt{000025B3} & \verb|\triangle| \\
-\hline
-$\blacktriangle$ & \texttt{000025B4} & \verb|\blacktriangle| \\
-\hline
-$\vartriangle$ & \texttt{000025B5} & \verb|\vartriangle| \\
-\hline
-$\blacktriangleright$ & \texttt{000025B6} & \verb|\blacktriangleright| \\
-\hline
-$\triangleright$ & \texttt{000025B9} & \verb|\triangleright| \\
-\hline
-$\bigtriangledown$ & \texttt{000025BD} & \verb|\bigtriangledown| \\
-\hline
-$\blacktriangledown$ & \texttt{000025BE} & \verb|\blacktriangledown| \\
-\hline
-$\triangledown$ & \texttt{000025BF} & \verb|\triangledown| \\
-\hline
-$\blacktriangleleft$ & \texttt{000025C0} & \verb|\blacktriangleleft| \\
-\hline
-$\triangleleft$ & \texttt{000025C3} & \verb|\triangleleft| \\
-\hline
-$\lozenge$ & \texttt{000025CA} & \verb|\lozenge| \\
-\hline
-$\bigcirc$ & \texttt{000025EF} & \verb|\bigcirc| \\
-\hline
-$\blacksquare$ & \texttt{000025FC} & \verb|\blacksquare| \\
-\hline
-$\bigstar$ & \texttt{00002605} & \verb|\bigstar| \\
-\hline
-$\spadesuit$ & \texttt{00002660} & \verb|\spadesuit| \\
-\hline
-$\clubsuit$ & \texttt{00002663} & \verb|\clubsuit| \\
-\hline
-$\heartsuit$ & \texttt{00002665} & \verb|\heartsuit| \\
-\hline
-$\diamondsuit$ & \texttt{00002666} & \verb|\diamondsuit| \\
-\hline
-$\flat$ & \texttt{0000266D} & \verb|\flat| \\
-\hline
-$\natural$ & \texttt{0000266E} & \verb|\natural| \\
-\hline
-$\sharp$ & \texttt{0000266F} & \verb|\sharp| \\
-\hline
-$\checkmark$ & \texttt{00002713} & \verb|\checkmark| \\
-\hline
-$\dashleftarrow$ & \texttt{0000290E} & \verb|\dashleftarrow| \\
-\hline
-$\dashrightarrow$ & \texttt{0000290F} & \verb|\dashrightarrow| \\
-\hline
-$\blacklozenge$ & \texttt{000029EB} & \verb|\blacklozenge| \\
-\hline
-$\bigodot$ & \texttt{00002A00} & \verb|\bigodot| \\
-\hline
-$\bigoplus$ & \texttt{00002A01} & \verb|\bigoplus| \\
-\hline
-$\bigotimes$ & \texttt{00002A02} & \verb|\bigotimes| \\
-\hline
-$\biguplus$ & \texttt{00002A04} & \verb|\biguplus| \\
-\hline
-$\bigsqcup$ & \texttt{00002A06} & \verb|\bigsqcup| \\
-\hline
-$\iiiint$ & \texttt{00002A0C} & \verb|\iiiint| \\
-\hline
-$\amalg$ & \texttt{00002A3F} & \verb|\amalg| \\
-\hline
-$\leqslant$ & \texttt{00002A7D} & \verb|\leqslant| \\
-\hline
-$\geqslant$ & \texttt{00002A7E} & \verb|\geqslant| \\
-\hline
-$\lessapprox$ & \texttt{00002A85} & \verb|\lessapprox| \\
-\hline
-$\gtrapprox$ & \texttt{00002A86} & \verb|\gtrapprox| \\
-\hline
-$\lnapprox$ & \texttt{00002A89} & \verb|\lnapprox| \\
-\hline
-$\gnapprox$ & \texttt{00002A8A} & \verb|\gnapprox| \\
-\hline
-$\lesseqqgtr$ & \texttt{00002A8B} & \verb|\lesseqqgtr| \\
-\hline
-$\gtreqqless$ & \texttt{00002A8C} & \verb|\gtreqqless| \\
-\hline
-$\eqslantless$ & \texttt{00002A95} & \verb|\eqslantless| \\
-\hline
-$\eqslantgtr$ & \texttt{00002A96} & \verb|\eqslantgtr| \\
-\hline
-$\preceq$ & \texttt{00002AAF} & \verb|\preceq| \\
-\hline
-$\succeq$ & \texttt{00002AB0} & \verb|\succeq| \\
-\hline
-$\precneqq$ & \texttt{00002AB5} & \verb|\precneqq| \\
-\hline
-$\succneqq$ & \texttt{00002AB6} & \verb|\succneqq| \\
-\hline
-$\precapprox$ & \texttt{00002AB7} & \verb|\precapprox| \\
-\hline
-$\succapprox$ & \texttt{00002AB8} & \verb|\succapprox| \\
-\hline
-$\precnapprox$ & \texttt{00002AB9} & \verb|\precnapprox| \\
-\hline
-$\succnapprox$ & \texttt{00002ABA} & \verb|\succnapprox| \\
-\hline
-$\subseteqq$ & \texttt{00002AC5} & \verb|\subseteqq| \\
-\hline
-$\supseteqq$ & \texttt{00002AC6} & \verb|\supseteqq| \\
-\hline
-$\subsetneqq$ & \texttt{00002ACB} & \verb|\subsetneqq| \\
-\hline
-$\supsetneqq$ & \texttt{00002ACC} & \verb|\supsetneqq| \\
-\hline
-\end{longtable}
diff --git a/blahtexml/README b/blahtexml/README
deleted file mode 100644
index ee20840..0000000
--- a/blahtexml/README
+++ /dev/null
@@ -1,33 +0,0 @@
-Blahtex(ml) version 0.5
-======================================
-
-Blahtex is licensed under the GNU General Public License.
-See the file "GNU-GPL" and the source code for more details.
-
-Brief build instructions (more details in the manual): run one of
-
- make linux
- make mac
-
----
-
-Blahtexml is a simple extension of blahtex to allow it to process an entire
-XML file, and to convert each blahtex equation in it into MathML equations.
-Blahtexml is a source-level extension of blahtex, which means that anything
-that works with Blahtex also works with blahtexml.
-
-Blahtexml requires Xerces-C 2.x to be installed. If you do not have Xerces-C
-installed, you will not be able to build blahtexml (but you will still be able
-to builld and use blahtex of course).
-
-Blahtexml is also licensed under the GNU General Public License.
-See the file "GNU-GPL" and the source code for more details.
-
-For more information, see
-
- http://gva.noekeon.org/blahtexml/
-
-Brief build instructions (more details in the manual): run one of
-
- make blahtexml-linux
- make blahtexml-mac
diff --git a/blahtexml/example1.xml b/blahtexml/example1.xml
deleted file mode 100644
index 0a50767..0000000
--- a/blahtexml/example1.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0"?>
-<equations xmlns:b="http://gva.noekeon.org/blahtexml">
- <equation b:inline="x+y"/>
- <equation b:block="\exp(-\gamma x)"/>
-</equations>
diff --git a/blahtexml/example2.xml b/blahtexml/example2.xml
deleted file mode 100644
index 5fb3fcb..0000000
--- a/blahtexml/example2.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <msqrt b:m="x+y"/>
- </math>
-</root>
diff --git a/blahtexml/example3.xml b/blahtexml/example3.xml
deleted file mode 100644
index 8c3a66b..0000000
--- a/blahtexml/example3.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <eq b:inline="x"/>
- <eq xmlns:m="http://www.w3.org/1998/Math/MathML" b:inline="x"/>
-</root>
diff --git a/blahtexml/example4.xml b/blahtexml/example4.xml
deleted file mode 100644
index 1a76df2..0000000
--- a/blahtexml/example4.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <eq b:inline="\qwerty"/>
-</root>
diff --git a/blahtexml/logo.png b/blahtexml/logo.png
deleted file mode 100644
index 9443084..0000000
--- a/blahtexml/logo.png
+++ /dev/null
Binary files differ
diff --git a/blahtexml/makefile b/blahtexml/makefile
deleted file mode 100644
index fb3c549..0000000
--- a/blahtexml/makefile
+++ /dev/null
@@ -1,145 +0,0 @@
-#
-# makefile
-#
-# blahtex (version 0.4.4)
-# a TeX to MathML converter designed with MediaWiki in mind
-# Copyright (C) 2006, David Harvey
-#
-# blahtexml (version 0.5)
-# Copyright (C) 2007-2008, Gilles Van Assche
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-
-SOURCES = \
- source/main.cpp \
- source/mainPng.cpp \
- source/md5.c \
- source/md5Wrapper.cpp \
- source/Messages.cpp \
- source/UnicodeConverter.cpp \
- source/BlahtexCore/InputSymbolTranslation.cpp \
- source/BlahtexCore/Interface.cpp \
- source/BlahtexCore/LayoutTree.cpp \
- source/BlahtexCore/MacroProcessor.cpp \
- source/BlahtexCore/Manager.cpp \
- source/BlahtexCore/Parser.cpp \
- source/BlahtexCore/ParseTree1.cpp \
- source/BlahtexCore/ParseTree2.cpp \
- source/BlahtexCore/ParseTree3.cpp \
- source/BlahtexCore/MathmlNode.cpp \
- source/BlahtexCore/XmlEncode.cpp
-
-SOURCES_XMLIN = $(SOURCES) \
- source/BlahtexXMLin/AttributesImpl.cpp \
- source/BlahtexXMLin/BlahtexFilter.cpp \
- source/BlahtexXMLin/SAX2Output.cpp \
- source/BlahtexXMLin/XercesString.cpp
-
-HEADERS = \
- source/mainPng.h \
- source/md5.h \
- source/md5Wrapper.h \
- source/UnicodeConverter.h \
- source/BlahtexCore/InputSymbolTranslation.h \
- source/BlahtexCore/Interface.h \
- source/BlahtexCore/LayoutTree.h \
- source/BlahtexCore/MacroProcessor.h \
- source/BlahtexCore/Manager.h \
- source/BlahtexCore/Misc.h \
- source/BlahtexCore/Parser.h \
- source/BlahtexCore/ParseTree.h \
- source/BlahtexCore/MathmlNode.h \
- source/BlahtexCore/XmlEncode.h
-
-HEADERS_XMLIN = $(HEADERS) \
- source/BlahtexXMLin/AttributesImpl.h \
- source/BlahtexXMLin/BlahtexFilter.h \
- source/BlahtexXMLin/SAX2Output.h \
- source/BlahtexXMLin/XercesString.h
-
-BINDIR = bin-blahtex
-
-$(BINDIR):
- mkdir -p $(BINDIR)
-
-BINDIR_XMLIN = bin-blahtexml
-
-$(BINDIR_XMLIN):
- mkdir -p $(BINDIR_XMLIN)
-
-OBJECTS = $(addprefix $(BINDIR)/, $(notdir $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))))
-
-OBJECTS_XMLIN = $(addprefix $(BINDIR_XMLIN)/, $(notdir $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES_XMLIN)))))
-
-source/BlahtexCore/InputSymbolTranslation.inc: source/BlahtexCore/InputSymbolTranslation.xml
- xsltproc -o $@ source/BlahtexCore/ISTtoCpp.xslt $<
-
-source/BlahtexCore/InputSymbolTranslation.cpp: source/BlahtexCore/InputSymbolTranslation.inc
-
-$(BINDIR)/InputSymbolTranslation.o: InputSymbolTranslation.cpp InputSymbolTranslation.inc
-
-$(BINDIR_XMLIN)/InputSymbolTranslation.o: InputSymbolTranslation.cpp InputSymbolTranslation.inc
-
-#default targets are still blahtex (not blahtexml)
-linux: blahtex-linux
-mac: blahtex-mac
-
-CFLAGS = -O2
-
-VPATH = source:source/BlahtexCore:source/BlahtexXMLin
-
-INCLUDES=-I. -Isource -Isource/BlahtexCore -Isource/BlahtexXMLin
-
-$(BINDIR)/%.o:%.cpp
- $(CXX) $(INCLUDES) $(CFLAGS) -c $< -o $@
-
-$(BINDIR)/%.o:%.c
- $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
-
-$(BINDIR_XMLIN)/%.o:%.cpp
- $(CXX) $(INCLUDES) $(CFLAGS) -DBLAHTEXML_USING_XERCES -c $< -o $@
-
-$(BINDIR_XMLIN)/%.o:%.c
- $(CC) $(INCLUDES) $(CFLAGS) -DBLAHTEXML_USING_XERCES -c $< -o $@
-
-blahtex-linux: $(BINDIR) $(OBJECTS) $(HEADERS)
- $(CXX) $(CFLAGS) -o blahtex $(OBJECTS)
-
-blahtex-mac: $(BINDIR) $(OBJECTS) $(HEADERS)
- $(CXX) $(CFLAGS) -o blahtex -liconv $(OBJECTS)
-
-blahtexml-linux: $(BINDIR_XMLIN) $(OBJECTS_XMLIN) $(HEADERS_XMLIN)
- $(CXX) $(CFLAGS) -o blahtexml $(OBJECTS_XMLIN) -lxerces-c
-
-blahtexml-mac: $(BINDIR_XMLIN) $(OBJECTS_XMLIN) $(HEADERS_XMLIN)
- $(CXX) $(CFLAGS) -o blahtexml -liconv $(OBJECTS_XMLIN) -lxerces-c
-
-clean:
- rm -f blahtex $(OBJECTS) blahtexml $(OBJECTS_XMLIN)
-
-# Documentation
-
-doc: manual.pdf
-
-manual.pdf: manual.tex InputSymbolTranslation.tex
- pdflatex manual
- pdflatex manual
-
-InputSymbolTranslation.tex: source/BlahtexCore/InputSymbolTranslation.xml
- xsltproc -o $@ ISTtoTeX.xslt $<
-
-########## end of file ##########
diff --git a/blahtexml/manual.tex b/blahtexml/manual.tex
deleted file mode 100644
index 101b503..0000000
--- a/blahtexml/manual.tex
+++ /dev/null
@@ -1,1857 +0,0 @@
-% blahtex manual
-
-% Copyright (c) 2006, David Harvey
-
-% Copyright (C) 2007-2008, Gilles Van Assche
-
-% Permission is granted to copy, distribute and/or modify this document
-% under the terms of the GNU Free Documentation License, Version 1.2
-% or any later version published by the Free Software Foundation;
-% with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
-% Texts. A copy of the license is included in the file GNU-FDL.
-
-\documentclass{article}
-\usepackage{html} % latex2html package
-\usepackage{ucs} % for \unichar
-\usepackage{graphicx}
-\usepackage{longtable}
-\usepackage{amsmath, amssymb}
-
-\newcommand{\blahtexversion}{0.5}
-\newcommand{\texcommand}[1]{\textbackslash{}#1}
-\newcommand{\mylink}[1]{\htmladdnormallink{\texttt{#1}}{#1}}
-
-% Macros used for building tables of commands:
-\newcommand{\spacer}{\,\,\, \hfil}
-\newcommand{\lastspacer}{\hfill\hfill\hfill}
-
-
-
-\newenvironment{mylist}{\begin{quote}}{\end{quote}}
-
-
-\begin{document}
-
-\thispagestyle{empty}
-
-\begin{center}
-\includegraphics[width=10cm]{logo.png}
-
-\vskip 1.6cm
-
-{\Large blahtex and blahtexml version \blahtexversion{} manual}
-
-\vskip 0.8cm
-
-{\Large David Harvey} and {\Large Gilles Van Assche}
-\end{center}
-
-\vskip 1.6cm
-
-{\footnotesize
-Copyright (c) 2006, David Harvey. Permission is granted to copy, distribute
-and/or modify this document under the terms of the
-\htmladdnormallink{GNU Free Documentation License}{http://www.gnu.org/copyleft/fdl.html},
-Version 1.2 or any later version published by the Free Software Foundation;
-with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
-A copy of the license, and the \LaTeX{} source for this manual, is included
-in the blahtex source distribution.
-}
-
-{\footnotesize
-Copyright (c) 2007-2008, Gilles Van Assche. Permission is granted to copy, distribute and/or modify this document under the terms of the
-\htmladdnormallink{GNU Free Documentation License}{http://www.gnu.org/copyleft/fdl.html},
-Version 1.2 or any later version published by the Free Software Foundation;
-with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
-A copy of the license, and the \LaTeX{} source for this manual, is included
-in the blahtex source distribution.
-}
-
-\section{Introduction}
-
-\begin{latexonly}
-This is the manual for blahtex version \blahtexversion. The most up-to-date information about blahtex, including
-an online HTML version of this document, is available at \texttt{www.blahtex.org}.
-
-This manual also contains information regarding the blahtex extension \emph{blahtexml}, which converts
-all equations from an XML file given at input.
-The most up-to-date information about blahtexml is available at \texttt{gva.noekeon.org/blahtexml}.
-\end{latexonly}
-
-\begin{htmlonly}
-This is the manual for blahtex version \blahtexversion. The most up-to-date information about blahtex, including
-a PDF version of this document, is available at \htmladdnormallink{www.blahtex.org}{http://www.blahtex.org/}.
-
-This manual also contains information regarding the blahtex extension \emph{blahtexml}, which converts
-all equations from an XML file given at input.
-The most up-to-date information about blahtexml is available at
-\htmladdnormallink{gva.noekeon.org/blahtexml}{http://gva.noekeon.org/blahtexml}.
-\end{htmlonly}
-
-\subsection{How this document is organised}
-
-\begin{itemize}
-\item {\bf What blahtex can handle} (Section \ref{sec:handle}) explains what kind of \TeX{} input blahtex can cope with, and how it differs from texvc.
-\item {\bf The blahtex command-line application} (Section \ref{sec:command-line}) describes how to compile, install, and run the blahtex command-line application, and how to interpret its output. This will be of interest to developers who would like a simple way to incorporate blahtex into their project.
-\item {\bf The blahtexml command-line application} (Section \ref{sec:blahtexml}) describes how to compile, install, and run the blahtexml command-line application.
-\item {\bf The blahtex API} (Section \ref{sec:API}) describes how to link blahtex directly into your code, which might give better performance in some environments.
-\item {\bf History/changelog} (Section \ref{sec:history}) summarises previous versions and changes.
-\end{itemize}
-
-\subsection{What is blahtex?}
-
-Blahtex is a free software tool/library that translates \TeX{} markup into MathML markup. It is also capable of generating PNG format images, using some external tools (\LaTeX{} and \texttt{dvipng}).
-
-Blahtex is \emph{not} designed to process entire \TeX{} documents. Rather, it focuses on the mathematical capabilities of the \TeX{} language, processing only a single equation at a time. It is designed to provide mathematical support to a larger document markup system. Currently, the main target platform is \htmladdnormallink{MediaWiki}{http://www.mediawiki.org/wiki/MediaWiki} --- the software that powers \htmladdnormallink{Wikipedia}{http://www.wikipedia.org/} and many other wikis --- but blahtex has been designed with flexibility of integration in mind.
-
-Blahtex concentrates on matching the \emph{appearance} of \TeX{} output, as far as this is possible given the fonts available to the MathML renderer. It only outputs Presentation MathML, not Content MathML. Blahtex is aware of at least some of \TeX{}'s rules concerning spacing and fonts. For example, it knows about `atom flavours' (like ord, rel, op, etc) and \TeX{}'s algorithms for determining the amount of space between them.
-
-Blahtex implements some subset of \TeX{}, \LaTeX{} and AMS-\LaTeX{}, including almost all of the symbols. A complete list of supported and quasi-supported commands can be found in Section \ref{sec:handle}.
-
-Blahtex is internally Unicode-based. Non-ASCII characters may be used in text mode (e.g.~within \texttt{\texcommand{text}\{...\}} blocks). These will be handled correctly for MathML output. For PNG output, blahtex can currently handle some extended Latin characters (see Section \ref{sec:non-ascii-characters}), and there is experimental support for Cyrillic and Japanese. More scripts may be added in the future.
-
-Blahtex is open source software. The source code is released under the \htmladdnormallink{GNU GPL}{http://www.gnu.org/copyleft/gpl.html} (General Public License). This means that although the source is copyrighted, you may modify it, use it in your own programs, or even sell it, as long as you adhere to the GPL.
-
-Blahtex is written in C++. It compiles on Linux and Mac OS X systems, but probably is not as portable as it could be (see Section \ref{sec:prerequisites}).
-
-Blahtex obviously owes a lot to \htmladdnormallink{texvc}{http://en.wikipedia.org/wiki/texvc}, the software presently used by MediaWiki to handle \TeX{} input, written by Tomasz Wegrzanowski.
-
-Blahtex is a work in progress. I hereby solicit {\bf your feedback}, to help me improve it as much as possible.
-
-(It has not escaped the author's attention that every paragraph of this section either begins or ends with the word `blahtex'.)
-
-\subsection{The origin of the name `blahtex'}
-
-{In the beginning there was \TeX{}. Later, we also met \LaTeX{}, and ConTeXt, \small teTeX, \footnotesize MiKTeX, blah \scriptsize blah \tiny blah...}
-
-\subsection{Other converters}
-
-There are a variety of other \TeX{}-to-MathML converters available. The MathML home page (\mylink{http://www.w3.org/Math/}) has quite a long list. Here are a few that have online demos available:
-
-\begin{itemize}
-\item {\bf itex2mml}: \\
-\mylink{http://pear.math.pitt.edu/mathzilla/itex2mml.html}
-\item {\bf TexToMathML}: \\
-\mylink{http://www.orcca.on.ca/MathML/texmml/textomml.html}
-\item {\bf TtM}: \\
-\mylink{http://hutchinson.belmont.ma.us/tth/mml/}
-\end{itemize}
-
-They have their pros and cons, as does blahtex. I happen to think blahtex is rather good, but of course I am biased :-) Feel free to disagree. Please let me know if you think blahtex is no good, and \emph{why} it's no good, so that maybe I can fix it. (Also, let me know if you think it's great!)
-
-\subsection{Acknowledgements}
-
-Thanks to the crew at Wikipedia, for pioneering such a fabulous resource, especially the regulars at WikiProject Mathematics.
-
-Thanks to Jitse Niesen for his ongoing work on integrating blahtex into MediaWiki (currently on show at \htmladdnormallink{\texttt{wiki.blahtex.org}}{http://wiki.blahtex.org/}), and for generally being very supportive of this project.
-
-\section{What blahtex can handle}\label{sec:handle}
-
-Blahtex supports some subset of \TeX{}, \LaTeX{} and AMS-\LaTeX{}. This section gives a complete list of supported commands, together with some comments where the support is known to be incomplete.
-
-\subsection{Macros}
-
-Blahtex supports \texttt{\texcommand{newcommand}}, including arguments (but not \emph{optional} arguments).
-
-Blahtex protects against a malicious user eliciting exponential time via recursive macros, by imposing a hard limit on the amount of macro processing that can occur.
-
-Note that \texttt{\texcommand{newcommand}} is \emph{not} local to blocks, as is the case in \TeX{}. For example, \texttt{\{\texcommand{newcommand}\{\texcommand{abc}\}\{xyz\}\} \texcommand{abc}} is legal in blahtex, but not in \TeX{}, because \TeX{} only remembers the definition of \texttt{\texcommand{abc}} within the outermost \texttt{\{...\}} block.
-
-Clearly \texttt{\texcommand{newcommand}} is not very useful for an individual equation. In a larger document markup system, a good approach might be to provide a facility for specifying a document-wide collection of macros, and the software would automatically append the relevant \texttt{\texcommand{newcommand}}s to the beginning of each equation in which a macro need to be available. It is not clear at this stage whether this model would be technically feasible in MediaWiki.
-
-\subsection{Environments}
-
-\texttt{\texcommand{begin}\{XYZ\} ... \texcommand{end}\{XYZ\}}, where \texttt{XYZ} is one of:
-
-\begin{mylist}
-\texttt{matrix} \spacer
-\texttt{pmatrix} \spacer
-\texttt{bmatrix} \spacer
-\texttt{Bmatrix} \spacer
-\texttt{vmatrix} \spacer
-\texttt{Vmatrix} \spacer
-\texttt{cases} \spacer
-\texttt{aligned} \spacer
-\texttt{smallmatrix} \lastspacer
-\end{mylist}
-
-\subsection{Miscellaneous}
-
-\begin{mylist}
-\texttt{\texcommand{sqrt}} (including with optional argument) \spacer
-\texttt{\texcommand{substack}} \spacer
-\texttt{\texcommand{overset}} \spacer
-\texttt{\texcommand{underset}} \spacer
-\texttt{\texcommand{not}} \lastspacer
-\end{mylist}
-
-When it encounters \texttt{\texcommand{not}}, blahtex will attempt to find a MathML character that directly corresponds to the negation of any operator appearing after \texttt{\texcommand{not}}. Failing that, it will try to draw an ordinary slash in the right place, using the MathML \texttt{<mpadded>} element to fudge things.
-
-\subsection{Colour}
-
-Blahtex supports \texttt{\texcommand{color}\{X\}}, where \texttt{X} is one of the following named colours:
-
-\begin{mylist}
-\texttt{GreenYellow} \spacer
-\texttt{Yellow} \spacer
-\texttt{yellow} \spacer
-\texttt{Goldenrod} \spacer
-\texttt{Dandelion} \spacer
-\texttt{Apricot} \spacer
-\texttt{Peach} \spacer
-\texttt{Melon} \spacer
-\texttt{YellowOrange} \spacer
-\texttt{Orange} \spacer
-\texttt{BurntOrange} \spacer
-\texttt{Bittersweet} \spacer
-\texttt{RedOrange} \spacer
-\texttt{Mahogany} \spacer
-\texttt{Maroon} \spacer
-\texttt{BrickRed} \spacer
-\texttt{Red} \spacer
-\texttt{red} \spacer
-\texttt{OrangeRed} \spacer
-\texttt{RubineRed} \spacer
-\texttt{WildStrawberry} \spacer
-\texttt{Salmon} \spacer
-\texttt{CarnationPink} \spacer
-\texttt{Magenta} \spacer
-\texttt{magenta} \spacer
-\texttt{VioletRed} \spacer
-\texttt{Rhodamine} \spacer
-\texttt{Mulberry} \spacer
-\texttt{RedViolet} \spacer
-\texttt{Fuchsia} \spacer
-\texttt{Lavender} \spacer
-\texttt{Thistle} \spacer
-\texttt{Orchid} \spacer
-\texttt{DarkOrchid} \spacer
-\texttt{Purple} \spacer
-\texttt{Plum} \spacer
-\texttt{Violet} \spacer
-\texttt{RoyalPurple} \spacer
-\texttt{BlueViolet} \spacer
-\texttt{Periwinkle} \spacer
-\texttt{CadetBlue} \spacer
-\texttt{CornflowerBlue} \spacer
-\texttt{MidnightBlue} \spacer
-\texttt{NavyBlue} \spacer
-\texttt{RoyalBlue} \spacer
-\texttt{Blue} \spacer
-\texttt{blue} \spacer
-\texttt{Cerulean} \spacer
-\texttt{Cyan} \spacer
-\texttt{cyan} \spacer
-\texttt{ProcessBlue} \spacer
-\texttt{SkyBlue} \spacer
-\texttt{Turquoise} \spacer
-\texttt{TealBlue} \spacer
-\texttt{Aquamarine} \spacer
-\texttt{BlueGreen} \spacer
-\texttt{Emerald} \spacer
-\texttt{JungleGreen} \spacer
-\texttt{SeaGreen} \spacer
-\texttt{Green} \spacer
-\texttt{green} \spacer
-\texttt{ForestGreen} \spacer
-\texttt{PineGreen} \spacer
-\texttt{LimeGreen} \spacer
-\texttt{YellowGreen} \spacer
-\texttt{SpringGreen} \spacer
-\texttt{OliveGreen} \spacer
-\texttt{RawSienna} \spacer
-\texttt{Sepia} \spacer
-\texttt{Brown} \spacer
-\texttt{Tan} \spacer
-\texttt{Gray} \spacer
-\texttt{Black} \spacer
-\texttt{black} \spacer
-\texttt{White} \spacer
-\texttt{white} \lastspacer
-\end{mylist}
-
-At this time there is no support for colour models, so you can't do things like \texttt{\texcommand{color}[rgb]\{0.2,0.3,0.4\}}.
-
-There are some subtle bugs in the parsing of \texttt{\texcommand{color}} commands. Things like \texttt{\texcommand{overset}\{a\}\{\texcommand{color}\{blue\}x\}} are not legal in \LaTeX, for reasons I haven't yet fully investigated; blahtex still accepts them.
-
-\subsection{Text commands}
-
-\begin{mylist}
-\texttt{\texcommand{text}} \spacer
-\texttt{\texcommand{textit}} \spacer
-\texttt{\texcommand{textbf}} \spacer
-\texttt{\texcommand{textrm}} \spacer
-\texttt{\texcommand{texttt}} \spacer
-\texttt{\texcommand{textsf}} \spacer
-\texttt{\texcommand{emph}} \spacer
-\texttt{\texcommand{hbox}} \spacer
-\texttt{\texcommand{mbox}} \lastspacer
-\end{mylist}
-
-The command \texttt{\texcommand{hbox}} doesn't really behave like it should, because MathML doesn't really have a notion of `horizontal box'. Blahtex treats \texttt{\texcommand{hbox}} essentially equivalently to \texttt{\texcommand{text}}, with slightly different formatting rules. Things like \texttt{\texcommand{hbox} to 12pt} are not supported.
-
-\subsection{Fractions, binomials}
-
-\begin{mylist}
-\texttt{\texcommand{frac}} \spacer
-\texttt{\texcommand{cfrac}} \spacer
-\texttt{\texcommand{over}} \spacer
-\texttt{\texcommand{binom}} \spacer
-\texttt{\texcommand{choose}} \spacer
-\texttt{\texcommand{atop}} \lastspacer
-\end{mylist}
-
-\subsection{Delimiters}
-
-\begin{mylist}
-\texttt{\texcommand{left}} \spacer
-\texttt{\texcommand{right}} \spacer
-\texttt{\texcommand{big}} \spacer
-\texttt{\texcommand{Big}} \spacer
-\texttt{\texcommand{bigg}} \spacer
-\texttt{\texcommand{Bigg}} \spacer
-\texttt{\texcommand{bigl}} \spacer
-\texttt{\texcommand{Bigl}} \spacer
-\texttt{\texcommand{biggl}} \spacer
-\texttt{\texcommand{Biggl}} \spacer
-\texttt{\texcommand{bigr}} \spacer
-\texttt{\texcommand{Bigr}} \spacer
-\texttt{\texcommand{biggr}} \spacer
-\texttt{\texcommand{Biggr}} \lastspacer
-\end{mylist}
-
-\subsection{Atom flavours}
-
-\begin{mylist}
-\texttt{\texcommand{mathop}} \spacer
-\texttt{\texcommand{mathrel}} \spacer
-\texttt{\texcommand{mathord}} \spacer
-\texttt{\texcommand{mathbin}} \spacer
-\texttt{\texcommand{mathopen}} \spacer
-\texttt{\texcommand{mathclose}} \spacer
-\texttt{\texcommand{mathpunct}} \spacer
-\texttt{\texcommand{mathinner}} \lastspacer
-\end{mylist}
-
-\subsection{Limits}
-
-\begin{mylist}
-\texttt{\texcommand{limits}} \spacer
-\texttt{\texcommand{nolimits}} \spacer
-\texttt{\texcommand{displaylimits}} \lastspacer
-\end{mylist}
-
-\subsection{Spacing}
-
-\begin{mylist}
-\texttt{\texcommand{,}} \spacer
-\texttt{\texcommand{!}} \spacer
-\texttt{\texcommand{ }} \spacer
-\texttt{\texcommand{;}} \spacer
-\texttt{\texcommand{>}} \spacer
-\texttt{\texcommand{quad}} \spacer
-\texttt{\texcommand{qquad}} \lastspacer
-\end{mylist}
-
-\subsection{Accents}
-
-\begin{mylist}
-\texttt{\texcommand{hat}} \spacer
-\texttt{\texcommand{widehat}} \spacer
-\texttt{\texcommand{dot}} \spacer
-\texttt{\texcommand{ddot}} \spacer
-\texttt{\texcommand{bar}} \spacer
-\texttt{\texcommand{overline}} \spacer
-\texttt{\texcommand{underline}} \spacer
-\texttt{\texcommand{overbrace}} \spacer
-\texttt{\texcommand{underbrace}} \spacer
-\texttt{\texcommand{overleftarrow}} \spacer
-\texttt{\texcommand{overrightarrow}} \spacer
-\texttt{\texcommand{overleftrightarrow}} \spacer
-\texttt{\texcommand{check}} \spacer
-\texttt{\texcommand{acute}} \spacer
-\texttt{\texcommand{grave}} \spacer
-\texttt{\texcommand{vec}} \spacer
-\texttt{\texcommand{breve}} \spacer
-\texttt{\texcommand{tilde}} \spacer
-\texttt{\texcommand{widetilde}} \lastspacer
-\end{mylist}
-
-\subsection{Fonts}
-
-\begin{mylist}
-\texttt{\texcommand{mathbf}} \spacer
-\texttt{\texcommand{mathbb}} \spacer
-\texttt{\texcommand{mathrm}} \spacer
-\texttt{\texcommand{mathit}} \spacer
-\texttt{\texcommand{mathcal}} \spacer
-\texttt{\texcommand{mathfrak}} \spacer
-\texttt{\texcommand{mathsf}} \spacer
-\texttt{\texcommand{mathtt}} \spacer
-\texttt{\texcommand{boldsymbol}} \spacer
-\texttt{\texcommand{rm}} \spacer
-\texttt{\texcommand{bf}} \spacer
-\texttt{\texcommand{it}} \spacer
-\texttt{\texcommand{cal}} \spacer
-\texttt{\texcommand{tt}} \spacer
-\texttt{\texcommand{sf}} \spacer
-\texttt{\texcommand{Bbb}} \spacer
-\texttt{\texcommand{bold}} \lastspacer
-\end{mylist}
-
-\subsection{Style}
-
-\begin{mylist}
-\texttt{\texcommand{displaystyle}} \spacer
-\texttt{\texcommand{textstyle}} \spacer
-\texttt{\texcommand{scriptstyle}} \spacer
-\texttt{\texcommand{scriptscriptstyle}} \lastspacer
-\end{mylist}
-
-\subsection{Named operators}
-
-\begin{mylist}
-\texttt{\texcommand{operatorname}} \spacer
-\texttt{\texcommand{operatornamewithlimits}} \spacer
-\texttt{\texcommand{lim}} \spacer
-\texttt{\texcommand{sup}} \spacer
-\texttt{\texcommand{inf}} \spacer
-\texttt{\texcommand{limsup}} \spacer
-\texttt{\texcommand{liminf}} \spacer
-\texttt{\texcommand{injlim}} \spacer
-\texttt{\texcommand{projlim}} \spacer
-\texttt{\texcommand{varlimsup}} \spacer
-\texttt{\texcommand{varliminf}} \spacer
-\texttt{\texcommand{varinjlim}} \spacer
-\texttt{\texcommand{varprojlim}} \spacer
-\texttt{\texcommand{min}} \spacer
-\texttt{\texcommand{max}} \spacer
-\texttt{\texcommand{gcd}} \spacer
-\texttt{\texcommand{det}} \spacer
-\texttt{\texcommand{Pr}} \spacer
-\texttt{\texcommand{ker}} \spacer
-\texttt{\texcommand{hom}} \spacer
-\texttt{\texcommand{dim}} \spacer
-\texttt{\texcommand{arg}} \spacer
-\texttt{\texcommand{sin}} \spacer
-\texttt{\texcommand{cos}} \spacer
-\texttt{\texcommand{sec}} \spacer
-\texttt{\texcommand{csc}} \spacer
-\texttt{\texcommand{tan}} \spacer
-\texttt{\texcommand{cot}} \spacer
-\texttt{\texcommand{arcsin}} \spacer
-\texttt{\texcommand{arccos}} \spacer
-\texttt{\texcommand{arctan}} \spacer
-\texttt{\texcommand{sinh}} \spacer
-\texttt{\texcommand{cosh}} \spacer
-\texttt{\texcommand{tanh}} \spacer
-\texttt{\texcommand{coth}} \spacer
-\texttt{\texcommand{log}} \spacer
-\texttt{\texcommand{lg}} \spacer
-\texttt{\texcommand{ln}} \spacer
-\texttt{\texcommand{exp}} \spacer
-\texttt{\texcommand{deg}} \spacer
-\texttt{\texcommand{mod}} \spacer
-\texttt{\texcommand{bmod}} \spacer
-\texttt{\texcommand{pmod}} \lastspacer
-\end{mylist}
-
-\subsection{Escaped characters}
-
-\begin{mylist}
-\texttt{\texcommand{\_}} \spacer
-\texttt{\texcommand{\&}} \spacer
-\texttt{\texcommand{\$}} \spacer
-\texttt{\texcommand{\#}} \spacer
-\texttt{\texcommand{\%}} \spacer
-\texttt{\texcommand{\{}} \spacer
-\texttt{\texcommand{\}}} \lastspacer
-\end{mylist}
-
-\subsection{Greek letters}
-
-\begin{mylist}
-\texttt{\texcommand{alpha}} \spacer
-\texttt{\texcommand{beta}} \spacer
-\texttt{\texcommand{gamma}} \spacer
-\texttt{\texcommand{delta}} \spacer
-\texttt{\texcommand{epsilon}} \spacer
-\texttt{\texcommand{varepsilon}} \spacer
-\texttt{\texcommand{zeta}} \spacer
-\texttt{\texcommand{eta}} \spacer
-\texttt{\texcommand{vartheta}} \spacer
-\texttt{\texcommand{theta}} \spacer
-\texttt{\texcommand{iota}} \spacer
-\texttt{\texcommand{kappa}} \spacer
-\texttt{\texcommand{varkappa}} \spacer
-\texttt{\texcommand{lambda}} \spacer
-\texttt{\texcommand{mu}} \spacer
-\texttt{\texcommand{nu}} \spacer
-\texttt{\texcommand{pi}} \spacer
-\texttt{\texcommand{varpi}} \spacer
-\texttt{\texcommand{rho}} \spacer
-\texttt{\texcommand{varrho}} \spacer
-\texttt{\texcommand{sigma}} \spacer
-\texttt{\texcommand{varsigma}} \spacer
-\texttt{\texcommand{tau}} \spacer
-\texttt{\texcommand{upsilon}} \spacer
-\texttt{\texcommand{phi}} \spacer
-\texttt{\texcommand{varphi}} \spacer
-\texttt{\texcommand{chi}} \spacer
-\texttt{\texcommand{psi}} \spacer
-\texttt{\texcommand{omega}} \spacer
-\texttt{\texcommand{xi}} \spacer
-\texttt{\texcommand{digamma}} \spacer
-\texttt{\texcommand{Gamma}} \spacer
-\texttt{\texcommand{Delta}} \spacer
-\texttt{\texcommand{Theta}} \spacer
-\texttt{\texcommand{Lambda}} \spacer
-\texttt{\texcommand{Pi}} \spacer
-\texttt{\texcommand{Sigma}} \spacer
-\texttt{\texcommand{Upsilon}} \spacer
-\texttt{\texcommand{Phi}} \spacer
-\texttt{\texcommand{Psi}} \spacer
-\texttt{\texcommand{Omega}} \spacer
-\texttt{\texcommand{Xi}} \lastspacer
-\end{mylist}
-
-\subsection{Various mathematical symbols in no particular order}
-
-\begin{mylist}
-\texttt{\texcommand{ast}} \spacer
-\texttt{\texcommand{implies}} \spacer
-\texttt{\texcommand{neg}} \spacer
-\texttt{\texcommand{ne}} \spacer
-\texttt{\texcommand{ge}} \spacer
-\texttt{\texcommand{le}} \spacer
-\texttt{\texcommand{land}} \spacer
-\texttt{\texcommand{lor}} \spacer
-\texttt{\texcommand{gets}} \spacer
-\texttt{\texcommand{to}} \spacer
-\texttt{\texcommand{vert}} \spacer
-\texttt{\texcommand{lvert}} \spacer
-\texttt{\texcommand{rvert}} \spacer
-\texttt{\texcommand{Vert}} \spacer
-\texttt{\texcommand{lVert}} \spacer
-\texttt{\texcommand{rVert}} \spacer
-\texttt{\texcommand{lfloor}} \spacer
-\texttt{\texcommand{rfloor}} \spacer
-\texttt{\texcommand{lceil}} \spacer
-\texttt{\texcommand{rceil}} \spacer
-\texttt{\texcommand{lbrace}} \spacer
-\texttt{\texcommand{rbrace}} \spacer
-\texttt{\texcommand{langle}} \spacer
-\texttt{\texcommand{rangle}} \spacer
-\texttt{\texcommand{lbrack}} \spacer
-\texttt{\texcommand{rbrack}} \spacer
-\texttt{\texcommand{aleph}} \spacer
-\texttt{\texcommand{beth}} \spacer
-\texttt{\texcommand{gimel}} \spacer
-\texttt{\texcommand{daleth}} \spacer
-\texttt{\texcommand{wp}} \spacer
-\texttt{\texcommand{ell}} \spacer
-\texttt{\texcommand{P}} \spacer
-\texttt{\texcommand{imath}} \spacer
-\texttt{\texcommand{forall}} \spacer
-\texttt{\texcommand{exists}} \spacer
-\texttt{\texcommand{Finv}} \spacer
-\texttt{\texcommand{Game}} \spacer
-\texttt{\texcommand{partial}} \spacer
-\texttt{\texcommand{Re}} \spacer
-\texttt{\texcommand{Im}} \spacer
-\texttt{\texcommand{leftarrow}} \spacer
-\texttt{\texcommand{rightarrow}} \spacer
-\texttt{\texcommand{longleftarrow}} \spacer
-\texttt{\texcommand{longrightarrow}} \spacer
-\texttt{\texcommand{Leftarrow}} \spacer
-\texttt{\texcommand{Rightarrow}} \spacer
-\texttt{\texcommand{Longleftarrow}} \spacer
-\texttt{\texcommand{Longrightarrow}} \spacer
-\texttt{\texcommand{mapsto}} \spacer
-\texttt{\texcommand{longmapsto}} \spacer
-\texttt{\texcommand{leftrightarrow}} \spacer
-\texttt{\texcommand{Leftrightarrow}} \spacer
-\texttt{\texcommand{longleftrightarrow}} \spacer
-\texttt{\texcommand{Longleftrightarrow}} \spacer
-\texttt{\texcommand{uparrow}} \spacer
-\texttt{\texcommand{Uparrow}} \spacer
-\texttt{\texcommand{downarrow}} \spacer
-\texttt{\texcommand{Downarrow}} \spacer
-\texttt{\texcommand{updownarrow}} \spacer
-\texttt{\texcommand{Updownarrow}} \spacer
-\texttt{\texcommand{searrow}} \spacer
-\texttt{\texcommand{nearrow}} \spacer
-\texttt{\texcommand{swarrow}} \spacer
-\texttt{\texcommand{nwarrow}} \spacer
-\texttt{\texcommand{hookrightarrow}} \spacer
-\texttt{\texcommand{hookleftarrow}} \spacer
-\texttt{\texcommand{upharpoonright}} \spacer
-\texttt{\texcommand{upharpoonleft}} \spacer
-\texttt{\texcommand{downharpoonright}} \spacer
-\texttt{\texcommand{downharpoonleft}} \spacer
-\texttt{\texcommand{rightharpoonup}} \spacer
-\texttt{\texcommand{rightharpoondown}} \spacer
-\texttt{\texcommand{leftharpoonup}} \spacer
-\texttt{\texcommand{leftharpoondown}} \spacer
-\texttt{\texcommand{nleftarrow}} \spacer
-\texttt{\texcommand{nrightarrow}} \spacer
-\texttt{\texcommand{supset}} \spacer
-\texttt{\texcommand{subset}} \spacer
-\texttt{\texcommand{supseteq}} \spacer
-\texttt{\texcommand{subseteq}} \spacer
-\texttt{\texcommand{sqsupset}} \spacer
-\texttt{\texcommand{sqsubset}} \spacer
-\texttt{\texcommand{sqsupseteq}} \spacer
-\texttt{\texcommand{sqsubseteq}} \spacer
-\texttt{\texcommand{supsetneq}} \spacer
-\texttt{\texcommand{subsetneq}} \spacer
-\texttt{\texcommand{in}} \spacer
-\texttt{\texcommand{ni}} \spacer
-\texttt{\texcommand{notin}} \spacer
-\texttt{\texcommand{iff}} \spacer
-\texttt{\texcommand{mid}} \spacer
-\texttt{\texcommand{sim}} \spacer
-\texttt{\texcommand{simeq}} \spacer
-\texttt{\texcommand{approx}} \spacer
-\texttt{\texcommand{propto}} \spacer
-\texttt{\texcommand{equiv}} \spacer
-\texttt{\texcommand{cong}} \spacer
-\texttt{\texcommand{neq}} \spacer
-\texttt{\texcommand{ll}} \spacer
-\texttt{\texcommand{gg}} \spacer
-\texttt{\texcommand{geq}} \spacer
-\texttt{\texcommand{leq}} \spacer
-\texttt{\texcommand{triangleleft}} \spacer
-\texttt{\texcommand{triangleright}} \spacer
-\texttt{\texcommand{trianglelefteq}} \spacer
-\texttt{\texcommand{trianglerighteq}} \spacer
-\texttt{\texcommand{models}} \spacer
-\texttt{\texcommand{vdash}} \spacer
-\texttt{\texcommand{Vdash}} \spacer
-\texttt{\texcommand{vDash}} \spacer
-\texttt{\texcommand{lesssim}} \spacer
-\texttt{\texcommand{nless}} \spacer
-\texttt{\texcommand{ngeq}} \spacer
-\texttt{\texcommand{nleq}} \spacer
-\texttt{\texcommand{times}} \spacer
-\texttt{\texcommand{div}} \spacer
-\texttt{\texcommand{wedge}} \spacer
-\texttt{\texcommand{vee}} \spacer
-\texttt{\texcommand{oplus}} \spacer
-\texttt{\texcommand{otimes}} \spacer
-\texttt{\texcommand{cap}} \spacer
-\texttt{\texcommand{cup}} \spacer
-\texttt{\texcommand{sqcap}} \spacer
-\texttt{\texcommand{sqcup}} \spacer
-\texttt{\texcommand{smile}} \spacer
-\texttt{\texcommand{frown}} \spacer
-\texttt{\texcommand{smallsmile}} \spacer
-\texttt{\texcommand{smallfrown}} \spacer
-\texttt{\texcommand{setminus}} \spacer
-\texttt{\texcommand{smallsetminus}} \spacer
-\texttt{\texcommand{And}} \spacer
-\texttt{\texcommand{star}} \spacer
-\texttt{\texcommand{triangle}} \spacer
-\texttt{\texcommand{wr}} \spacer
-\texttt{\texcommand{infty}} \spacer
-\texttt{\texcommand{circ}} \spacer
-\texttt{\texcommand{hbar}} \spacer
-\texttt{\texcommand{lnot}} \spacer
-\texttt{\texcommand{nabla}} \spacer
-\texttt{\texcommand{prime}} \spacer
-\texttt{\texcommand{backslash}} \spacer
-\texttt{\texcommand{pm}} \spacer
-\texttt{\texcommand{mp}} \spacer
-\texttt{\texcommand{emptyset}} \spacer
-\texttt{\texcommand{varnothing}} \spacer
-\texttt{\texcommand{S}} \spacer
-\texttt{\texcommand{angle}} \spacer
-\texttt{\texcommand{colon}} \spacer
-\texttt{\texcommand{Diamond}} \spacer
-\texttt{\texcommand{nmid}} \spacer
-\texttt{\texcommand{square}} \spacer
-\texttt{\texcommand{Box}} \spacer
-\texttt{\texcommand{checkmark}} \spacer
-\texttt{\texcommand{complement}} \spacer
-\texttt{\texcommand{eth}} \spacer
-\texttt{\texcommand{hslash}} \spacer
-\texttt{\texcommand{mho}} \spacer
-\texttt{\texcommand{flat}} \spacer
-\texttt{\texcommand{sharp}} \spacer
-\texttt{\texcommand{natural}} \spacer
-\texttt{\texcommand{bullet}} \spacer
-\texttt{\texcommand{dagger}} \spacer
-\texttt{\texcommand{ddagger}} \spacer
-\texttt{\texcommand{clubsuit}} \spacer
-\texttt{\texcommand{spadesuit}} \spacer
-\texttt{\texcommand{heartsuit}} \spacer
-\texttt{\texcommand{diamondsuit}} \spacer
-\texttt{\texcommand{top}} \spacer
-\texttt{\texcommand{bot}} \spacer
-\texttt{\texcommand{perp}} \spacer
-\texttt{\texcommand{ldots}} \spacer
-\texttt{\texcommand{cdot}} \spacer
-\texttt{\texcommand{cdots}} \spacer
-\texttt{\texcommand{vdots}} \spacer
-\texttt{\texcommand{ddots}} \spacer
-\texttt{\texcommand{dots}} \spacer
-\texttt{\texcommand{dotsb}} \spacer
-\texttt{\texcommand{circledR}} \spacer
-\texttt{\texcommand{yen}} \spacer
-\texttt{\texcommand{maltese}} \spacer
-\texttt{\texcommand{circledS}} \spacer
-\texttt{\texcommand{Bbbk}} \spacer
-\texttt{\texcommand{jmath}} \spacer
-\texttt{\texcommand{ulcorner}} \spacer
-\texttt{\texcommand{urcorner}} \spacer
-\texttt{\texcommand{llcorner}} \spacer
-\texttt{\texcommand{lrcorner}} \spacer
-\texttt{\texcommand{dashrightarrow}} \spacer
-\texttt{\texcommand{dashleftarrow}} \spacer
-\texttt{\texcommand{backprime}} \spacer
-\texttt{\texcommand{vartriangle}} \spacer
-\texttt{\texcommand{blacktriangle}} \spacer
-\texttt{\texcommand{triangledown}} \spacer
-\texttt{\texcommand{blacktriangledown}} \spacer
-\texttt{\texcommand{blacksquare}} \spacer
-\texttt{\texcommand{lozenge}} \spacer
-\texttt{\texcommand{blacklozenge}} \spacer
-\texttt{\texcommand{bigstar}} \spacer
-\texttt{\texcommand{sphericalangle}} \spacer
-\texttt{\texcommand{measuredangle}} \spacer
-\texttt{\texcommand{dotplus}} \spacer
-\texttt{\texcommand{ltimes}} \spacer
-\texttt{\texcommand{rtimes}} \spacer
-\texttt{\texcommand{Cap}} \spacer
-\texttt{\texcommand{leftthreetimes}} \spacer
-\texttt{\texcommand{rightthreetimes}} \spacer
-\texttt{\texcommand{Cup}} \spacer
-\texttt{\texcommand{barwedge}} \spacer
-\texttt{\texcommand{curlywedge}} \spacer
-\texttt{\texcommand{veebar}} \spacer
-\texttt{\texcommand{curlyvee}} \spacer
-\texttt{\texcommand{doublebarwedge}} \spacer
-\texttt{\texcommand{boxminus}} \spacer
-\texttt{\texcommand{circleddash}} \spacer
-\texttt{\texcommand{boxtimes}} \spacer
-\texttt{\texcommand{circledast}} \spacer
-\texttt{\texcommand{boxdot}} \spacer
-\texttt{\texcommand{circledcirc}} \spacer
-\texttt{\texcommand{boxplus}} \spacer
-\texttt{\texcommand{centerdot}} \spacer
-\texttt{\texcommand{divideontimes}} \spacer
-\texttt{\texcommand{intercal}} \spacer
-\texttt{\texcommand{leqq}} \spacer
-\texttt{\texcommand{geqq}} \spacer
-\texttt{\texcommand{leqslant}} \spacer
-\texttt{\texcommand{geqslant}} \spacer
-\texttt{\texcommand{eqslantless}} \spacer
-\texttt{\texcommand{eqslantgtr}} \spacer
-\texttt{\texcommand{gtrsim}} \spacer
-\texttt{\texcommand{lessapprox}} \spacer
-\texttt{\texcommand{gtrapprox}} \spacer
-\texttt{\texcommand{approxeq}} \spacer
-\texttt{\texcommand{eqsim}} \spacer
-\texttt{\texcommand{lessdot}} \spacer
-\texttt{\texcommand{gtrdot}} \spacer
-\texttt{\texcommand{lll}} \spacer
-\texttt{\texcommand{ggg}} \spacer
-\texttt{\texcommand{lessgtr}} \spacer
-\texttt{\texcommand{gtrless}} \spacer
-\texttt{\texcommand{lesseqgtr}} \spacer
-\texttt{\texcommand{gtreqless}} \spacer
-\texttt{\texcommand{lesseqqgtr}} \spacer
-\texttt{\texcommand{gtreqqless}} \spacer
-\texttt{\texcommand{doteqdot}} \spacer
-\texttt{\texcommand{eqcirc}} \spacer
-\texttt{\texcommand{risingdotseq}} \spacer
-\texttt{\texcommand{circeq}} \spacer
-\texttt{\texcommand{fallingdotseq}} \spacer
-\texttt{\texcommand{triangleq}} \spacer
-\texttt{\texcommand{backsim}} \spacer
-\texttt{\texcommand{thicksim}} \spacer
-\texttt{\texcommand{backsimeq}} \spacer
-\texttt{\texcommand{thickapprox}} \spacer
-\texttt{\texcommand{subseteqq}} \spacer
-\texttt{\texcommand{supseteqq}} \spacer
-\texttt{\texcommand{Subset}} \spacer
-\texttt{\texcommand{Supset}} \spacer
-\texttt{\texcommand{preccurlyeq}} \spacer
-\texttt{\texcommand{succcurlyeq}} \spacer
-\texttt{\texcommand{curlyeqprec}} \spacer
-\texttt{\texcommand{curlyeqsucc}} \spacer
-\texttt{\texcommand{precsim}} \spacer
-\texttt{\texcommand{succsim}} \spacer
-\texttt{\texcommand{precapprox}} \spacer
-\texttt{\texcommand{succapprox}} \spacer
-\texttt{\texcommand{Vvdash}} \spacer
-\texttt{\texcommand{shortmid}} \spacer
-\texttt{\texcommand{shortparallel}} \spacer
-\texttt{\texcommand{bumpeq}} \spacer
-\texttt{\texcommand{between}} \spacer
-\texttt{\texcommand{Bumpeq}} \spacer
-\texttt{\texcommand{varpropto}} \spacer
-\texttt{\texcommand{backepsilon}} \spacer
-\texttt{\texcommand{blacktriangleleft}} \spacer
-\texttt{\texcommand{blacktriangleright}} \spacer
-\texttt{\texcommand{therefore}} \spacer
-\texttt{\texcommand{because}} \spacer
-\texttt{\texcommand{ngtr}} \spacer
-\texttt{\texcommand{nleqslant}} \spacer
-\texttt{\texcommand{ngeqslant}} \spacer
-\texttt{\texcommand{nleqq}} \spacer
-\texttt{\texcommand{ngeqq}} \spacer
-\texttt{\texcommand{lneqq}} \spacer
-\texttt{\texcommand{gneqq}} \spacer
-\texttt{\texcommand{lvertneqq}} \spacer
-\texttt{\texcommand{gvertneqq}} \spacer
-\texttt{\texcommand{lnsim}} \spacer
-\texttt{\texcommand{gnsim}} \spacer
-\texttt{\texcommand{lnapprox}} \spacer
-\texttt{\texcommand{gnapprox}} \spacer
-\texttt{\texcommand{nprec}} \spacer
-\texttt{\texcommand{nsucc}} \spacer
-\texttt{\texcommand{npreceq}} \spacer
-\texttt{\texcommand{nsucceq}} \spacer
-\texttt{\texcommand{precneqq}} \spacer
-\texttt{\texcommand{succneqq}} \spacer
-\texttt{\texcommand{precnsim}} \spacer
-\texttt{\texcommand{succnsim}} \spacer
-\texttt{\texcommand{precnapprox}} \spacer
-\texttt{\texcommand{succnapprox}} \spacer
-\texttt{\texcommand{nsim}} \spacer
-\texttt{\texcommand{ncong}} \spacer
-\texttt{\texcommand{nshortmid}} \spacer
-\texttt{\texcommand{nshortparallel}} \spacer
-\texttt{\texcommand{nmid}} \spacer
-\texttt{\texcommand{nparallel}} \spacer
-\texttt{\texcommand{nvdash}} \spacer
-\texttt{\texcommand{nvDash}} \spacer
-\texttt{\texcommand{nVdash}} \spacer
-\texttt{\texcommand{nVDash}} \spacer
-\texttt{\texcommand{ntriangleleft}} \spacer
-\texttt{\texcommand{ntriangleright}} \spacer
-\texttt{\texcommand{ntrianglelefteq}} \spacer
-\texttt{\texcommand{ntrianglerighteq}} \spacer
-\texttt{\texcommand{nsubseteq}} \spacer
-\texttt{\texcommand{nsupseteq}} \spacer
-\texttt{\texcommand{nsubseteqq}} \spacer
-\texttt{\texcommand{nsupseteqq}} \spacer
-\texttt{\texcommand{subsetneq}} \spacer
-\texttt{\texcommand{supsetneq}} \spacer
-\texttt{\texcommand{varsubsetneq}} \spacer
-\texttt{\texcommand{varsupsetneq}} \spacer
-\texttt{\texcommand{subsetneqq}} \spacer
-\texttt{\texcommand{supsetneqq}} \spacer
-\texttt{\texcommand{varsubsetneqq}} \spacer
-\texttt{\texcommand{varsupsetneqq}} \spacer
-\texttt{\texcommand{leftleftarrows}} \spacer
-\texttt{\texcommand{rightrightarrows}} \spacer
-\texttt{\texcommand{leftrightarrows}} \spacer
-\texttt{\texcommand{rightleftarrows}} \spacer
-\texttt{\texcommand{Lleftarrow}} \spacer
-\texttt{\texcommand{Rrightarrow}} \spacer
-\texttt{\texcommand{twoheadleftarrow}} \spacer
-\texttt{\texcommand{twoheadrightarrow}} \spacer
-\texttt{\texcommand{leftarrowtail}} \spacer
-\texttt{\texcommand{rightarrowtail}} \spacer
-\texttt{\texcommand{looparrowleft}} \spacer
-\texttt{\texcommand{looparrowright}} \spacer
-\texttt{\texcommand{leftrightharpoons}} \spacer
-\texttt{\texcommand{rightleftharpoons}} \spacer
-\texttt{\texcommand{curvearrowleft}} \spacer
-\texttt{\texcommand{curvearrowright}} \spacer
-\texttt{\texcommand{circlearrowleft}} \spacer
-\texttt{\texcommand{circlearrowright}} \spacer
-\texttt{\texcommand{Lsh}} \spacer
-\texttt{\texcommand{Rsh}} \spacer
-\texttt{\texcommand{upuparrows}} \spacer
-\texttt{\texcommand{downdownarrows}} \spacer
-\texttt{\texcommand{multimap}} \spacer
-\texttt{\texcommand{rightsquigarrow}} \spacer
-\texttt{\texcommand{leftrightsquigarrow}} \spacer
-\texttt{\texcommand{nLeftarrow}} \spacer
-\texttt{\texcommand{nRightarrow}} \spacer
-\texttt{\texcommand{nleftrightarrow}} \spacer
-\texttt{\texcommand{nLeftrightarrow}} \spacer
-\texttt{\texcommand{pitchfork}} \spacer
-\texttt{\texcommand{nexists}} \spacer
-\texttt{\texcommand{lhd}} \spacer
-\texttt{\texcommand{rhd}} \spacer
-\texttt{\texcommand{unlhd}} \spacer
-\texttt{\texcommand{unrhd}} \spacer
-\texttt{\texcommand{leadsto}} \spacer
-\texttt{\texcommand{uplus}} \spacer
-\texttt{\texcommand{diamond}} \spacer
-\texttt{\texcommand{bigtriangleup}} \spacer
-\texttt{\texcommand{bigtriangledown}} \spacer
-\texttt{\texcommand{ominus}} \spacer
-\texttt{\texcommand{oslash}} \spacer
-\texttt{\texcommand{odot}} \spacer
-\texttt{\texcommand{bigcirc}} \spacer
-\texttt{\texcommand{amalg}} \spacer
-\texttt{\texcommand{prec}} \spacer
-\texttt{\texcommand{succ}} \spacer
-\texttt{\texcommand{preceq}} \spacer
-\texttt{\texcommand{succeq}} \spacer
-\texttt{\texcommand{dashv}} \spacer
-\texttt{\texcommand{asymp}} \spacer
-\texttt{\texcommand{doteq}} \spacer
-\texttt{\texcommand{parallel}} \spacer
-\texttt{\texcommand{bowtie}} \spacer
-\texttt{\texcommand{surd}} \spacer
-\texttt{\texcommand{doublecap}} \spacer
-\texttt{\texcommand{restriction}} \spacer
-\texttt{\texcommand{llless}} \spacer
-\texttt{\texcommand{gggtr}} \spacer
-\texttt{\texcommand{Doteq}} \spacer
-\texttt{\texcommand{doublecup}} \spacer
-\texttt{\texcommand{dasharrow}} \spacer
-\texttt{\texcommand{vartriangleleft}} \spacer
-\texttt{\texcommand{vartriangleright}} \spacer
-\texttt{\texcommand{Join}} \lastspacer
-\end{mylist}
-
-\subsection{Large operators}
-
-\begin{mylist}
-\texttt{\texcommand{sum}} \spacer
-\texttt{\texcommand{prod}} \spacer
-\texttt{\texcommand{int}} \spacer
-\texttt{\texcommand{iint}} \spacer
-\texttt{\texcommand{iiint}} \spacer
-\texttt{\texcommand{iiiint}} \spacer
-\texttt{\texcommand{oint}} \spacer
-\texttt{\texcommand{bigcap}} \spacer
-\texttt{\texcommand{bigodot}} \spacer
-\texttt{\texcommand{bigcup}} \spacer
-\texttt{\texcommand{bigotimes}} \spacer
-\texttt{\texcommand{coprod}} \spacer
-\texttt{\texcommand{bigsqcup}} \spacer
-\texttt{\texcommand{bigoplus}} \spacer
-\texttt{\texcommand{bigvee}} \spacer
-\texttt{\texcommand{biguplus}} \spacer
-\texttt{\texcommand{bigwedge}} \lastspacer
-\end{mylist}
-
-\subsection{Symbols only available in text mode}
-
-\begin{mylist}
-\texttt{\texcommand{O}} \spacer
-\texttt{\texcommand{"}} \spacer
-\texttt{\texcommand{'}} \spacer
-\texttt{\texcommand{textbackslash}} \spacer
-\texttt{\texcommand{textvisiblespace}} \spacer
-\texttt{\texcommand{textasciicircum}} \spacer
-\texttt{\texcommand{textasciitilde}} \lastspacer
-\end{mylist}
-
-
-\subsection{Special commands}\label{sec:special-commands}
-
-If the magic command \texttt{\texcommand{strictspacing}} occurs anywhere in the input, blahtex will switch to `strict spacing mode' for the entire equation. This overrides the command-line \texttt{--spacing} setting.
-
-\subsection{Unicode symbol translation in math mode}\label{sec:input-symbol-translation}
-
-In math mode, blahtex accepts a number of non-ASCII symbols just like their command counterpart. These symbols are translated as \TeX{} commands, as detailed in the table below. For instance, the character $\alpha$ (Unicode 0x3B1) is equivalent to the ASCII sequence \verb|\alpha|. The benefit is input formulas that are more compact and more readable, provided that the file encoding and/or console character set allows for it. Note that this applies to both blahtex and blahtexml; see Section~\ref{sec:blahtexml-input-symbol-translation}.
-
-\input{InputSymbolTranslation.tex}
-
-\subsection{Non-ASCII characters in text mode}\label{sec:non-ascii-characters}
-
-Blahtex will serenely transcribe any non-ASCII characters for MathML output, as long as they appear in text mode (for example, surrounded by \texttt{\texcommand{text}\{...\}}). For PNG output, things are more difficult, because \LaTeX{} needs special packages and fonts available. At a minimum, the blahtex command line option \texttt{--use-ucs-package} must be used. The following sections describe which characters are permitted for PNG output.
-
-\subsubsection{Extended Latin}
-
-The following characters are handled directly by the \LaTeX{} \texttt{ucs} package.
-
-\newcommand{\nonasciicharlist}{
-\begin{quote}
-% hmmm latex2html was giving me funny warnings/errors
-% for the first few of these, so I added the leading
-% zero and that seemed to shut it up.
-\unichar{0161}
-\unichar{0163}
-\unichar{0167}
-\unichar{0169}
-\unichar{0172}
-\unichar{0174}
-\unichar{0176}
-\unichar{0181}
-\unichar{0182}
-\unichar{0191}
-\unichar{0192}
-\unichar{0193}
-\unichar{0194}
-\unichar{0195}
-\unichar{0196}
-\unichar{0197}
-\unichar{0198}
-\unichar{0199}
-\unichar{0200}
-\unichar{0201}
-\unichar{0202}
-\unichar{0203}
-\unichar{0204}
-\unichar{0205}
-\unichar{0206}
-\unichar{0207}
-\unichar{0209}
-\unichar{0210}
-\unichar{0211}
-\unichar{0212}
-\unichar{0213}
-\unichar{0214}
-\unichar{0215}
-\unichar{0216}
-\unichar{0217}
-\unichar{0218}
-\unichar{0219}
-\unichar{0220}
-\unichar{0221}
-\unichar{0223}
-\unichar{0224}
-\unichar{0225}
-\unichar{0226}
-\unichar{0227}
-\unichar{0228}
-\unichar{0229}
-\unichar{0230}
-\unichar{0231}
-\unichar{0232}
-\unichar{0233}
-\unichar{0234}
-\unichar{0235}
-\unichar{0236}
-\unichar{0237}
-\unichar{0238}
-\unichar{0241}
-\unichar{0242}
-\unichar{0243}
-\unichar{0244}
-\unichar{0245}
-\unichar{0246}
-\unichar{0247}
-\unichar{0248}
-\unichar{0249}
-\unichar{0250}
-\unichar{0251}
-\unichar{0252}
-\unichar{0253}
-\unichar{0255}
-\unichar{0256}
-\unichar{0257}
-\unichar{0258}
-\unichar{0259}
-\unichar{0262}
-\unichar{0263}
-\unichar{0264}
-\unichar{0265}
-\unichar{0266}
-\unichar{0267}
-\unichar{0268}
-\unichar{0269}
-\unichar{0270}
-\unichar{0271}
-\unichar{0274}
-\unichar{0275}
-\unichar{0276}
-\unichar{0277}
-\unichar{0278}
-\unichar{0279}
-\unichar{0282}
-\unichar{0283}
-\unichar{0284}
-\unichar{0285}
-\unichar{0286}
-\unichar{0287}
-\unichar{0288}
-\unichar{0289}
-\unichar{0290}
-\unichar{0292}
-\unichar{0293}
-\unichar{0296}
-\unichar{0297}
-\unichar{0298}
-\unichar{0299}
-\unichar{0300}
-\unichar{0301}
-\unichar{0304}
-\unichar{0305}
-\unichar{0308}
-\unichar{0309}
-\unichar{0310}
-\unichar{0311}
-\unichar{0313}
-\unichar{0314}
-\unichar{0315}
-\unichar{0316}
-\unichar{0317}
-\unichar{0318}
-\unichar{0321}
-\unichar{0322}
-\unichar{0323}
-\unichar{0324}
-\unichar{0325}
-\unichar{0326}
-\unichar{0327}
-\unichar{0328}
-\unichar{0332}
-\unichar{0333}
-\unichar{0334}
-\unichar{0335}
-\unichar{0336}
-\unichar{0337}
-\unichar{0338}
-\unichar{0339}
-\unichar{0340}
-\unichar{0341}
-\unichar{0342}
-\unichar{0343}
-\unichar{0344}
-\unichar{0345}
-\unichar{0346}
-\unichar{0347}
-\unichar{0348}
-\unichar{0349}
-\unichar{0350}
-\unichar{0351}
-\unichar{0352}
-\unichar{0353}
-\unichar{0354}
-\unichar{0355}
-\unichar{0356}
-\unichar{0357}
-\unichar{0360}
-\unichar{0361}
-\unichar{0362}
-\unichar{0363}
-\unichar{0364}
-\unichar{0365}
-\unichar{0366}
-\unichar{0367}
-\unichar{0368}
-\unichar{0369}
-\unichar{0372}
-\unichar{0373}
-\unichar{0374}
-\unichar{0375}
-\unichar{0376}
-\unichar{0377}
-\unichar{0378}
-\unichar{0379}
-\unichar{0380}
-\unichar{0381}
-\unichar{0382}
-\unichar{0461}
-\unichar{0462}
-\unichar{0463}
-\unichar{0464}
-\unichar{0465}
-\unichar{0466}
-\unichar{0467}
-\unichar{0468}
-\unichar{0482}
-\unichar{0483}
-\unichar{0486}
-\unichar{0487}
-\unichar{0488}
-\unichar{0489}
-\unichar{0496}
-\unichar{0500}
-\unichar{0501}
-\unichar{0504}
-\unichar{0505}
-\unichar{0508}
-\unichar{0509}
-\unichar{0510}
-\unichar{0511}
-\unichar{0536}
-\unichar{0537}
-\unichar{0538}
-\unichar{0539}
-\unichar{0542}
-\unichar{0543}
-\unichar{0550}
-\unichar{0551}
-\unichar{0552}
-\unichar{0553}
-\unichar{0558}
-\unichar{0559}
-\unichar{0562}
-\unichar{0563}
-\end{quote}
-}
-
-\begin{latexonly}
-\nonasciicharlist
-\end{latexonly}
-
-\begin{htmlonly}
-\newcommand{\unichar}[1]{\rawhtml&\##1;\endrawhtml}
-\nonasciicharlist
-\end{htmlonly}
-
-Currently blahtex does not recognise \TeX{}'s accent commands (like \texttt{\textbackslash"o}), so it is necessary to enter characters requiring accents directly in UTF-8.
-
-\subsubsection{Cyrillic}
-
-Blahtex experimentally supports Cyrillic characters, by using \LaTeX's \texttt{fontenc} package with the \texttt{X2} font encoding. Input must be entered in UTF-8, and surrounded by the (nonstandard) \texttt{\texcommand{cyr}\{...\}} command. Commands like \texttt{\texcommand{CYRSHA}} are not supported. Only the basic Cyrillic alphabet is supported, which as far as I can tell is sufficient for Russian.
-
-\textit{Disclaimer:} I don't know anything about Cyrillic, or any languages that use it. If I've messed something up, your advice would be appreciated.
-
-\subsubsection{Japanese}
-
-Blahtex experimentally supports Japanese (Kanji, Hiragana, Katakana) by using the \LaTeX{} \texttt{CJK} package. Input must be entered in UTF-8, and surrounded by the (nonstandard) \texttt{\texcommand{jap}\{...\}} command. The command-line option \texttt{--use-cjk-package} must be used. Additionally, the \TeX{} system must have a Japanese font installed, and blahtex needs to be informed via the command-line option \texttt{--japanese-font}.
-
-\textit{Disclaimer:} I don't know anything about the Japanese language or writing system. If I've messed something up, your advice would be appreciated.
-
-
-\subsection{Partial list of differences between blahtex and texvc}
-
-\subsubsection{Additional commands}
-
-Blahtex supports many \TeX/\LaTeX/AMS-\LaTeX{} commands not supported by texvc, especially many of the symbols in AMS-\LaTeX.
-
-\subsubsection{HTML support}
-
-The main feature of texvc that is missing in blahtex is support for HTML output. This may or may not be added in future.
-
-\subsubsection{Error reporting}
-
-Blahtex has much more robust syntax error reporting than texvc. Rather than a handful of generic error messages, blahtex can generate a wide variety of more detailed error messages to help the user diagnose the problem.
-
-\subsubsection{Parsing differences}
-
-Blahtex generally achieves much higher compatibility with \TeX{}'s parsing than texvc does. Texvc is generally more permissive. For example, the following are legal in texvc, but in \TeX{} and blahtex they require additional grouping braces:
-\begin{itemize}
-\item \texttt{\texcommand{frac} \texcommand{sqrt} a \texcommand{hat} b}
-\item \texttt{x\textasciicircum\texcommand{cong}}
-\item \texttt{x\textasciicircum\texcommand{left}( xyz \texcommand{right})}
-\item \texttt{x\textasciicircum\texcommand{begin}\{matrix\} a \texcommand{end}\{matrix\}}
-\end{itemize}
-
-The characters \texttt{\$} and \texttt{\%} are legal in texvc, but are illegal in blahtex. (Of course \texttt{\texcommand{\$}} and \texttt{\texcommand{\%}} are available.)
-
-These parsing differences may cause problems in replacing texvc with blahtex in an existing MediaWiki installation, since some legacy equations may not be compatible with blahtex. Preliminary research suggests that about 0.5\% of equations on Wikipedia itself (including the ten largest language Wikipedias) would be affected.
-
-\subsubsection{Nonstandard commands}\label{sec:texvc-compatible-commands}
-
-Blahtex has a command-line option (\texttt{--texvc-compatible-commands}) that enables all of the nonstandard commands in texvc's dialect of \TeX{}; that is, commands which are not present in \TeX{}, \LaTeX{}, or AMS-\LaTeX{}. It appears that most of these commands were added to texvc to make life easier for people familiar with HTML entities; for example, \texttt{\texcommand{isin}} is a texvc synonym for the standard \texttt{\texcommand{in}}. This option should be useful for backward compatibility with existing equations in databases like Wikipedia. Here is the complete list:
-
-\begin{mylist}
-\texttt{\texcommand{R}} \spacer
-\texttt{\texcommand{Reals}} \spacer
-\texttt{\texcommand{reals}} \spacer
-\texttt{\texcommand{Z}} \spacer
-\texttt{\texcommand{N}} \spacer
-\texttt{\texcommand{natnums}} \spacer
-\texttt{\texcommand{Complex}} \spacer
-\texttt{\texcommand{cnums}} \spacer
-\texttt{\texcommand{alefsym}} \spacer
-\texttt{\texcommand{alef}} \spacer
-\texttt{\texcommand{larr}} \spacer
-\texttt{\texcommand{rarr}} \spacer
-\texttt{\texcommand{Larr}} \spacer
-\texttt{\texcommand{lArr}} \spacer
-\texttt{\texcommand{Rarr}} \spacer
-\texttt{\texcommand{rArr}} \spacer
-\texttt{\texcommand{uarr}} \spacer
-\texttt{\texcommand{uArr}} \spacer
-\texttt{\texcommand{Uarr}} \spacer
-\texttt{\texcommand{darr}} \spacer
-\texttt{\texcommand{dArr}} \spacer
-\texttt{\texcommand{Darr}} \spacer
-\texttt{\texcommand{lrarr}} \spacer
-\texttt{\texcommand{harr}} \spacer
-\texttt{\texcommand{Lrarr}} \spacer
-\texttt{\texcommand{Harr}} \spacer
-\texttt{\texcommand{lrArr}} \spacer
-\texttt{\texcommand{hAar}} \spacer
-\texttt{\texcommand{sub}} \spacer
-\texttt{\texcommand{supe}} \spacer
-\texttt{\texcommand{sube}} \spacer
-\texttt{\texcommand{infin}} \spacer
-\texttt{\texcommand{lang}} \spacer
-\texttt{\texcommand{rang}} \spacer
-\texttt{\texcommand{real}} \spacer
-\texttt{\texcommand{image}} \spacer
-\texttt{\texcommand{bull}} \spacer
-\texttt{\texcommand{weierp}} \spacer
-\texttt{\texcommand{isin}} \spacer
-\texttt{\texcommand{plusmn}} \spacer
-\texttt{\texcommand{Dagger}} \spacer
-\texttt{\texcommand{exist}} \spacer
-\texttt{\texcommand{sect}} \spacer
-\texttt{\texcommand{clubs}} \spacer
-\texttt{\texcommand{spades}} \spacer
-\texttt{\texcommand{hearts}} \spacer
-\texttt{\texcommand{diamonds}} \spacer
-\texttt{\texcommand{sdot}} \spacer
-\texttt{\texcommand{ang}} \spacer
-\texttt{\texcommand{thetasym}} \spacer
-\texttt{\texcommand{Alpha}} \spacer
-\texttt{\texcommand{Beta}} \spacer
-\texttt{\texcommand{Epsilon}} \spacer
-\texttt{\texcommand{Zeta}} \spacer
-\texttt{\texcommand{Eta}} \spacer
-\texttt{\texcommand{Iota}} \spacer
-\texttt{\texcommand{Kappa}} \spacer
-\texttt{\texcommand{Mu}} \spacer
-\texttt{\texcommand{Nu}} \spacer
-\texttt{\texcommand{Rho}} \spacer
-\texttt{\texcommand{Tau}} \spacer
-\texttt{\texcommand{Chi}} \spacer
-\texttt{\texcommand{arcsec}} \spacer
-\texttt{\texcommand{arccsc}} \spacer
-\texttt{\texcommand{arccot}} \spacer
-\texttt{\texcommand{sgn}} \lastspacer
-\end{mylist}
-
-Also included are the four commands \texttt{\texcommand{empty}},
-\texttt{\texcommand{and}}, \texttt{\texcommand{or}}, \texttt{\texcommand{part}}. These commands \emph{are} part of \TeX{}/\LaTeX{}/AMS-\LaTeX{}, but they do \emph{not} do what texvc thinks they should do! Blahtex emulates texvc's behaviour for these commands (assuming that the \texttt{--texvc-compatible-commands} option is active).
-
-
-\section{The blahtex command-line application}\label{sec:command-line}
-
-The blahtex source code is available from \texttt{www.blahtex.org}. No binaries will be made available. All official releases should have been signed with a PGP key whose ID is 0x6269E206 and whose fingerprint is \texttt{9A51 0B6A B144 6A4D E1E5 0DE6 D604 6405 6269 E206}. This key is valid until 2nd August 2007. You can either get it from the blahtex website, or try searching for `blahtex' on a public keyserver.
-
-Besides reading this document, the interested developer is strongly advised to ``use the source''.
-
-\subsection{System prerequisites}\label{sec:prerequisites}
-
-Blahtex has been successfully compiled and run on the following configurations:
-\begin{itemize}
-\item Linux with gcc 4.0.2 20050808 (prerelease)
-\item Mac OS 10.4.5 (PowerPC) with gcc 4.0.1
-\end{itemize}
-
-Some of the source files seem to need a bit of memory to compile. I had trouble with \texttt{-O3} level optimisation on an older machine with 256MB RAM. It should be fine with 512MB or above.
-
-Other UNIX-based systems might work too. You will probably encounter problems with compilers other than gcc, or with older versions of gcc. (Probably gcc 3.3 is still okay.) I have personally met at least one older Solaris compiler that couldn't stomach the code. Your compiler must support \texttt{wstring} and 32-bit \texttt{wchar\_t}s. If you want to compile it on MS Windows... good luck, let me know how it goes.
-
-You will need an installation of the GNU \texttt{iconv} library. On some systems this is preinstalled, so you don't need to do anything. On my Mac I needed to install it (for example via fink).
-
-\subsubsection{Prerequisites for generating PNG output}
-
-To generate PNGs, you will need \LaTeX{} and the \texttt{dvipng} utility, which is included in many \LaTeX{} distributions. Blahtex assumes that the following \LaTeX{} packages are available: \texttt{color}, \texttt{fontenc}, \texttt{inputenc}, \texttt{amsmath}, \texttt{amsfonts}, \texttt{amssymb}. All of these packages are included in teTeX, one of the most popular \TeX{} distributions for UNIX systems.
-
-Additionally, to handle non-ASCII characters, the \texttt{ucs} package must be installed, and blahtex must be informed by using the \texttt{--use-ucs-package} command line option. To enable computation of height and depth of the output PNG image, the \texttt{preview} package must be installed, and blahtex must be informed by using the \texttt{--use-preview-package} option.
-
-\subsubsection{Modified version of \texttt{dvipng}}
-
-The version of \texttt{dvipng} running on the blahtex website is a slightly modified version of \texttt{dvipng} 1.7. The modification pertains to the automatic hinting method used with the underlying FreeType 2 library, and was made with the help of the author of \texttt{dvipng}, Jan-\AA{}ke Larsson (thanks Jan-\AA{}ke!).
-
-It's quite simple: in the source file \texttt{ft.c}, just replace \texttt{FT\_LOAD\_NO\_HINTING} by \texttt{FT\_LOAD\_TARGET\_LIGHT}, and recompile. The author has indicated that this modification will appear in \texttt{dvipng} version 1.8.
-
-\subsubsection{Prerequisites for Japanese in PNG output}\label{sec:howto-japanese}
-
-To handle Japanese, the \LaTeX{} \texttt{CJK} package must be installed, and a Japanese font must be installed.
-
-\emph{Warning: Installing TrueType CJK fonts for use by \LaTeX{}/dvipng is a dark art. In this section I will describe a sequence of steps that worked for me. I will explain along the way what I believe the purpose of each step to be, and caveats that you should be aware of. \textbf{However, this should not be construed to imply that I have any idea at all of what I am talking about}}.
-
-You will need a Japanese TrueType font. For testing, I have been using the Sazanami gothic font: \mylink{http://sourceforge.jp/projects/efont/files/}. Look inside for the TrueType font file \texttt{sazanami-gothic.ttf}.
-
-\emph{Warning: I have not read the license document for this font. It is mostly in Japanese. It is quite possible that it is \textbf{not legal} to use this font for certain purposes. Since it is advertised as being targeted at OpenOffice, I expect that all is okay, but \textbf{I am not a lawyer}.}
-
-The strategy outlined below is to convert the TrueType font to a bunch of smaller Type 1 fonts, and to provide enough other information to make \LaTeX{} and \texttt{dvipng} happy.
-
-You will need FontForge, from \mylink{http://fontforge.sourceforge.net/}. (Note that to install FontForge on Mac OS X, you will need the StuffIt Expander utility to decompress the installation package. StuffIt Expander was included in Mac OS 10.3.x, but is not shipped with Mac OS 10.4.x. I had a copy available from an older OS, but if you have only OS 10.4.x, you will need to download StuffIt Expander from \mylink{http://www.stuffit.com/mac/expander/}. Also on the Mac you need to make sure that you have an X11 server available. On Mac OS 10.4.x it should be pre-installed in \texttt{/Applications/Utilities/X11.App}. On earlier versions you may need to download X11 from Apple's website.)
-
-Create a temporary working directory somewhere, which I will refer to in these instructions as \texttt{/temp}.
-
-You need to select a name for your font. Probably best to keep it very short. I will use the name `saza' throughout the following example; you will need to replace every `saza' with whatever you have chosen.
-
-Boot up X11, and run FontForge. You should get an `Open Font' dialog; open the \texttt{ttf} file from above. Then select `Generate Fonts...' from the File menu. Navigate to your \texttt{/temp} directory; this is where the output from the `generate fonts' process will be saved. On the drop-down list on the left, select `PS Type 1 (Multiple)'. (The point here is to split the font up into many smaller sub-fonts. This is necessary because \TeX{} can only really work with fonts that contain at most 256 symbols, and CJK fonts have many more than that.) The default file name will be something like \texttt{sazanami-gothic\%s.pfb}; change this to \texttt{saza-uni\%s.pfb}. Now press `Options', and make sure `Output TFM \& ENC' is checked. Then hit `Save'. A new `Find Sub Font Definitions' dialog will pop up. You will need to find the file \texttt{Unicode.sfd} on the web somewhere (Google is your friend); save this file somewhere and tell the dialog where it is. Press OK.
-
-FontForge should go away and think for a while. When it's finished, your \texttt{/temp} directory should be filled with lots of \texttt{.tfm}, \texttt{.pfb}, \texttt{.afm}, and \texttt{.enc} files. You can throw away the last two; we only need the \texttt{.tfm} and \texttt{.pfb} files. In your \texttt{texmf} tree, make a new directory called \texttt{/texmf/fonts/tfm/saza/}, and put all the \texttt{.tfm} files there. Similarly, put all the \texttt{.pfb} files into a directory \texttt{/texmf/fonts/type1/saza/}.
-
-(The \texttt{.tfm} files are `\TeX{} font metric' files. Roughly speaking, they tell \TeX{} how much space each character takes up. The corresponding \texttt{.pfb} files are Adobe Type 1 font files; they describe the actual glyphs for each character.)
-
-Create a plain text file called \texttt{C70saza.fd}, and fill it with the following text:
-\begin{verbatim}
-\DeclareFontFamily{C70}{saza}{\hyphenchar \font\mne}
-\DeclareFontShape{C70}{saza}{m}{n}{<-> CJK * saza-uni}{}
-\DeclareFontShape{C70}{saza}{bx}{n}{<-> CJKb * saza-uni}{CJKbold}
-\end{verbatim}
-Save this file under \texttt{/texmf/tex/latex/saza/}. (I think the idea of this file is to tell \LaTeX{} something about the new font you have installed.)
-
-That's all the files you need. Now you need to run \texttt{mktexlsr} (or \texttt{sudo mktexlsr}) to update \TeX's filename cache.
-
-When you run blahtex, you will need to use the command line options \texttt{--use-cjk-package --use-ucs-package --japanese-font saza}.
-
-\subsection{Compiling blahtex}\label{sec:compiling-blahtex}
-
-Unpack the source into your favourite directory.
-\begin{itemize}
-\item If you're running Linux, just type \texttt{make linux}.
-\item If you're running Mac OS X (as I do), try \texttt{make mac}.
-\end{itemize}
-You should then find an executable \texttt{blahtex} in the current directory. If you want to quickly test it, try \texttt{echo '\texcommand{frac} xy' | ./blahtex --mathml}.
-
-\subsection{Command-line syntax}\label{sec:command-line-syntax}
-
-The basic syntax is: \texttt{blahtex [ options ]}; the command-line options are listed below. The \TeX{} input should be supplied on standard input in UTF-8 encoding, which means plain ASCII if you don't care about Unicode. If no input is given, blahtex will print a help screen. If neither of the \texttt{--mathml} or \texttt{--png} options are selected, then blahtex will still process the input for syntax errors, but will product no output.
-
-\subsubsection{General options}
-
-\begin{itemize}
-\item \texttt{--help}. Prints out a list of command-line options.
-\item \texttt{--texvc-compatible-commands}. Enables use of commands that are specific to texvc, but that are not standard \TeX{}/\LaTeX{}/AMS-\LaTeX{} commands (see section \ref{sec:texvc-compatible-commands}).
-\item \texttt{--print-error-messages}. This will print out a list of all error IDs and corresponding messages that blahtex can possibly emit inside an \texttt{<error>} block (see Section \ref{sec:interpreting-output}).
-\end{itemize}
-
-\subsubsection{MathML-related options}
-
-\begin{itemize}
-\item \texttt{--mathml}. Enables MathML output.
-\item \texttt{--mathml-encoding \textit{type}}. Controls the way blahtex outputs MathML characters.
-\begin{itemize}
-\item \texttt{--mathml-encoding raw}. Use Unicode code points (i.e.~UTF-8) directly in the output.
-\item \texttt{--mathml-encoding numeric} (default). Use XML numeric entities, like \texttt{\&\#x2191;}. This is likely to be the most portable option.
-\item \texttt{--mathml-encoding short}. Use `short' MathML entity names, like \texttt{\&uarr;}.
-\item \texttt{--mathml-encoding long}. Use `long' MathML entity names, like \texttt{\&UpArrow;}.
-\end{itemize}
-Not every MathML character has `short' and/or `long' names; blahtex will fall back on numeric entities in this case.
-\item \texttt{--disallow-plane-1}. Prevents blahtex from outputting any plane-1 Unicode characters, either as UTF-8 or as numeric entities. Instead, it will use named entities like \texttt{\&Afr;} (Fraktur `A'). The rationale is that some browsers have somewhat incomplete support for plane-1 characters, but do okay with these named entities.
-\item \texttt{--mathml-version-1-fonts}. Forbids use of the \texttt{mathvariant} attribute, which is only available in MathML 2.0. Instead, blahtex will use MathML version 1.x font attributes: \texttt{fontfamily}, \texttt{fontstyle} and \texttt{fontweight}, which are all deprecated in MathML 2.0. If these attributes are insufficient, for example characters with \texttt{mathvariant} equal to \texttt{double-struck}, blahtex will substitute explicit MathML entities.
-\item \texttt{--other-encoding \textit{type}}. Controls the way blahtex outputs non-ASCII, non-MathML characters. Such a character could only occur if it was supplied directly in the input.
-\begin{itemize}
-\item \texttt{--other-encoding raw}. Use Unicode code points (i.e.~UTF-8) directly in the output.
-\item \texttt{--other-encoding numeric} (default). Use XML numeric entities.
-\end{itemize}
-Note: the default values for \texttt{--mathml-encoding} and \texttt{--other-encoding} imply that all output is plain ASCII.
-\item \texttt{--indented}. Prints each MathML tag on a separate line, with appropriate indenting.
-\item \texttt{--spacing \textit{type}}. Controls how much MathML spacing markup to use (i.e.~\texttt{<mspace>} tags, and \texttt{lspace}/\texttt{rspace} attributes). Blahtex always uses \TeX{}'s rules (or an approximation thereof) to compute how much space to place between symbols in the equation, but this option describes how often it will actually emit MathML spacing markup to implement its spacing decisions.
-\begin{itemize}
-\item \texttt{--spacing strict} (default). Output spacing markup everywhere possible; leave as little choice as possible to the MathML renderer. This will result in the most bloated output, but hopefully will look as much like \TeX{} output as possible.
-\item \texttt{--spacing moderate}. Output spacing commands whenever blahtex thinks a typical MathML renderer is likely to do something visually unsatisfactory without additional help. The aim is to get good agreement with \TeX{} without overly bloated MathML markup. (It's very difficult to get this right, so I expect it to be under continual review.)
-\item \texttt{--spacing relaxed}. Only output spacing commands when the user specifically asks for them, using \TeX{} commands like \texttt{\texcommand{,}} or \texttt{\texcommand{quad}}.
-\end{itemize}
-The magic command \texttt{\texcommand{strictspacing}} will override this setting (see Section \ref{sec:special-commands}).
-
-Blahtex pays a lot of attention to spacing, because the MathML defaults (via the operator dictionary) are often inadequate. To see the difference, try the simple input \texttt{a := b} on blahtex (with spacing set to moderate or strict) and compare with the output of other translators.
-\end{itemize}
-
-\subsubsection{PNG-related options}
-
-\begin{itemize}
-\item \texttt{--png}. Enables PNG output.
-\item \texttt{--use-ucs-package}. This tells blahtex it may use the \LaTeX{} \texttt{ucs} package to handle non-ASCII characters. Obviously, it is necessary to install the \texttt{ucs} package before using this option. See Section \ref{sec:non-ascii-characters} for more information.
-\item \texttt{--use-cjk-package}. This tells blahtex it may use the \LaTeX{} \texttt{CJK} package to handle Chinese/Japanese/Korean characters. Obviously, it is necessary to install the \texttt{CJK} package before using this option. See also Section \ref{sec:howto-japanese}.
-\item \texttt{--use-preview-package}. This tells blahtex it may use the \LaTeX{} \texttt{preview} package. Obviously, it is necessary to install the \texttt{preview} package before using this option. With this option enabled, blahtex is able to compute the height and depth of the output PNG image (via dvipng).
-\item \texttt{--japanese-font \textit{fontname}}. Specifies which font to use for characters surrounded by \texttt{\texcommand{jap}\{...\}}. See also Section \ref{sec:howto-japanese}.
-\item \texttt{--shell-latex \textit{command}}. Specifies the command to use for running \LaTeX{}. Default is just \texttt{latex}.
-\item \texttt{--shell-dvipng \textit{command}}. Specifies the command to use for running dvipng. Default is just \texttt{dvipng}.
-\item \texttt{--temp-directory \textit{directory}}. Specifies the directory that should be used for the intermediate files used during PNG creation. Default is the current directory.
-\item \texttt{--png-directory \textit{directory}}. Specifies the directory in which the PNG output file should be placed. Default is the current directory.
-\end{itemize}
-
-\subsubsection{Debugging options}
-
-\begin{itemize}
-\item \texttt{--throw-logic-error}. Simulates the effect of a debug assertion occurring, so that you can test any associated error-logging code.
-\item \texttt{--debug \textit{type}}. Enables some debugging output to assist in working out what is going on inside blahtex's head:
-\begin{itemize}
-\item \texttt{--debug parse}. Print the parse tree.
-\item \texttt{--debug layout}. Print the layout tree. This is an intermediate stage between parsing and MathML.
-\item \texttt{--debug purified}. Print `purified \TeX{}'. This is the complete \TeX{} file that blahtex sends to \LaTeX{} for PNG generation.
-\end{itemize}
-Multiple \texttt{--debug} options may be present. The format of debugging output is subject to change, and is not designed to be machine-readable; it will interrupt blahtex's usual XML output format in ghastly ways.
-\item \texttt{--keep-temp-files}. Instructs blahtex not to delete any of the temporary files that get created during PNG generation.
-\end{itemize}
-
-\subsection{Interpreting blahtex's output}\label{sec:interpreting-output}
-
-Blahtex's output looks like XML. (Unless a \emph{really fatal} error occurs :-)) By default, the output is completely ASCII, although there are command-line options which enable UTF-8 output for certain characters. The entire output is surrounded by the tags \texttt{<blahtex>...</blahtex>}. Inside these tags, there are several possibilities:
-
-\begin{itemize}
-\item If a debug assertion occurred (i.e.~if blahtex detected a bug within itself), you will see a \texttt{<logicError>...</logicError>} block. Between the \texttt{<logicError>} tags will be a string describing the error. If you ever see one of these, please report it to me.
-
-\item If there was a syntax error in the \TeX{} input, there will be a single \texttt{<error>...</error>} block which describes the error (the \texttt{<error>} block format is described in detail below). The possible error IDs that can occur here are:
-
-\begin{itemize}
-\item \texttt{InvalidUtf8Input}
-\item \texttt{IllegalCharacter}
-\item \texttt{TooManyTokens}
-\item \texttt{NonAsciiInMathMode}
-\item \texttt{ReservedCommand}
-\item \texttt{IllegalFinalBackslash}
-\item \texttt{UnrecognisedCommand}
-\item \texttt{IllegalCommandInMathMode}
-\item \texttt{IllegalCommandInMathModeWithHint}
-\item \texttt{IllegalCommandInTextMode}
-\item \texttt{IllegalCommandInTextModeWithHint}
-\item \texttt{MissingOpenBraceBefore}
-\item \texttt{MissingOpenBraceAfter}
-\item \texttt{MissingOpenBraceAtEnd}
-\item \texttt{NotEnoughArguments}
-\item \texttt{MissingCommandAfterNewcommand}
-\item \texttt{IllegalRedefinition}
-\item \texttt{MissingOrIllegalParameterCount}
-\item \texttt{MissingOrIllegalParameterIndex}
-\item \texttt{UnmatchedOpenBracket}
-\item \texttt{UnmatchedOpenBrace}
-\item \texttt{UnmatchedCloseBrace}
-\item \texttt{UnmatchedLeft}
-\item \texttt{UnmatchedRight}
-\item \texttt{UnmatchedBegin}
-\item \texttt{UnmatchedEnd}
-\item \texttt{UnexpectedNextCell}
-\item \texttt{UnexpectedNextRow}
-\item \texttt{MismatchedBeginAndEnd}
-\item \texttt{CasesRowTooBig}
-\item \texttt{SubstackRowTooBig}
-\item \texttt{MissingDelimiter}
-\item \texttt{IllegalDelimiter}
-\item \texttt{MisplacedLimits}
-\item \texttt{DoubleSuperscript}
-\item \texttt{DoubleSubscript}
-\item \texttt{AmbiguousInfix}
-\item \texttt{InvalidColour}
-\end{itemize}
-
-\item Assuming there were no syntax errors or debug assertions:
-
-\begin{itemize}
-
-\item If you gave the \texttt{--mathml} option at the command line, you will get a \texttt{<mathml>...</mathml>} block. If the MathML was generated successfully, the \texttt{<mathml>} block will contain a \texttt{<markup>...</markup>} block, containing the actual MathML. If there was a problem generating the MathML, the \texttt{<mathml>} block will instead contain an \texttt{<error>} block describing the problem. The only possible error IDs that can occur here are:
-\begin{itemize}
-\item \texttt{TooManyMathmlNodes}
-\item \texttt{UnavailableSymbolFontCombination}
-\end{itemize}
-
-\item If you gave the \texttt{--png} option at the command line, you will get a \texttt{<png>...</png>} block.
-
-If the PNG image was generated successfully, then it will be stored in a file called \texttt{X.png}, where \texttt{X} is an md5 hash (32 character lowercase hex string); the \texttt{<png>} block will then contain \texttt{<md5>X</md5>}. (In fact \texttt{X} is the md5 hash of the \TeX{} file that got sent to \LaTeX{} to generate the image.) If the option \texttt{--use-preview-package} was used, the \texttt{<png>} block will also contain blocks \texttt{<height>H</height>} and \texttt{<depth>D</depth>} which indicate the height and depth of the image, in pixels. (These are computed by \texttt{dvipng}.) If you want to display the PNG in a web page so that it is aligned with surrounding text, you can use the depth value as follows: \texttt{<img src="..." style="vertical-align:~-\textit{D}px">}.
-
-If there was an error generating the PNG file, the \texttt{<png>} block will instead contain an \texttt{<error>} block describing the problem. The possible error IDs here are:
-\begin{itemize}
-\item \texttt{CannotCreateTexFile}
-\item \texttt{CannotWriteTexFile}
-\item \texttt{CannotRunLatex}
-\item \texttt{CannotRunDvipng}
-\item \texttt{CannotWritePngDirectory}
-\item \texttt{CannotChangeDirectory}
-\item \texttt{LatexPackageUnavailable}
-\item \texttt{WrongFontEncoding}
-\item \texttt{WrongFontEncodingWithHint}
-\item \texttt{IllegalNestedFontEncodings}
-\item \texttt{LatexFontNotSpecified}
-\item \texttt{PngIncompatibleCharacter}
-\end{itemize}
-
-\end{itemize}
-\end{itemize}
-
-The \texttt{<error>} block (mentioned several times above) has the following format. First, it contains an \texttt{<id>...</id>} block, containing an error ID (i.e.~one of the CamelCase strings listed above). Next, a sequence of zero or more \texttt{<arg>...</arg>} blocks, representing the `arguments' of the error. Finally there is a \texttt{<message>...</message>} block, containing a translation of the error into English. For example, one possible error block is:
-
-\begin{quote}
-\texttt{<error>}\\
-\texttt{<id>MismatchedBeginAndEnd</id>}\\
-\texttt{<arg>\texcommand{begin}\{matrix\}</arg>}\\
-\texttt{<arg>\texcommand{end}\{array\}</arg>}\\
-\texttt{<message>The commands "\texcommand{begin}\{matrix\}" and "\texcommand{end}\{array\}" do not match</message>}\\
-\texttt{</error>}
-\end{quote}
-
-The simplest way to report the error to the user is to extract the \texttt{<message>} block. If you want to implement some localisation of error messages, you should use the \texttt{<id>} and \texttt{<arg>} fields. A complete list of error messages can be found in the source file \texttt{Messages.cpp}, or try the command-line option \texttt{--print-error-messages}. The error IDs may change in future versions of blahtex.
-
-\section{The blahtexml command-line application}\label{sec:blahtexml}
-
-The blahtexml source code is available from \texttt{http://gva.noekeon.org/blahtexml}.
-
-\subsection{System prerequisites}\label{sec:blahtexml-prerequisites}
-
-In addition to the prerequisites of blahtex (see Section~\ref{sec:prerequisites}), blahtexml requires one to have Xerces-C 2.x installed. Xerces-C is an XML parser library and is available at \texttt{http://xerces.apache.org/xerces-c/}. Blahtexml dynamically links to Xerces-C.
-
-\subsection{Compiling blahtexml}\label{sec:compiling-blahtexml}
-
-Unpack the source into your favourite directory.
-\begin{itemize}
-\item If you're running Linux, just type \texttt{make blahtexml-linux}.
-\item If you're running Mac OS X, try \texttt{make blahtexml-mac}.
-\end{itemize}
-You should then find an executable \texttt{blahtexml} in the current directory.
-
-\subsection{Using blahtexml}\label{sec:blahtexml-command-line-syntax}
-
-Blahtexml contains blahtex, which means that all the command-line options of blahtex are available with blahtexml. They are described in Section~\ref{sec:command-line-syntax}.
-
-What is specific to blahtexml is the \texttt{--xmlin} option. This tells blahtexml to input an XML file and to convert all the equations it finds into an output XML file, which contains the equivalent MathML code. All the elements, attributes and processing instructions are copied from the input to the output XML file, unchanged. When it encounters an equation in blahtex, it is converted into MathML.
-
-When used, the \texttt{--xmlin} option must be first. Note that, in this case, not all the blahtex command line options work. The options that are ignored when \texttt{--xmlin} is used are: \texttt{--png}, \texttt{--mathml-encoding}, \texttt{--other-encoding} and \texttt{--disallow-plane-1}.
-
-In the following, we describe how blahtexml locates blahtex formulas and how the process works exactly. For this, we assume that the reader has some familiarity with the XML syntax and with the XML namespaces.
-
-In an XML file, blahtexml looks for attributes with name \texttt{m}, \texttt{inline} or \texttt{block} in the namespace \texttt{http://gva.noekeon.org/blahtexml}. It will then remove this attribute and expand the produced MathML inside the element that contains the attribute. Let us just illustrate this with an example.
-
-Consider the following input file:
-\begin{verbatim}
-<?xml version="1.0"?>
-<equations xmlns:b="http://gva.noekeon.org/blahtexml">
- <equation b:inline="x+y"/>
- <equation b:block="\exp(-\gamma x)"/>
-</equations>
-\end{verbatim}
-
-By calling \texttt{blahtexml --xmlin < example1.xml}, blahtexml will produce the following output, where for clarity some MathML elements are not written:
-\begin{verbatim}
-<?xml version="1.0" encoding="UTF-8"?>
-<equations xmlns:b="http://gva.noekeon.org/blahtexml">
- <equation>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mi>x</mi>
- <mo lspace="0.222em" rspace="0.222em">+</mo>
- <mi>y</mi>
- </math>
- </equation>
- <equation>
- <math xmlns="http://www.w3.org/1998/Math/MathML"
- display="block">
- <mi>exp</mi>[...]
- </math>
- </equation>
-</equations>
-\end{verbatim}
-
-As one can see in this example, the \texttt{inline} attribute produces MathML in inline mode (the default of MathML), while the \texttt{block} attribute produces MathML in block mode by adding the attribute \texttt{display="block"} in the \texttt{math} element.
-
-The \texttt{m} element does not create a \texttt{math} element, but instead puts the MathML content as is. This can be useful if, e.g., one wants to type an equation partly in MathML and partly in blahtex. This is illustrated in the next example, where a blahtex equation is given inside a \texttt{msqrt} MathML element. The input file
-\begin{verbatim}
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <msqrt b:m="x+y"/>
- </math>
-</root>
-\end{verbatim}
-yields as output:
-\begin{verbatim}
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <msqrt>
- <mi>x</mi>
- <mo lspace="0.222em" rspace="0.222em">+</mo>
- <mi>y</mi>
- </msqrt>
- </math>
-</root>
-\end{verbatim}
-
-Note that if more than one attribute in the blahtex namespace are present, only one is processed, with \texttt{m} having the highest priority, then \texttt{inline} and finally \texttt{block}.
-
-\subsubsection{MathML namespace in output file}
-
-The MathML element produced in the output are in the MathML namespace, namely \texttt{http://www.w3.org/1998/Math/MathML}. There are two ways to express the namespace, either by adding the \texttt{xmlns} attribute to the outer MathML element, or by adding a prefix associated to the MathML namespace to all the MathML elements. By default, or using the \texttt{--mathml-nsprefix-auto} option, blahtexml automatically chooses between the two alternatives. Either a prefix already exists and blahtex reuses it, or such a prefix does not exist and an \texttt{xmlns} attribute is added.
-
-From the point of view of XML namespaces, both approaches are equivalent. Nevertheless, some XML applications predate the introduction of XML namespaces and it may sometimes be necessary to force either solution.
-
-\begin{itemize}
-\item \texttt{--mathml-nsprefix-auto}. This is the default option: blahtexml automatically chooses to add a prefix or not.
-\item \texttt{--mathml-nsprefix-none}. The produced MathML elements are not prefixed. The \texttt{xmlns} attribute is added to the outer MathML element.
-\item \texttt{--mathml-nsprefix}. This option requires a parameter: the prefix (string). The produced MathML elements are prefixed with the given prefix and a colon.
-\end{itemize}
-
-Consider the following input file:
-\begin{verbatim}
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <eq b:inline="x"/>
- <eq xmlns:m="http://www.w3.org/1998/Math/MathML" b:inline="x"/>
-</root>
-\end{verbatim}
-
-Invoking blahtexml using the default option \texttt{--mathml-nsprefix-auto}, one gets the following result:
-\begin{verbatim}
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <eq>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mi>x</mi>
- </math>
- </eq>
- <eq xmlns:m="http://www.w3.org/1998/Math/MathML">
- <m:math><m:mi>x</m:mi></m:math>
- </eq>
-</root>
-\end{verbatim}
-
-Using \texttt{--mathml-nsprefix-none}, one gets the following result:
-\begin{verbatim}
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <eq>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mi>x</mi>
- </math>
- </eq>
- <eq xmlns:m="http://www.w3.org/1998/Math/MathML">
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mi>x</mi>
- </math>
- </eq>
-</root>
-\end{verbatim}
-
-And using \texttt{--mathml-nsprefix m}, one gets the following result:
-\begin{verbatim}
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <eq>
- <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
- <m:mi>x</m:mi>
- </m:math>
- </eq>
- <eq xmlns:m="http://www.w3.org/1998/Math/MathML">
- <m:math><m:mi>x</m:mi></m:math>
- </eq>
-</root>
-\end{verbatim}
-
-
-\subsubsection{Output document type}
-
-By default, the generated XML file does not contain a document type declaration. If the output file is intended to a given XML application, a \texttt{DOCTYPE} declaration may be needed. The \texttt{--doctype-}* command-line options provide a way to specify this.
-
-\begin{itemize}
-\item \texttt{--doctype-system}. This option takes a reference to a DTD (string) as argument and causes blahtexml to output a \texttt{SYSTEM} document type declaration with the given reference.
-\item \texttt{--doctype-public}. This option takes two arguments: a public ID (string) and a reference to a DTD (string). Blahtex produces a \texttt{PUBLIC} document type declaration with the given public ID and reference.
-\item \texttt{--doctype-xhtml+mathml}. This option is equivalent to \texttt{--mathml-nsprefix-none} \texttt{--doctype-public} \texttt{"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"}
-\newline
-\texttt{"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"} and is useful to produce valid XHTML+MathML output.
-\end{itemize}
-
-\subsubsection{Error reporting}
-
-If a blahtex equation given in the input XML file generates an error during its conversion to MathML, blahtexml adds an \texttt{error} element (in the blahtex namespace) instead of the MathML elements. The blahtex formula is not discarded, so that the user can more easily see what caused the problem. Furthermore, the number of errors encountered is reported on the screen.
-
-For instance, the following input file
-\begin{verbatim}
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <eq b:inline="\qwerty"/>
-</root>
-\end{verbatim}
-generates the following output file
-\begin{verbatim}
-<root xmlns:b="http://gva.noekeon.org/blahtexml">
- <eq b:inline="\qwerty">
- <error xmlns="http://gva.noekeon.org/blahtexml">
- Unrecognised command "\qwerty"
- </error>
- </eq>
-</root>
-\end{verbatim}
-
-\subsubsection{Unicode symbol translation in math mode}\label{sec:blahtexml-input-symbol-translation}
-
-As detailed in Section~\ref{sec:input-symbol-translation}, blahtexml accepts some Unicode symbols and translates them into \TeX commands. For instance, the following three lines are equivalent and will give the same output:
-\begin{itemize}
-\item \verb|<eq b:inline="\Phi \leq \Omega \approx \Gamma"/>|
-\item \verb|<eq b:inline="|$\Phi \leq \Omega \approx \Gamma$\verb|"/>|
-\item \verb|<eq b:inline="&#x3A6;&#x2264;&#x3A9;&#x2248;&#x393;"/>|
-\end{itemize}
-
-The first line uses the traditional \TeX commands. The second line uses the Unicode symbols directly, assuming that the encoding of the XML file allows for it. Note that UTF-8, the default encoding in XML, includes all Unicode characters. The third line shows that it is also possible to use XML entities to input Unicode characters.
-
-\section{The blahtex API}\label{sec:API}
-
-This section gives a summary of how to link blahtex directly into a C++ application. You will need to write a wrapper if you want to use a different language. (If you do this, please consider sending me the wrapper so I can make it available for others to use.)
-
-\subsection{Core vs non-core}
-
-The blahtex source code is divided into two parts:
-\begin{itemize}
-\item The `blahtex core', whose source files are all in the \texttt{BlahtexCore} subdirectory. The core does all the hard work involved in translating \TeX{} to MathML, and the not-as-hard work of preparing a complete \TeX{} file to be sent to \LaTeX{} to generate the PNG image. It does not include any functionality which may be more OS-dependent; pretty much all it does is allocate memory and push strings around.
-\item The blahtex command-line application, whose source files are in the main \texttt{source} directory. This `non-core' source is basically a wrapper that turns the blahtex core into a command-line application, and additionally handles shelling out to \LaTeX{} to generate the PNG output.
-\end{itemize}
-
-
-\subsection{How to use the core}
-
-To use the blahtex core in your C++ application, you should follow these steps:
-
-\begin{enumerate}
-\item Copy the \texttt{BlahtexCore} directory to wherever your project is.
-\item Any source file that wants to access the blahtex core needs to \texttt{\#include "BlahtexCore/Interface.h"}.
-\item Everything in the blahtex core is in the \texttt{blahtex} namespace. So, you might also consider \texttt{using namespace blahtex}.
-\item Declare an object of type \texttt{blahtex::Interface}. (It's perfectly okay to have several \texttt{Interface} objects lying around; they won't get in each other's way.)
-\item You can set various conversion options by setting the public member variables of the \texttt{Interface} object. See the header file \texttt{Interface.h} for a list of members. The structs \texttt{MathmlOptions}, \texttt{EncodingOptions} and \texttt{PurifiedTexOptions} are described in detail in the header file \texttt{Misc.h}; they basically correspond to various command-line options (see Section \ref{sec:command-line-syntax}).
-\item Call the member function \texttt{Interface::ProcessInput(x)}, where \texttt{x} is a \texttt{wstring} containing the input \TeX{}.
-\item You can call the member function \texttt{Interface::GetMathml()} to get the MathML translation as a \texttt{wstring}.
-\item You can call the member function \texttt{Interface::GetPurifiedTex()} to get the `purified \TeX{}' as a \texttt{wstring}; this is a complete \TeX{} file that could be sent to \LaTeX{} to generate graphical output.
-\item Any of the above functions can throw exception objects if something goes wrong, so you probably need to worry about \texttt{catch}ing them. They will throw a \texttt{std::logic\_error} object if a debug assertion occurs. They will throw a \texttt{blahtex::Exception} object to indicate a syntax error in the input, or if there is a problem in generating the MathML or purified \TeX{}. The \texttt{blahtex::Exception} object is documented in \texttt{Misc.h}. If you need the error translated to English, you probably want to check out the \texttt{GetErrorMessage} function in \texttt{Messages.cpp} (not part of the blahtex core).
-\end{enumerate}
-
-
-\subsection{Dealing with \texttt{wstring}}
-
-The blahtex core is internally Unicode throughout, and works exclusively with wide strings --- \texttt{wstring}, not \texttt{string}. If your code only deals with ASCII strings, or UTF-8, you will need a way of converting between narrow and wide strings. The blahtex command-line application has a class \texttt{UnicodeConverter} which provides precisely this functionality; it is essentially a C++ wrapper for the \texttt{iconv} library in terms of \texttt{string} (for storing UTF-8 strings) and \texttt{wstring} (for storing UCS-32 strings; endianness depends on the platform). To use this class:
-\begin{enumerate}
-\item Put \texttt{UnicodeConverter.cpp} and \texttt{UnicodeConverter.h} in your project directory, and make sure you \texttt{\#include "UnicodeConverter.h"}.
-\item Link against the \texttt{iconv} library. You may need to compile and install \texttt{iconv}, and possibly use the linker switch \texttt{-liconv}.
-\item On some systems (including Mac OS X, but not Linux), you need to define the constant \texttt{BLAHTEX\_ICONV\_CONST} for \texttt{UnicodeConverter.cpp}, otherwise you'll probably get compiler warnings. See the source for an explanation.
-\item Declare a \texttt{UnicodeConverter} object and call \texttt{Open()}. This sets up the underlying \texttt{iconv\_t} handles.
-\item Use the \texttt{ConvertIn} and \texttt{ConvertOut} member functions to convert between UTF-8 and UCS-32.
-\item The \texttt{UnicodeConverter} class can also throw exceptions if something goes wrong (for example, invalid UTF-8 input). See the source for details.
-\end{enumerate}
-
-\section{History/changelog}\label{sec:history}
-
-\begin{itemize}
-\item Version 0.1 (Jul/2005). You don't want to know about this one.
-\item Version 0.2 (2/Aug/2005). Initial public release.
-\item Version 0.2.1 (8/Aug/2005). Now compiles under Linux.
-\item Version 0.3.x (Aug 2005 to Jan 2006). Series of internal development releases, everything getting completely rewritten. It would be an act of irresponsibility to list every change.
-\item Version 0.4 (29/Jan/2006). Accompanies announcement of test wiki.
-\item Version 0.4.1 (8/Feb/2006). Added \texttt{--compute-vertical-shift} option.
-\item Version 0.4.2 (12/Feb/2006).
-\begin{itemize}
-\item Greatly improved coverage of symbols in \LaTeX{} and AMS-\LaTeX.
-\item Greatly improved coverage of \texttt{\texcommand{not}}.
-\item Now \texttt{UnavailableSymbolFontCombination} and \texttt{InvalidNegation} errors are only flagged during MathML output; i.e.~these errors no longer prevent PNG output.
-\item Added \texttt{--keep-temp-files} option.
-\item Fixed a PNG clipping bug in certain cases where dvips gets the PS bounding box incorrect. For example, when translating \texttt{\texcommand{displaystyle} \texcommand{int}}, half of the integral sign would go missing. (This bug affects texvc too.)
-\item Changed behaviour of \texttt{<vshift>} block; now such a block appears even if the shift should be zero.
-\item Fixed a few incorrect MathML characters.
-\end{itemize}
-\item Version 0.4.3 (25/Feb/2006).
-\begin{itemize}
-\item Now supports \texttt{\texcommand{color}}; added corresponding error code \texttt{InvalidColour}.
-\item Numerous internal structural changes, especially an overhaul of the MathML output code.
-\item Improved node merging heuristics, for things like \texttt{123\textasciicircum5}.
-\item Corrected parsing of \texttt{\texcommand{not}}. Now blahtex will make a reasonable attempt on any \texttt{\texcommand{not}} that comes its way; the \texttt{InvalidNegation} error message has consequently been removed.
-\item Fixed a bug that caused incorrect font attributes for input like \texttt{\texcommand{rm} \texcommand{boldsymbol} x}.
-\item Added the \texttt{\texcommand{ast}} command (how did I ever miss that?)
-\end{itemize}
-\item Version 0.4.4 (25/Mar/2006).
-\begin{itemize}
-\item Changed default spacing mode from \texttt{moderate} to \texttt{strict}.
-\item Changed from using dvips/ImageMagick to dvipng. Consequently the \texttt{--shell-dvips}, \texttt{--shell-convert} and \texttt{--convert-options} options have been removed, and replaced by \texttt{--shell-dvipng}. The error messages \texttt{CannotRunConvert} and \texttt{CannotRunDvips} have been removed and replaced by \texttt{CannotRunDvipng} and \texttt{CannotWritePngDirectory}.
-\item Added flag \texttt{--use-preview-package}.
-\item Removed the \texttt{--compute-vertical-shift} option; now the vertical shift is always computed (by dvipng) as long as the \LaTeX{} \texttt{preview} package is loaded, but its name has been changed to `depth'. Accordingly, the \texttt{<vshift>} output block has been replaced by \texttt{<height>} and \texttt{<depth>} blocks. The numbers themselves are now computed by dvipng, which is much neater and more reliable.
-\item Added support for Cyrillic and Japanese in PNG output:
-\begin{itemize}
-\item Added \texttt{--use-cjk-package} and \texttt{--japanese-font} options.
-\item Added commands \texttt{\texcommand{cyr}} and \texttt{\texcommand{jap}}.
-\item Added error messages:
-\begin{itemize}
-\item \texttt{WrongFontEncoding}
-\item \texttt{WrongFontEncodingWithHint}
-\item \texttt{IllegalNestedFontEncodigs}
-\item \texttt{LatexPackageUnavailable}
-\item \texttt{LatexFontNotSpecified}
-\end{itemize}
-\end{itemize}
-\item Corrected MathML characters for \texttt{\texcommand{longrightarrow}} and friends; however they are currently disabled because of poor font support.
-\item Fixed spacing for \texttt{\texcommand{substack}} and the \texttt{aligned} environment. Note however that Firefox still doesn't support the requisite \texttt{rowspacing} and \texttt{columnspacing} attributes, so it won't look right yet in Firefox.
-\item Changed format of \texttt{--print-error-messages} slightly.
-\item Finished adding MathML character names for all commands added in version 0.4.2.
-\end{itemize}
-\item Version blahtexml 0.4.4 (2/Nov/2007) by GVA
-\begin{itemize}
-\item Added the blahtexml extension.
-\end{itemize}
-\item Version blahtexml 0.5 (16/May/2008) by GVA
-\begin{itemize}
-\item Added input symbol translation.
-\item Improved makefile based on user feedback (Mac compilation, lower optimization level, documentation generation).
-\end{itemize}
-\end{itemize}
-
-\end{document}
diff --git a/blahtexml/source/BlahtexCore/ISTtoCpp.xslt b/blahtexml/source/BlahtexCore/ISTtoCpp.xslt
deleted file mode 100644
index 686dbb7..0000000
--- a/blahtexml/source/BlahtexCore/ISTtoCpp.xslt
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-// File "ISTtoCpp.xslt"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
-
-<xsl:output method="text" indent="no" encoding="UTF-8"/>
-
-<xsl:template match="symbols">
- <xsl:apply-templates select="symbol"/>
-</xsl:template>
-
-<xsl:template match="symbol">
- <xsl:text> make_pair(L'\U</xsl:text>
- <xsl:value-of select="@unicode"/>
- <xsl:text>', L"</xsl:text>
- <xsl:if test="starts-with(@tex, '\')">
- <xsl:text>\</xsl:text>
- </xsl:if>
- <xsl:value-of select="@tex"/>
- <xsl:text>")</xsl:text>
- <xsl:if test="position()&lt;last()">
- <xsl:text>,</xsl:text>
- </xsl:if>
- <xsl:text>
-</xsl:text>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/blahtexml/source/BlahtexCore/InputSymbolTranslation.cpp b/blahtexml/source/BlahtexCore/InputSymbolTranslation.cpp
deleted file mode 100644
index 261808a..0000000
--- a/blahtexml/source/BlahtexCore/InputSymbolTranslation.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-// File "InputSymbolTranslation.cpp"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <map>
-#include <memory>
-#include <stdexcept>
-#include "Misc.h"
-#include "InputSymbolTranslation.h"
-
-using namespace std;
-
-namespace blahtex {
-
-pair<wchar_t, wstring> equivalentInputSymbolsArray[] =
-{
-#include "InputSymbolTranslation.inc"
-};
-wishful_hash_map<wchar_t, wstring> equivalentInputSymbolsTable(
- equivalentInputSymbolsArray,
- END_ARRAY(equivalentInputSymbolsArray)
-);
-
-wstring translateToken(const wstring& token)
-{
- if (token.length() == 1) {
- wishful_hash_map<wchar_t, wstring>::const_iterator
- equivalentInputSymbolsLookup = equivalentInputSymbolsTable.find(token[0]);
- if (equivalentInputSymbolsLookup != equivalentInputSymbolsTable.end())
- return equivalentInputSymbolsLookup->second;
- else
- return token;
- }
- else
- return token;
-}
-
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/InputSymbolTranslation.h b/blahtexml/source/BlahtexCore/InputSymbolTranslation.h
deleted file mode 100644
index c1b67f3..0000000
--- a/blahtexml/source/BlahtexCore/InputSymbolTranslation.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// File "InputSymbolTranslation.h"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_INPUTSYMBOLTRANSLATION_H
-#define BLAHTEX_INPUTSYMBOLTRANSLATION_H
-
-
-namespace blahtex
-{
-
-std::wstring translateToken(const std::wstring& token);
-
-}
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/InputSymbolTranslation.inc b/blahtexml/source/BlahtexCore/InputSymbolTranslation.inc
deleted file mode 100644
index f15fe11..0000000
--- a/blahtexml/source/BlahtexCore/InputSymbolTranslation.inc
+++ /dev/null
@@ -1,344 +0,0 @@
- make_pair(L'\U000000AC', L"\\lnot"),
- make_pair(L'\U000000B1', L"\\pm"),
- make_pair(L'\U000000D7', L"\\times"),
- make_pair(L'\U000000F7', L"\\div"),
- make_pair(L'\U00000393', L"\\Gamma"),
- make_pair(L'\U00000394', L"\\Delta"),
- make_pair(L'\U00000398', L"\\Theta"),
- make_pair(L'\U0000039B', L"\\Lambda"),
- make_pair(L'\U0000039E', L"\\Xi"),
- make_pair(L'\U000003A0', L"\\Pi"),
- make_pair(L'\U000003A3', L"\\Sigma"),
- make_pair(L'\U000003A5', L"\\Upsilon"),
- make_pair(L'\U000003A6', L"\\Phi"),
- make_pair(L'\U000003A8', L"\\Psi"),
- make_pair(L'\U000003A9', L"\\Omega"),
- make_pair(L'\U000003B1', L"\\alpha"),
- make_pair(L'\U000003B2', L"\\beta"),
- make_pair(L'\U000003B3', L"\\gamma"),
- make_pair(L'\U000003B4', L"\\delta"),
- make_pair(L'\U000003B5', L"\\varepsilon"),
- make_pair(L'\U000003B6', L"\\zeta"),
- make_pair(L'\U000003B7', L"\\eta"),
- make_pair(L'\U000003B8', L"\\theta"),
- make_pair(L'\U000003B9', L"\\iota"),
- make_pair(L'\U000003BA', L"\\kappa"),
- make_pair(L'\U000003BB', L"\\lambda"),
- make_pair(L'\U000003BC', L"\\mu"),
- make_pair(L'\U000003BD', L"\\nu"),
- make_pair(L'\U000003BE', L"\\xi"),
- make_pair(L'\U000003C0', L"\\pi"),
- make_pair(L'\U000003C1', L"\\rho"),
- make_pair(L'\U000003C2', L"\\varsigma"),
- make_pair(L'\U000003C3', L"\\sigma"),
- make_pair(L'\U000003C4', L"\\tau"),
- make_pair(L'\U000003C5', L"\\upsilon"),
- make_pair(L'\U000003C6', L"\\varphi"),
- make_pair(L'\U000003C7', L"\\chi"),
- make_pair(L'\U000003C8', L"\\psi"),
- make_pair(L'\U000003C9', L"\\omega"),
- make_pair(L'\U000003D1', L"\\vartheta"),
- make_pair(L'\U000003D5', L"\\phi"),
- make_pair(L'\U000003D6', L"\\varpi"),
- make_pair(L'\U000003DD', L"\\digamma"),
- make_pair(L'\U000003F0', L"\\varkappa"),
- make_pair(L'\U000003F1', L"\\varrho"),
- make_pair(L'\U000003F5', L"\\epsilon"),
- make_pair(L'\U000003F6', L"\\backepsilon"),
- make_pair(L'\U00002020', L"\\dagger"),
- make_pair(L'\U00002021', L"\\ddagger"),
- make_pair(L'\U00002022', L"\\bullet"),
- make_pair(L'\U00002026', L"\\dots"),
- make_pair(L'\U00002032', L"\\prime"),
- make_pair(L'\U00002035', L"\\backprime"),
- make_pair(L'\U00002190', L"\\leftarrow"),
- make_pair(L'\U00002191', L"\\uparrow"),
- make_pair(L'\U00002192', L"\\rightarrow"),
- make_pair(L'\U00002193', L"\\downarrow"),
- make_pair(L'\U00002194', L"\\leftrightarrow"),
- make_pair(L'\U00002195', L"\\updownarrow"),
- make_pair(L'\U00002196', L"\\nwarrow"),
- make_pair(L'\U00002197', L"\\nearrow"),
- make_pair(L'\U00002198', L"\\searrow"),
- make_pair(L'\U00002199', L"\\swarrow"),
- make_pair(L'\U0000219A', L"\\nleftarrow"),
- make_pair(L'\U0000219B', L"\\nrightarrow"),
- make_pair(L'\U0000219D', L"\\rightsquigarrow"),
- make_pair(L'\U0000219E', L"\\twoheadleftarrow"),
- make_pair(L'\U000021A0', L"\\twoheadrightarrow"),
- make_pair(L'\U000021A2', L"\\leftarrowtail"),
- make_pair(L'\U000021A3', L"\\rightarrowtail"),
- make_pair(L'\U000021A6', L"\\mapsto"),
- make_pair(L'\U000021A9', L"\\hookleftarrow"),
- make_pair(L'\U000021AA', L"\\hookrightarrow"),
- make_pair(L'\U000021AB', L"\\looparrowleft"),
- make_pair(L'\U000021AC', L"\\looparrowright"),
- make_pair(L'\U000021AD', L"\\leftrightsquigarrow"),
- make_pair(L'\U000021AE', L"\\nleftrightarrow"),
- make_pair(L'\U000021B0', L"\\Lsh"),
- make_pair(L'\U000021B1', L"\\Rsh"),
- make_pair(L'\U000021B6', L"\\curvearrowleft"),
- make_pair(L'\U000021B7', L"\\curvearrowright"),
- make_pair(L'\U000021BA', L"\\circlearrowleft"),
- make_pair(L'\U000021BB', L"\\circlearrowright"),
- make_pair(L'\U000021BC', L"\\leftharpoonup"),
- make_pair(L'\U000021BD', L"\\leftharpoondown"),
- make_pair(L'\U000021BE', L"\\upharpoonright"),
- make_pair(L'\U000021BF', L"\\upharpoonleft"),
- make_pair(L'\U000021C0', L"\\rightharpoonup"),
- make_pair(L'\U000021C1', L"\\rightharpoondown"),
- make_pair(L'\U000021C2', L"\\downharpoonright"),
- make_pair(L'\U000021C3', L"\\downharpoonleft"),
- make_pair(L'\U000021C4', L"\\rightleftarrows"),
- make_pair(L'\U000021C6', L"\\leftrightarrows"),
- make_pair(L'\U000021C7', L"\\leftleftarrows"),
- make_pair(L'\U000021C8', L"\\upuparrows"),
- make_pair(L'\U000021C9', L"\\rightrightarrows"),
- make_pair(L'\U000021CA', L"\\downdownarrows"),
- make_pair(L'\U000021CB', L"\\leftrightharpoons"),
- make_pair(L'\U000021CC', L"\\rightleftharpoons"),
- make_pair(L'\U000021CD', L"\\nLeftarrow"),
- make_pair(L'\U000021CE', L"\\nLeftrightarrow"),
- make_pair(L'\U000021CF', L"\\nRightarrow"),
- make_pair(L'\U000021D0', L"\\Leftarrow"),
- make_pair(L'\U000021D1', L"\\Uparrow"),
- make_pair(L'\U000021D2', L"\\Rightarrow"),
- make_pair(L'\U000021D3', L"\\Downarrow"),
- make_pair(L'\U000021D4', L"\\Leftrightarrow"),
- make_pair(L'\U000021D5', L"\\Updownarrow"),
- make_pair(L'\U000021DA', L"\\Lleftarrow"),
- make_pair(L'\U000021DB', L"\\Rrightarrow"),
- make_pair(L'\U000021DD', L"\\leadsto"),
- make_pair(L'\U00002200', L"\\forall"),
- make_pair(L'\U00002201', L"\\complement"),
- make_pair(L'\U00002203', L"\\exists"),
- make_pair(L'\U00002204', L"\\nexists"),
- make_pair(L'\U00002207', L"\\nabla"),
- make_pair(L'\U00002208', L"\\in"),
- make_pair(L'\U00002209', L"\\notin"),
- make_pair(L'\U0000220B', L"\\ni"),
- make_pair(L'\U0000220F', L"\\prod"),
- make_pair(L'\U00002210', L"\\coprod"),
- make_pair(L'\U00002211', L"\\sum"),
- make_pair(L'\U00002213', L"\\mp"),
- make_pair(L'\U00002214', L"\\dotplus"),
- make_pair(L'\U00002218', L"\\circ"),
- make_pair(L'\U0000221A', L"\\surd"),
- make_pair(L'\U0000221D', L"\\propto"),
- make_pair(L'\U00002220', L"\\angle"),
- make_pair(L'\U00002221', L"\\measuredangle"),
- make_pair(L'\U00002222', L"\\sphericalangle"),
- make_pair(L'\U00002224', L"\\nmid"),
- make_pair(L'\U00002225', L"\\parallel"),
- make_pair(L'\U00002226', L"\\nparallel"),
- make_pair(L'\U00002227', L"\\wedge"),
- make_pair(L'\U00002228', L"\\vee"),
- make_pair(L'\U00002229', L"\\cap"),
- make_pair(L'\U0000222A', L"\\cup"),
- make_pair(L'\U0000222B', L"\\int"),
- make_pair(L'\U0000222C', L"\\iint"),
- make_pair(L'\U0000222D', L"\\iiint"),
- make_pair(L'\U0000222E', L"\\oint"),
- make_pair(L'\U00002234', L"\\therefore"),
- make_pair(L'\U00002235', L"\\because"),
- make_pair(L'\U0000223C', L"\\sim"),
- make_pair(L'\U0000223D', L"\\backsim"),
- make_pair(L'\U00002240', L"\\wr"),
- make_pair(L'\U00002241', L"\\nsim"),
- make_pair(L'\U00002242', L"\\eqsim"),
- make_pair(L'\U00002243', L"\\simeq"),
- make_pair(L'\U00002245', L"\\cong"),
- make_pair(L'\U00002247', L"\\ncong"),
- make_pair(L'\U00002248', L"\\approx"),
- make_pair(L'\U0000224A', L"\\approxeq"),
- make_pair(L'\U0000224E', L"\\Bumpeq"),
- make_pair(L'\U0000224F', L"\\bumpeq"),
- make_pair(L'\U00002250', L"\\doteq"),
- make_pair(L'\U00002251', L"\\doteqdot"),
- make_pair(L'\U00002252', L"\\fallingdotseq"),
- make_pair(L'\U00002253', L"\\risingdotseq"),
- make_pair(L'\U00002256', L"\\eqcirc"),
- make_pair(L'\U00002257', L"\\circeq"),
- make_pair(L'\U0000225C', L"\\triangleq"),
- make_pair(L'\U00002260', L"\\neq"),
- make_pair(L'\U00002261', L"\\equiv"),
- make_pair(L'\U00002264', L"\\leq"),
- make_pair(L'\U00002265', L"\\geq"),
- make_pair(L'\U00002266', L"\\leqq"),
- make_pair(L'\U00002267', L"\\geqq"),
- make_pair(L'\U00002268', L"\\lneqq"),
- make_pair(L'\U00002269', L"\\gneqq"),
- make_pair(L'\U0000226A', L"\\ll"),
- make_pair(L'\U0000226B', L"\\gg"),
- make_pair(L'\U0000226C', L"\\between"),
- make_pair(L'\U0000226E', L"\\nless"),
- make_pair(L'\U0000226F', L"\\ngtr"),
- make_pair(L'\U00002270', L"\\nleq"),
- make_pair(L'\U00002271', L"\\ngeq"),
- make_pair(L'\U00002272', L"\\lesssim"),
- make_pair(L'\U00002273', L"\\gtrsim"),
- make_pair(L'\U00002276', L"\\lessgtr"),
- make_pair(L'\U00002277', L"\\gtrless"),
- make_pair(L'\U0000227A', L"\\prec"),
- make_pair(L'\U0000227B', L"\\succ"),
- make_pair(L'\U0000227C', L"\\preccurlyeq"),
- make_pair(L'\U0000227D', L"\\succcurlyeq"),
- make_pair(L'\U0000227E', L"\\precsim"),
- make_pair(L'\U0000227F', L"\\succsim"),
- make_pair(L'\U00002280', L"\\nprec"),
- make_pair(L'\U00002281', L"\\nsucc"),
- make_pair(L'\U00002282', L"\\subset"),
- make_pair(L'\U00002283', L"\\supset"),
- make_pair(L'\U00002286', L"\\subseteq"),
- make_pair(L'\U00002287', L"\\supseteq"),
- make_pair(L'\U00002288', L"\\nsubseteq"),
- make_pair(L'\U00002289', L"\\nsupseteq"),
- make_pair(L'\U0000228A', L"\\subsetneq"),
- make_pair(L'\U0000228B', L"\\supsetneq"),
- make_pair(L'\U0000228E', L"\\uplus"),
- make_pair(L'\U0000228F', L"\\sqsubset"),
- make_pair(L'\U00002290', L"\\sqsupset"),
- make_pair(L'\U00002291', L"\\sqsubseteq"),
- make_pair(L'\U00002292', L"\\sqsupseteq"),
- make_pair(L'\U00002293', L"\\sqcap"),
- make_pair(L'\U00002294', L"\\sqcup"),
- make_pair(L'\U00002295', L"\\oplus"),
- make_pair(L'\U00002296', L"\\ominus"),
- make_pair(L'\U00002297', L"\\otimes"),
- make_pair(L'\U00002298', L"\\oslash"),
- make_pair(L'\U00002299', L"\\odot"),
- make_pair(L'\U0000229A', L"\\circledcirc"),
- make_pair(L'\U0000229B', L"\\circledast"),
- make_pair(L'\U0000229D', L"\\circleddash"),
- make_pair(L'\U0000229E', L"\\boxplus"),
- make_pair(L'\U0000229F', L"\\boxminus"),
- make_pair(L'\U000022A0', L"\\boxtimes"),
- make_pair(L'\U000022A1', L"\\boxdot"),
- make_pair(L'\U000022A2', L"\\vdash"),
- make_pair(L'\U000022A3', L"\\dashv"),
- make_pair(L'\U000022A4', L"\\top"),
- make_pair(L'\U000022A5', L"\\bot"),
- make_pair(L'\U000022A7', L"\\models"),
- make_pair(L'\U000022A8', L"\\vDash"),
- make_pair(L'\U000022A9', L"\\Vdash"),
- make_pair(L'\U000022AA', L"\\Vvdash"),
- make_pair(L'\U000022AC', L"\\nvdash"),
- make_pair(L'\U000022AD', L"\\nvDash"),
- make_pair(L'\U000022AE', L"\\nVdash"),
- make_pair(L'\U000022AF', L"\\nVDash"),
- make_pair(L'\U000022B2', L"\\lhd"),
- make_pair(L'\U000022B3', L"\\rhd"),
- make_pair(L'\U000022B4', L"\\unlhd"),
- make_pair(L'\U000022B5', L"\\unrhd"),
- make_pair(L'\U000022B8', L"\\multimap"),
- make_pair(L'\U000022BA', L"\\intercal"),
- make_pair(L'\U000022BB', L"\\veebar"),
- make_pair(L'\U000022C0', L"\\bigwedge"),
- make_pair(L'\U000022C1', L"\\bigvee"),
- make_pair(L'\U000022C2', L"\\bigcap"),
- make_pair(L'\U000022C3', L"\\bigcup"),
- make_pair(L'\U000022C4', L"\\diamond"),
- make_pair(L'\U000022C5', L"\\cdot"),
- make_pair(L'\U000022C6', L"\\star"),
- make_pair(L'\U000022C7', L"\\divideontimes"),
- make_pair(L'\U000022C8', L"\\bowtie"),
- make_pair(L'\U000022C9', L"\\ltimes"),
- make_pair(L'\U000022CA', L"\\rtimes"),
- make_pair(L'\U000022CB', L"\\leftthreetimes"),
- make_pair(L'\U000022CC', L"\\rightthreetimes"),
- make_pair(L'\U000022CD', L"\\backsimeq"),
- make_pair(L'\U000022CE', L"\\curlyvee"),
- make_pair(L'\U000022CF', L"\\curlywedge"),
- make_pair(L'\U000022D0', L"\\Subset"),
- make_pair(L'\U000022D1', L"\\Supset"),
- make_pair(L'\U000022D2', L"\\Cap"),
- make_pair(L'\U000022D3', L"\\Cup"),
- make_pair(L'\U000022D4', L"\\pitchfork"),
- make_pair(L'\U000022D6', L"\\lessdot"),
- make_pair(L'\U000022D7', L"\\gtrdot"),
- make_pair(L'\U000022D8', L"\\lll"),
- make_pair(L'\U000022D9', L"\\ggg"),
- make_pair(L'\U000022DA', L"\\lesseqgtr"),
- make_pair(L'\U000022DB', L"\\gtreqless"),
- make_pair(L'\U000022DE', L"\\curlyeqprec"),
- make_pair(L'\U000022DF', L"\\curlyeqsucc"),
- make_pair(L'\U000022E6', L"\\lnsim"),
- make_pair(L'\U000022E7', L"\\gnsim"),
- make_pair(L'\U000022E8', L"\\precnsim"),
- make_pair(L'\U000022E9', L"\\succnsim"),
- make_pair(L'\U000022EA', L"\\ntriangleleft"),
- make_pair(L'\U000022EB', L"\\ntriangleright"),
- make_pair(L'\U000022EC', L"\\ntrianglelefteq"),
- make_pair(L'\U000022ED', L"\\ntrianglerighteq"),
- make_pair(L'\U000022EE', L"\\vdots"),
- make_pair(L'\U000022EF', L"\\cdots"),
- make_pair(L'\U000022F1', L"\\ddots"),
- make_pair(L'\U00002305', L"\\barwedge"),
- make_pair(L'\U00002306', L"\\doublebarwedge"),
- make_pair(L'\U00002308', L"\\lceil"),
- make_pair(L'\U00002309', L"\\rceil"),
- make_pair(L'\U0000230A', L"\\lfloor"),
- make_pair(L'\U0000230B', L"\\rfloor"),
- make_pair(L'\U0000231C', L"\\ulcorner"),
- make_pair(L'\U0000231D', L"\\urcorner"),
- make_pair(L'\U0000231E', L"\\llcorner"),
- make_pair(L'\U0000231F', L"\\lrcorner"),
- make_pair(L'\U00002322', L"\\frown"),
- make_pair(L'\U00002323', L"\\smile"),
- make_pair(L'\U000027E8', L"\\langle"),
- make_pair(L'\U000027E9', L"\\rangle"),
- make_pair(L'\U000025A1', L"\\square"),
- make_pair(L'\U000025B3', L"\\triangle"),
- make_pair(L'\U000025B4', L"\\blacktriangle"),
- make_pair(L'\U000025B5', L"\\vartriangle"),
- make_pair(L'\U000025B6', L"\\blacktriangleright"),
- make_pair(L'\U000025B9', L"\\triangleright"),
- make_pair(L'\U000025BD', L"\\bigtriangledown"),
- make_pair(L'\U000025BE', L"\\blacktriangledown"),
- make_pair(L'\U000025BF', L"\\triangledown"),
- make_pair(L'\U000025C0', L"\\blacktriangleleft"),
- make_pair(L'\U000025C3', L"\\triangleleft"),
- make_pair(L'\U000025CA', L"\\lozenge"),
- make_pair(L'\U000025EF', L"\\bigcirc"),
- make_pair(L'\U000025FC', L"\\blacksquare"),
- make_pair(L'\U00002605', L"\\bigstar"),
- make_pair(L'\U00002660', L"\\spadesuit"),
- make_pair(L'\U00002663', L"\\clubsuit"),
- make_pair(L'\U00002665', L"\\heartsuit"),
- make_pair(L'\U00002666', L"\\diamondsuit"),
- make_pair(L'\U0000266D', L"\\flat"),
- make_pair(L'\U0000266E', L"\\natural"),
- make_pair(L'\U0000266F', L"\\sharp"),
- make_pair(L'\U00002713', L"\\checkmark"),
- make_pair(L'\U0000290E', L"\\dashleftarrow"),
- make_pair(L'\U0000290F', L"\\dashrightarrow"),
- make_pair(L'\U000029EB', L"\\blacklozenge"),
- make_pair(L'\U00002A00', L"\\bigodot"),
- make_pair(L'\U00002A01', L"\\bigoplus"),
- make_pair(L'\U00002A02', L"\\bigotimes"),
- make_pair(L'\U00002A04', L"\\biguplus"),
- make_pair(L'\U00002A06', L"\\bigsqcup"),
- make_pair(L'\U00002A0C', L"\\iiiint"),
- make_pair(L'\U00002A3F', L"\\amalg"),
- make_pair(L'\U00002A7D', L"\\leqslant"),
- make_pair(L'\U00002A7E', L"\\geqslant"),
- make_pair(L'\U00002A85', L"\\lessapprox"),
- make_pair(L'\U00002A86', L"\\gtrapprox"),
- make_pair(L'\U00002A89', L"\\lnapprox"),
- make_pair(L'\U00002A8A', L"\\gnapprox"),
- make_pair(L'\U00002A8B', L"\\lesseqqgtr"),
- make_pair(L'\U00002A8C', L"\\gtreqqless"),
- make_pair(L'\U00002A95', L"\\eqslantless"),
- make_pair(L'\U00002A96', L"\\eqslantgtr"),
- make_pair(L'\U00002AAF', L"\\preceq"),
- make_pair(L'\U00002AB0', L"\\succeq"),
- make_pair(L'\U00002AB5', L"\\precneqq"),
- make_pair(L'\U00002AB6', L"\\succneqq"),
- make_pair(L'\U00002AB7', L"\\precapprox"),
- make_pair(L'\U00002AB8', L"\\succapprox"),
- make_pair(L'\U00002AB9', L"\\precnapprox"),
- make_pair(L'\U00002ABA', L"\\succnapprox"),
- make_pair(L'\U00002AC5', L"\\subseteqq"),
- make_pair(L'\U00002AC6', L"\\supseteqq"),
- make_pair(L'\U00002ACB', L"\\subsetneqq"),
- make_pair(L'\U00002ACC', L"\\supsetneqq")
diff --git a/blahtexml/source/BlahtexCore/InputSymbolTranslation.xml b/blahtexml/source/BlahtexCore/InputSymbolTranslation.xml
deleted file mode 100644
index 4f460ea..0000000
--- a/blahtexml/source/BlahtexCore/InputSymbolTranslation.xml
+++ /dev/null
@@ -1,367 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-// File "InputSymbolTranslation.xml"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--->
-<symbols>
- <symbol unicode="000000AC" tex="\lnot"/>
- <symbol unicode="000000B1" tex="\pm"/>
- <symbol unicode="000000D7" tex="\times"/>
- <symbol unicode="000000F7" tex="\div"/>
- <symbol unicode="00000393" tex="\Gamma"/>
- <symbol unicode="00000394" tex="\Delta"/>
- <symbol unicode="00000398" tex="\Theta"/>
- <symbol unicode="0000039B" tex="\Lambda"/>
- <symbol unicode="0000039E" tex="\Xi"/>
- <symbol unicode="000003A0" tex="\Pi"/>
- <symbol unicode="000003A3" tex="\Sigma"/>
- <symbol unicode="000003A5" tex="\Upsilon"/>
- <symbol unicode="000003A6" tex="\Phi"/>
- <symbol unicode="000003A8" tex="\Psi"/>
- <symbol unicode="000003A9" tex="\Omega"/>
- <symbol unicode="000003B1" tex="\alpha"/>
- <symbol unicode="000003B2" tex="\beta"/>
- <symbol unicode="000003B3" tex="\gamma"/>
- <symbol unicode="000003B4" tex="\delta"/>
- <symbol unicode="000003B5" tex="\varepsilon"/>
- <symbol unicode="000003B6" tex="\zeta"/>
- <symbol unicode="000003B7" tex="\eta"/>
- <symbol unicode="000003B8" tex="\theta"/>
- <symbol unicode="000003B9" tex="\iota"/>
- <symbol unicode="000003BA" tex="\kappa"/>
- <symbol unicode="000003BB" tex="\lambda"/>
- <symbol unicode="000003BC" tex="\mu"/>
- <symbol unicode="000003BD" tex="\nu"/>
- <symbol unicode="000003BE" tex="\xi"/>
- <symbol unicode="000003C0" tex="\pi"/>
- <symbol unicode="000003C1" tex="\rho"/>
- <symbol unicode="000003C2" tex="\varsigma"/>
- <symbol unicode="000003C3" tex="\sigma"/>
- <symbol unicode="000003C4" tex="\tau"/>
- <symbol unicode="000003C5" tex="\upsilon"/>
- <symbol unicode="000003C6" tex="\varphi"/>
- <symbol unicode="000003C7" tex="\chi"/>
- <symbol unicode="000003C8" tex="\psi"/>
- <symbol unicode="000003C9" tex="\omega"/>
- <symbol unicode="000003D1" tex="\vartheta"/>
- <symbol unicode="000003D5" tex="\phi"/>
- <symbol unicode="000003D6" tex="\varpi"/>
- <symbol unicode="000003DD" tex="\digamma"/>
- <symbol unicode="000003F0" tex="\varkappa"/>
- <symbol unicode="000003F1" tex="\varrho"/>
- <symbol unicode="000003F5" tex="\epsilon"/>
- <symbol unicode="000003F6" tex="\backepsilon"/>
- <symbol unicode="00002020" tex="\dagger"/>
- <symbol unicode="00002021" tex="\ddagger"/>
- <symbol unicode="00002022" tex="\bullet"/>
- <symbol unicode="00002026" tex="\dots"/>
- <symbol unicode="00002032" tex="\prime"/>
- <symbol unicode="00002035" tex="\backprime"/>
- <symbol unicode="00002190" tex="\leftarrow"/>
- <symbol unicode="00002191" tex="\uparrow"/>
- <symbol unicode="00002192" tex="\rightarrow"/>
- <symbol unicode="00002193" tex="\downarrow"/>
- <symbol unicode="00002194" tex="\leftrightarrow"/>
- <symbol unicode="00002195" tex="\updownarrow"/>
- <symbol unicode="00002196" tex="\nwarrow"/>
- <symbol unicode="00002197" tex="\nearrow"/>
- <symbol unicode="00002198" tex="\searrow"/>
- <symbol unicode="00002199" tex="\swarrow"/>
- <symbol unicode="0000219A" tex="\nleftarrow"/>
- <symbol unicode="0000219B" tex="\nrightarrow"/>
- <symbol unicode="0000219D" tex="\rightsquigarrow"/>
- <symbol unicode="0000219E" tex="\twoheadleftarrow"/>
- <symbol unicode="000021A0" tex="\twoheadrightarrow"/>
- <symbol unicode="000021A2" tex="\leftarrowtail"/>
- <symbol unicode="000021A3" tex="\rightarrowtail"/>
- <symbol unicode="000021A6" tex="\mapsto"/>
- <symbol unicode="000021A9" tex="\hookleftarrow"/>
- <symbol unicode="000021AA" tex="\hookrightarrow"/>
- <symbol unicode="000021AB" tex="\looparrowleft"/>
- <symbol unicode="000021AC" tex="\looparrowright"/>
- <symbol unicode="000021AD" tex="\leftrightsquigarrow"/>
- <symbol unicode="000021AE" tex="\nleftrightarrow"/>
- <symbol unicode="000021B0" tex="\Lsh"/>
- <symbol unicode="000021B1" tex="\Rsh"/>
- <symbol unicode="000021B6" tex="\curvearrowleft"/>
- <symbol unicode="000021B7" tex="\curvearrowright"/>
- <symbol unicode="000021BA" tex="\circlearrowleft"/>
- <symbol unicode="000021BB" tex="\circlearrowright"/>
- <symbol unicode="000021BC" tex="\leftharpoonup"/>
- <symbol unicode="000021BD" tex="\leftharpoondown"/>
- <symbol unicode="000021BE" tex="\upharpoonright"/>
- <symbol unicode="000021BF" tex="\upharpoonleft"/>
- <symbol unicode="000021C0" tex="\rightharpoonup"/>
- <symbol unicode="000021C1" tex="\rightharpoondown"/>
- <symbol unicode="000021C2" tex="\downharpoonright"/>
- <symbol unicode="000021C3" tex="\downharpoonleft"/>
- <symbol unicode="000021C4" tex="\rightleftarrows"/>
- <symbol unicode="000021C6" tex="\leftrightarrows"/>
- <symbol unicode="000021C7" tex="\leftleftarrows"/>
- <symbol unicode="000021C8" tex="\upuparrows"/>
- <symbol unicode="000021C9" tex="\rightrightarrows"/>
- <symbol unicode="000021CA" tex="\downdownarrows"/>
- <symbol unicode="000021CB" tex="\leftrightharpoons"/>
- <symbol unicode="000021CC" tex="\rightleftharpoons"/>
- <symbol unicode="000021CD" tex="\nLeftarrow"/>
- <symbol unicode="000021CE" tex="\nLeftrightarrow"/>
- <symbol unicode="000021CF" tex="\nRightarrow"/>
- <symbol unicode="000021D0" tex="\Leftarrow"/>
- <symbol unicode="000021D1" tex="\Uparrow"/>
- <symbol unicode="000021D2" tex="\Rightarrow"/>
- <symbol unicode="000021D3" tex="\Downarrow"/>
- <symbol unicode="000021D4" tex="\Leftrightarrow"/>
- <symbol unicode="000021D5" tex="\Updownarrow"/>
- <symbol unicode="000021DA" tex="\Lleftarrow"/>
- <symbol unicode="000021DB" tex="\Rrightarrow"/>
- <symbol unicode="000021DD" tex="\leadsto"/>
- <symbol unicode="00002200" tex="\forall"/>
- <symbol unicode="00002201" tex="\complement"/>
- <symbol unicode="00002203" tex="\exists"/>
- <symbol unicode="00002204" tex="\nexists"/>
- <symbol unicode="00002207" tex="\nabla"/>
- <symbol unicode="00002208" tex="\in"/>
- <symbol unicode="00002209" tex="\notin"/>
- <symbol unicode="0000220B" tex="\ni"/>
- <symbol unicode="0000220F" tex="\prod"/>
- <symbol unicode="00002210" tex="\coprod"/>
- <symbol unicode="00002211" tex="\sum"/>
- <symbol unicode="00002213" tex="\mp"/>
- <symbol unicode="00002214" tex="\dotplus"/>
- <symbol unicode="00002218" tex="\circ"/>
- <symbol unicode="0000221A" tex="\surd"/>
- <symbol unicode="0000221D" tex="\propto"/>
- <symbol unicode="00002220" tex="\angle"/>
- <symbol unicode="00002221" tex="\measuredangle"/>
- <symbol unicode="00002222" tex="\sphericalangle"/>
- <symbol unicode="00002224" tex="\nmid"/>
- <symbol unicode="00002225" tex="\parallel"/>
- <symbol unicode="00002226" tex="\nparallel"/>
- <symbol unicode="00002227" tex="\wedge"/>
- <symbol unicode="00002228" tex="\vee"/>
- <symbol unicode="00002229" tex="\cap"/>
- <symbol unicode="0000222A" tex="\cup"/>
- <symbol unicode="0000222B" tex="\int"/>
- <symbol unicode="0000222C" tex="\iint"/>
- <symbol unicode="0000222D" tex="\iiint"/>
- <symbol unicode="0000222E" tex="\oint"/>
- <symbol unicode="00002234" tex="\therefore"/>
- <symbol unicode="00002235" tex="\because"/>
- <symbol unicode="0000223C" tex="\sim"/>
- <symbol unicode="0000223D" tex="\backsim"/>
- <symbol unicode="00002240" tex="\wr"/>
- <symbol unicode="00002241" tex="\nsim"/>
- <symbol unicode="00002242" tex="\eqsim"/>
- <symbol unicode="00002243" tex="\simeq"/>
- <symbol unicode="00002245" tex="\cong"/>
- <symbol unicode="00002247" tex="\ncong"/>
- <symbol unicode="00002248" tex="\approx"/>
- <symbol unicode="0000224A" tex="\approxeq"/>
- <symbol unicode="0000224E" tex="\Bumpeq"/>
- <symbol unicode="0000224F" tex="\bumpeq"/>
- <symbol unicode="00002250" tex="\doteq"/>
- <symbol unicode="00002251" tex="\doteqdot"/>
- <symbol unicode="00002252" tex="\fallingdotseq"/>
- <symbol unicode="00002253" tex="\risingdotseq"/>
- <symbol unicode="00002256" tex="\eqcirc"/>
- <symbol unicode="00002257" tex="\circeq"/>
- <symbol unicode="0000225C" tex="\triangleq"/>
- <symbol unicode="00002260" tex="\neq"/>
- <symbol unicode="00002261" tex="\equiv"/>
- <symbol unicode="00002264" tex="\leq"/>
- <symbol unicode="00002265" tex="\geq"/>
- <symbol unicode="00002266" tex="\leqq"/>
- <symbol unicode="00002267" tex="\geqq"/>
- <symbol unicode="00002268" tex="\lneqq"/>
- <symbol unicode="00002269" tex="\gneqq"/>
- <symbol unicode="0000226A" tex="\ll"/>
- <symbol unicode="0000226B" tex="\gg"/>
- <symbol unicode="0000226C" tex="\between"/>
- <symbol unicode="0000226E" tex="\nless"/>
- <symbol unicode="0000226F" tex="\ngtr"/>
- <symbol unicode="00002270" tex="\nleq"/>
- <symbol unicode="00002271" tex="\ngeq"/>
- <symbol unicode="00002272" tex="\lesssim"/>
- <symbol unicode="00002273" tex="\gtrsim"/>
- <symbol unicode="00002276" tex="\lessgtr"/>
- <symbol unicode="00002277" tex="\gtrless"/>
- <symbol unicode="0000227A" tex="\prec"/>
- <symbol unicode="0000227B" tex="\succ"/>
- <symbol unicode="0000227C" tex="\preccurlyeq"/>
- <symbol unicode="0000227D" tex="\succcurlyeq"/>
- <symbol unicode="0000227E" tex="\precsim"/>
- <symbol unicode="0000227F" tex="\succsim"/>
- <symbol unicode="00002280" tex="\nprec"/>
- <symbol unicode="00002281" tex="\nsucc"/>
- <symbol unicode="00002282" tex="\subset"/>
- <symbol unicode="00002283" tex="\supset"/>
- <symbol unicode="00002286" tex="\subseteq"/>
- <symbol unicode="00002287" tex="\supseteq"/>
- <symbol unicode="00002288" tex="\nsubseteq"/>
- <symbol unicode="00002289" tex="\nsupseteq"/>
- <symbol unicode="0000228A" tex="\subsetneq"/>
- <symbol unicode="0000228B" tex="\supsetneq"/>
- <symbol unicode="0000228E" tex="\uplus"/>
- <symbol unicode="0000228F" tex="\sqsubset"/>
- <symbol unicode="00002290" tex="\sqsupset"/>
- <symbol unicode="00002291" tex="\sqsubseteq"/>
- <symbol unicode="00002292" tex="\sqsupseteq"/>
- <symbol unicode="00002293" tex="\sqcap"/>
- <symbol unicode="00002294" tex="\sqcup"/>
- <symbol unicode="00002295" tex="\oplus"/>
- <symbol unicode="00002296" tex="\ominus"/>
- <symbol unicode="00002297" tex="\otimes"/>
- <symbol unicode="00002298" tex="\oslash"/>
- <symbol unicode="00002299" tex="\odot"/>
- <symbol unicode="0000229A" tex="\circledcirc"/>
- <symbol unicode="0000229B" tex="\circledast"/>
- <symbol unicode="0000229D" tex="\circleddash"/>
- <symbol unicode="0000229E" tex="\boxplus"/>
- <symbol unicode="0000229F" tex="\boxminus"/>
- <symbol unicode="000022A0" tex="\boxtimes"/>
- <symbol unicode="000022A1" tex="\boxdot"/>
- <symbol unicode="000022A2" tex="\vdash"/>
- <symbol unicode="000022A3" tex="\dashv"/>
- <symbol unicode="000022A4" tex="\top"/>
- <symbol unicode="000022A5" tex="\bot"/>
- <symbol unicode="000022A7" tex="\models"/>
- <symbol unicode="000022A8" tex="\vDash"/>
- <symbol unicode="000022A9" tex="\Vdash"/>
- <symbol unicode="000022AA" tex="\Vvdash"/>
- <symbol unicode="000022AC" tex="\nvdash"/>
- <symbol unicode="000022AD" tex="\nvDash"/>
- <symbol unicode="000022AE" tex="\nVdash"/>
- <symbol unicode="000022AF" tex="\nVDash"/>
- <symbol unicode="000022B2" tex="\lhd"/>
- <symbol unicode="000022B3" tex="\rhd"/>
- <symbol unicode="000022B4" tex="\unlhd"/>
- <symbol unicode="000022B5" tex="\unrhd"/>
- <symbol unicode="000022B8" tex="\multimap"/>
- <symbol unicode="000022BA" tex="\intercal"/>
- <symbol unicode="000022BB" tex="\veebar"/>
- <symbol unicode="000022C0" tex="\bigwedge"/>
- <symbol unicode="000022C1" tex="\bigvee"/>
- <symbol unicode="000022C2" tex="\bigcap"/>
- <symbol unicode="000022C3" tex="\bigcup"/>
- <symbol unicode="000022C4" tex="\diamond"/>
- <symbol unicode="000022C5" tex="\cdot"/>
- <symbol unicode="000022C6" tex="\star"/>
- <symbol unicode="000022C7" tex="\divideontimes"/>
- <symbol unicode="000022C8" tex="\bowtie"/>
- <symbol unicode="000022C9" tex="\ltimes"/>
- <symbol unicode="000022CA" tex="\rtimes"/>
- <symbol unicode="000022CB" tex="\leftthreetimes"/>
- <symbol unicode="000022CC" tex="\rightthreetimes"/>
- <symbol unicode="000022CD" tex="\backsimeq"/>
- <symbol unicode="000022CE" tex="\curlyvee"/>
- <symbol unicode="000022CF" tex="\curlywedge"/>
- <symbol unicode="000022D0" tex="\Subset"/>
- <symbol unicode="000022D1" tex="\Supset"/>
- <symbol unicode="000022D2" tex="\Cap"/>
- <symbol unicode="000022D3" tex="\Cup"/>
- <symbol unicode="000022D4" tex="\pitchfork"/>
- <symbol unicode="000022D6" tex="\lessdot"/>
- <symbol unicode="000022D7" tex="\gtrdot"/>
- <symbol unicode="000022D8" tex="\lll"/>
- <symbol unicode="000022D9" tex="\ggg"/>
- <symbol unicode="000022DA" tex="\lesseqgtr"/>
- <symbol unicode="000022DB" tex="\gtreqless"/>
- <symbol unicode="000022DE" tex="\curlyeqprec"/>
- <symbol unicode="000022DF" tex="\curlyeqsucc"/>
- <symbol unicode="000022E6" tex="\lnsim"/>
- <symbol unicode="000022E7" tex="\gnsim"/>
- <symbol unicode="000022E8" tex="\precnsim"/>
- <symbol unicode="000022E9" tex="\succnsim"/>
- <symbol unicode="000022EA" tex="\ntriangleleft"/>
- <symbol unicode="000022EB" tex="\ntriangleright"/>
- <symbol unicode="000022EC" tex="\ntrianglelefteq"/>
- <symbol unicode="000022ED" tex="\ntrianglerighteq"/>
- <symbol unicode="000022EE" tex="\vdots"/>
- <symbol unicode="000022EF" tex="\cdots"/>
- <symbol unicode="000022F1" tex="\ddots"/>
- <symbol unicode="00002305" tex="\barwedge"/>
- <symbol unicode="00002306" tex="\doublebarwedge"/>
- <symbol unicode="00002308" tex="\lceil"/>
- <symbol unicode="00002309" tex="\rceil"/>
- <symbol unicode="0000230A" tex="\lfloor"/>
- <symbol unicode="0000230B" tex="\rfloor"/>
- <symbol unicode="0000231C" tex="\ulcorner"/>
- <symbol unicode="0000231D" tex="\urcorner"/>
- <symbol unicode="0000231E" tex="\llcorner"/>
- <symbol unicode="0000231F" tex="\lrcorner"/>
- <symbol unicode="00002322" tex="\frown"/>
- <symbol unicode="00002323" tex="\smile"/>
- <symbol unicode="000027E8" tex="\langle"/>
- <symbol unicode="000027E9" tex="\rangle"/>
- <symbol unicode="000025A1" tex="\square"/>
- <symbol unicode="000025B3" tex="\triangle"/>
- <symbol unicode="000025B4" tex="\blacktriangle"/>
- <symbol unicode="000025B5" tex="\vartriangle"/>
- <symbol unicode="000025B6" tex="\blacktriangleright"/>
- <symbol unicode="000025B9" tex="\triangleright"/>
- <symbol unicode="000025BD" tex="\bigtriangledown"/>
- <symbol unicode="000025BE" tex="\blacktriangledown"/>
- <symbol unicode="000025BF" tex="\triangledown"/>
- <symbol unicode="000025C0" tex="\blacktriangleleft"/>
- <symbol unicode="000025C3" tex="\triangleleft"/>
- <symbol unicode="000025CA" tex="\lozenge"/>
- <symbol unicode="000025EF" tex="\bigcirc"/>
- <symbol unicode="000025FC" tex="\blacksquare"/>
- <symbol unicode="00002605" tex="\bigstar"/>
- <symbol unicode="00002660" tex="\spadesuit"/>
- <symbol unicode="00002663" tex="\clubsuit"/>
- <symbol unicode="00002665" tex="\heartsuit"/>
- <symbol unicode="00002666" tex="\diamondsuit"/>
- <symbol unicode="0000266D" tex="\flat"/>
- <symbol unicode="0000266E" tex="\natural"/>
- <symbol unicode="0000266F" tex="\sharp"/>
- <symbol unicode="00002713" tex="\checkmark"/>
- <symbol unicode="0000290E" tex="\dashleftarrow"/>
- <symbol unicode="0000290F" tex="\dashrightarrow"/>
- <symbol unicode="000029EB" tex="\blacklozenge"/>
- <symbol unicode="00002A00" tex="\bigodot"/>
- <symbol unicode="00002A01" tex="\bigoplus"/>
- <symbol unicode="00002A02" tex="\bigotimes"/>
- <symbol unicode="00002A04" tex="\biguplus"/>
- <symbol unicode="00002A06" tex="\bigsqcup"/>
- <symbol unicode="00002A0C" tex="\iiiint"/>
- <symbol unicode="00002A3F" tex="\amalg"/>
- <symbol unicode="00002A7D" tex="\leqslant"/>
- <symbol unicode="00002A7E" tex="\geqslant"/>
- <symbol unicode="00002A85" tex="\lessapprox"/>
- <symbol unicode="00002A86" tex="\gtrapprox"/>
- <symbol unicode="00002A89" tex="\lnapprox"/>
- <symbol unicode="00002A8A" tex="\gnapprox"/>
- <symbol unicode="00002A8B" tex="\lesseqqgtr"/>
- <symbol unicode="00002A8C" tex="\gtreqqless"/>
- <symbol unicode="00002A95" tex="\eqslantless"/>
- <symbol unicode="00002A96" tex="\eqslantgtr"/>
- <symbol unicode="00002AAF" tex="\preceq"/>
- <symbol unicode="00002AB0" tex="\succeq"/>
- <symbol unicode="00002AB5" tex="\precneqq"/>
- <symbol unicode="00002AB6" tex="\succneqq"/>
- <symbol unicode="00002AB7" tex="\precapprox"/>
- <symbol unicode="00002AB8" tex="\succapprox"/>
- <symbol unicode="00002AB9" tex="\precnapprox"/>
- <symbol unicode="00002ABA" tex="\succnapprox"/>
- <symbol unicode="00002AC5" tex="\subseteqq"/>
- <symbol unicode="00002AC6" tex="\supseteqq"/>
- <symbol unicode="00002ACB" tex="\subsetneqq"/>
- <symbol unicode="00002ACC" tex="\supsetneqq"/>
-</symbols>
diff --git a/blahtexml/source/BlahtexCore/Interface.cpp b/blahtexml/source/BlahtexCore/Interface.cpp
deleted file mode 100644
index e63be77..0000000
--- a/blahtexml/source/BlahtexCore/Interface.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// File "Interface.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <sstream>
-#include "Interface.h"
-#include "MathmlNode.h"
-
-using namespace std;
-
-namespace blahtex
-{
-
-void Interface::ProcessInput(const wstring& input)
-{
- mManager.reset(new Manager);
- mManager->ProcessInput(input, mTexvcCompatibility);
-}
-
-wstring Interface::GetMathml()
-{
- wostringstream output;
- auto_ptr<MathmlNode> root = mManager->GenerateMathml(mMathmlOptions);
- root->Print(output, mEncodingOptions, mIndented);
- return output.str();
-}
-
-wstring Interface::GetPurifiedTex()
-{
- return mManager->GeneratePurifiedTex(mPurifiedTexOptions);
-}
-
-#ifdef BLAHTEXML_USING_XERCES
-void Interface::PrintAsSAX2(ContentHandler& sax, const wstring& prefix, bool ignoreFirstmrow) const
-{
- wostringstream output;
- auto_ptr<MathmlNode> root = mManager->GenerateMathml(mMathmlOptions);
- root->PrintAsSAX2(sax, prefix, ignoreFirstmrow);
-}
-#endif
-
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/Interface.h b/blahtexml/source/BlahtexCore/Interface.h
deleted file mode 100644
index d2d3ad4..0000000
--- a/blahtexml/source/BlahtexCore/Interface.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// File "Interface.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_INTERFACE_H
-#define BLAHTEX_INTERFACE_H
-
-#include <string>
-#include <memory>
-#include "Misc.h"
-#include "Manager.h"
-#include "XmlEncode.h"
-
-#ifdef BLAHTEXML_USING_XERCES
-#include <xercesc/sax2/ContentHandler.hpp>
-XERCES_CPP_NAMESPACE_USE
-#endif
-
-namespace blahtex
-{
-
-// If you want to use blahtex in your own code, using an Interface object
-// is probably the easiest way to do it. It's essentially a wrapper for
-// the Manager class, putting all the options and methods in one convenient
-// place.
-//
-// To use it:
-// (1) Declare an Interface object
-// (2) Set the various public members to control options
-// (the data types are explained in Misc.h)
-// (3) Call ProcessInput() on your input
-// (4) Call GetMathml() to get the MathML output
-// (5) Call GetPurifiedTex() to get a complete TeX file that could be sent
-// to latex to generate graphical output
-
-class Interface
-{
-private:
- std::auto_ptr<Manager> mManager;
-
-public:
- MathmlOptions mMathmlOptions;
- EncodingOptions mEncodingOptions;
- PurifiedTexOptions mPurifiedTexOptions;
- bool mTexvcCompatibility;
- bool mIndented;
-
- Interface() :
- mTexvcCompatibility(false),
- mIndented(false)
- {
- }
-
- const Manager* GetManager() const
- {
- return mManager.get();
- }
-
- void ProcessInput(const std::wstring& input);
- std::wstring GetMathml();
- std::wstring GetPurifiedTex();
-#ifdef BLAHTEXML_USING_XERCES
- void PrintAsSAX2(ContentHandler& sax, const std::wstring& prefix, bool ignoreFirstmrow) const;
-#endif
-};
-
-}
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/LayoutTree.cpp b/blahtexml/source/BlahtexCore/LayoutTree.cpp
deleted file mode 100644
index bec6cdf..0000000
--- a/blahtexml/source/BlahtexCore/LayoutTree.cpp
+++ /dev/null
@@ -1,1677 +0,0 @@
-// File "LayoutTree.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <iomanip>
-#include <sstream>
-#include <stdexcept>
-#include <list>
-#include <set>
-#include <map>
-#include "MathmlNode.h"
-#include "LayoutTree.h"
-
-using namespace std;
-
-namespace blahtex
-{
-
-MathmlEnvironment::MathmlEnvironment(
- LayoutTree::Node::Style style,
- RGBColour colour
-)
-{
- mColour = colour;
- mDisplayStyle = (style == LayoutTree::Node::cStyleDisplay);
-
- switch (style)
- {
- case LayoutTree::Node::cStyleDisplay:
- case LayoutTree::Node::cStyleText:
- mScriptLevel = 0;
- break;
-
- case LayoutTree::Node::cStyleScript:
- mScriptLevel = 1;
- break;
-
- case LayoutTree::Node::cStyleScriptScript:
- mScriptLevel = 2;
- break;
-
- default:
- throw logic_error(
- "Unexpected style value in "
- "MathmlEnvironment::MathmlEnvironment"
- );
- }
-}
-
-
-bool operator== (const MathmlEnvironment& x, const MathmlEnvironment& y)
-{
- return
- (x.mDisplayStyle == y.mDisplayStyle) &&
- (x.mScriptLevel == y.mScriptLevel) &&
- (x.mColour == y.mColour);
-}
-
-
-namespace LayoutTree
-{
-
-Row::~Row()
-{
- for (list<Node*>::iterator
- p = mChildren.begin();
- p != mChildren.end();
- p++
- )
- delete *p;
-}
-
-Table::~Table()
-{
- for (vector<vector<Node*> >::iterator
- p = mRows.begin();
- p != mRows.end();
- p++
- )
- for (vector<Node*>::iterator q = p->begin(); q != p->end(); q++)
- delete *q;
-}
-
-
-void IncrementNodeCount(unsigned& nodeCount)
-{
- if (++nodeCount >= cMaxMathmlNodeCount)
- throw Exception(L"TooManyMathmlNodes");
-}
-
-
-// This function obtains the core of a MathML expression. (See
-// "embellished operators" in the MathML spec.) This is used to find any
-// <mo> node which should have its "lspace" and/or "rspace" attributes set.
-MathmlNode* GetCore(MathmlNode* node)
-{
- // FIX: this code is not quite right. It doesn't handle situations where
- // <mrow> or <mstyle> or something similar contain a single node which
- // is an embellished operator. I don't think this really matters
- // because I don't think these situations can actually arise, but
- // maybe should be fixed just in case.
-
- if (!node)
- return NULL;
-
- switch (node->mType)
- {
- case MathmlNode::cTypeMsub:
- case MathmlNode::cTypeMsup:
- case MathmlNode::cTypeMsubsup:
- case MathmlNode::cTypeMunder:
- case MathmlNode::cTypeMover:
- case MathmlNode::cTypeMunderover:
- return GetCore(node->mChildren.front());
-
- default:
- return node;
- }
-}
-
-
-// Converts an RGBColour to "#rrggbb" format.
-wstring FormatColour(RGBColour colour)
-{
- wostringstream os;
- os << L"#" << hex << setfill(L'0') << setw(6) << colour;
- return os.str();
-}
-
-
-// This function compares sourceEnvironment to targetEnvironment. It then
-// modifies "node" by inserting appropriate attributes or possibly an
-// <mstyle> node, so that the node receives the desired "target
-// environment", assuming that it inherited the indicated "source
-// environment".
-
-// FIX: sometimes firefox doesn't get the scriptlevel correct for
-// tables. (see mozilla bug 328141). So for the moment, we force an
-// extra <mstyle> node around every table to handle the scriptlevel.
-#define MOZILLA_BUG_328141_WORKAROUND 1
-
-auto_ptr<MathmlNode> AdjustMathmlEnvironment(
- auto_ptr<MathmlNode> node,
- MathmlEnvironment sourceEnvironment,
- MathmlEnvironment targetEnvironment
-)
-{
- if (
- sourceEnvironment.mDisplayStyle == targetEnvironment.mDisplayStyle
- && sourceEnvironment.mScriptLevel == targetEnvironment.mScriptLevel
- && sourceEnvironment.mColour == targetEnvironment.mColour
-#if MOZILLA_BUG_328141_WORKAROUND
- && node->mType != MathmlNode::cTypeMtable
-#endif
- )
- return node;
-
- auto_ptr<MathmlNode> newNode(new MathmlNode(MathmlNode::cTypeMstyle));
-
- if (sourceEnvironment.mDisplayStyle != targetEnvironment.mDisplayStyle)
- {
- if (node->mType == MathmlNode::cTypeMtable)
- {
- // Special case if the node in question is <mtable>, because
- // the MathML spec says that the displaystyle attribute needs
- // to be set on the <mtable> element itself, since the default
- // "false" overrides any enclosing <mstyle>.
- node->mAttributes[MathmlNode::cAttributeDisplaystyle] =
- (targetEnvironment.mDisplayStyle) ? L"true" : L"false";
- }
- else
- {
- newNode->mAttributes[MathmlNode::cAttributeDisplaystyle] =
- (targetEnvironment.mDisplayStyle) ? L"true" : L"false";
- }
- }
-
- if (
- sourceEnvironment.mScriptLevel != targetEnvironment.mScriptLevel
-#if MOZILLA_BUG_328141_WORKAROUND
- || node->mType == MathmlNode::cTypeMtable
-#endif
- )
- {
- wostringstream os;
- os << targetEnvironment.mScriptLevel;
- newNode->mAttributes
- [MathmlNode::cAttributeScriptlevel] = os.str();
- }
-
- if (sourceEnvironment.mColour != targetEnvironment.mColour)
- {
- // If the child is a token element, we can just add mathcolor
- // directly
- switch (node->mType)
- {
- case MathmlNode::cTypeMi:
- case MathmlNode::cTypeMo:
- case MathmlNode::cTypeMn:
- case MathmlNode::cTypeMtext:
- node->mAttributes[MathmlNode::cAttributeMathcolor] =
- FormatColour(targetEnvironment.mColour);
- break;
-
- default:
- newNode->mAttributes[MathmlNode::cAttributeMathcolor] =
- FormatColour(targetEnvironment.mColour);
- break;
- }
- }
-
- if (newNode->mAttributes.empty())
- // In some cases we don't actually need an <mstyle> node, and just
- // return the original node. (This can happen if either (1) the
- // child is an <mtable> where only the displaystyle got modified,
- // or (2) it was a token element and only the colour got modified.)
- return node;
-
- if (node->mType == MathmlNode::cTypeMrow)
- // If the child is an mrow, we can splice it out
- newNode->mChildren.swap(node->mChildren);
- else
- newNode->mChildren.push_back(node.release());
-
- return newNode;
-}
-
-
-auto_ptr<MathmlNode> Row::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- // The strategy is:
- // First write each output node to "outputNode", but simultaneously
- // keep a list of MathmlEnvironments corresponding to the desired
- // environment for each node. Then, do a second pass inserting <mstyle>
- // nodes to implement those desired environments.
-
- auto_ptr<MathmlNode> outputNode(new MathmlNode(MathmlNode::cTypeMrow));
- list<MathmlNode*>& outputList = outputNode->mChildren;
-
- IncrementNodeCount(nodeCount);
-
- if (mChildren.empty())
- return outputNode;
-
- vector<MathmlEnvironment> environments;
-
- for (list<Node*>::const_iterator
- source = mChildren.begin();
- true;
- ++source
- )
- {
- MathmlNode* previousTarget =
- outputList.empty() ? NULL : outputList.back();
-
- int spaceWidth = 0;
- bool isUserRequested = false;
-
- Space* sourceAsSpace =
- (source == mChildren.end())
- ? NULL : dynamic_cast<Space*>(*source);
- if (sourceAsSpace)
- {
- spaceWidth = sourceAsSpace->mWidth;
- isUserRequested = sourceAsSpace->mIsUserRequested;
- source++;
- }
-
- MathmlNode* currentTarget = NULL;
- if (source != mChildren.end())
- {
- environments.push_back(
- MathmlEnvironment((*source)->mStyle, (*source)->mColour)
- );
-
- outputList.push_back(
- (*source)->BuildMathmlTree(
- options,
- environments.back(),
- nodeCount
- ).release()
- );
-
- currentTarget = outputList.back();
- }
-
- // Now decide about whether to insert markup for the
- // space between currentNode and previousNode.
-
- MathmlNode* currentNucleus = GetCore(currentTarget);
- MathmlNode* previousNucleus = GetCore(previousTarget);
-
- bool isPreviousMo =
- previousNucleus &&
- (previousNucleus->mType == MathmlNode::cTypeMo);
-
- bool isCurrentMo =
- currentNucleus &&
- (currentNucleus->mType == MathmlNode::cTypeMo);
-
- bool doSpace = false;
-
- if (
- options.mSpacingControl
- == MathmlOptions::cSpacingControlStrict
- || isUserRequested
- )
- doSpace = true;
-
- else if (options.mSpacingControl ==
- MathmlOptions::cSpacingControlModerate
- )
- {
- // The user has asked for "moderate" spacing mode, so we
- // need to give the MathML renderer a helping hand with
- // spacing decisions, without being *too* pushy.
-
- // This section of code is likely to change a LOT.
-
- // Note: I scratched most of this as of blahtex 0.4.4....
- // it was getting really ugly and I need to think of another
- // way to do it
-
- if (!isPreviousMo && !isCurrentMo)
- doSpace = (spaceWidth != 0);
- }
-
- if (doSpace)
- {
- // We have established that we want to mark up some space,
- // now need to decide how to do it.
-
- // We use <mspace>, unless we have an <mo> node on either
- // side (or both sides), in which case we use "lspace"
- // and/or "rspace" attributes.
-
- wstring widthAsString;
- if (spaceWidth == 0)
- widthAsString = L"0";
- else
- {
- wostringstream wos;
- wos << fixed << setprecision(3)
- << (spaceWidth / 18.0) << L"em";
- widthAsString = wos.str();
- }
-
- if (isPreviousMo)
- {
- previousNucleus->mAttributes
- [MathmlNode::cAttributeRspace] = widthAsString;
- if (isCurrentMo)
- currentNucleus->mAttributes
- [MathmlNode::cAttributeLspace] = L"0";
- }
- else if (isCurrentMo)
- currentNucleus->mAttributes
- [MathmlNode::cAttributeLspace] = widthAsString;
- else
- {
- // FIX: this <mi>-specific stuff is a nasty hack because
- // Firefox likes to mess around with the space between
- // adjacent <mi> nodes in some situations.
- // See https://bugzilla.mozilla.org/show_bug.cgi?id=320294
-
- bool isPreviousMi =
- previousNucleus &&
- (previousNucleus->mType == MathmlNode::cTypeMi);
-
- bool isCurrentMi =
- currentNucleus &&
- (currentNucleus->mType == MathmlNode::cTypeMi);
-
- if (spaceWidth != 0 || (isPreviousMi && isCurrentMi))
- {
- auto_ptr<MathmlNode> spaceNode(
- new MathmlNode(MathmlNode::cTypeMspace)
- );
- IncrementNodeCount(nodeCount);
- spaceNode->mAttributes
- [MathmlNode::cAttributeWidth] = widthAsString;
-
- if (currentTarget)
- {
- outputList.insert(
- --outputList.end(),
- spaceNode.release()
- );
- environments.push_back(environments.back());
- }
- else
- {
- outputList.push_back(spaceNode.release());
- environments.push_back(
- MathmlEnvironment(mStyle, mColour)
- );
- }
- }
- }
- }
-
- if (source == mChildren.end())
- break;
- }
-
- // Now do second pass where styles get adjusted
- list<MathmlNode*>::iterator outputPtr = outputList.end();
- for (vector<MathmlEnvironment>::reverse_iterator
- environment = environments.rbegin();
- environment != environments.rend();
- environment++
- )
- {
- if (outputPtr != outputList.begin())
- outputPtr--;
-
- if (environment == environments.rbegin())
- continue;
-
- if (!(environment[-1] == environment[0]))
- {
- list<MathmlNode*>::iterator previousOutputPtr = outputPtr;
- previousOutputPtr++;
-
- auto_ptr<MathmlNode> enclosedNode;
-
- if (--outputList.end() == previousOutputPtr)
- {
- // If outputPtr is already the last node, we don't need
- // to create a new <mrow>
- enclosedNode.reset(*previousOutputPtr);
- outputList.pop_back();
- }
- else
- {
- enclosedNode.reset(new MathmlNode(MathmlNode::cTypeMrow));
- enclosedNode->mChildren.splice(
- enclosedNode->mChildren.begin(),
- outputList,
- previousOutputPtr,
- outputList.end()
- );
- }
-
- outputList.push_back(
- AdjustMathmlEnvironment(
- enclosedNode,
- environment[0],
- environment[-1]
- ).release()
- );
- }
- }
-
- // If the result is an <mrow> with a single child, just return the
- // child by itself.
- // (We don't use list::size() here because that's O(n) :-))
- if (!outputNode->mChildren.empty() &&
- outputNode->mChildren.front() == outputNode->mChildren.back()
- )
- {
- MathmlNode* child = outputNode->mChildren.back();
- outputNode->mChildren.pop_back(); // relinquish ownership
- outputNode.reset(child);
- }
-
- return AdjustMathmlEnvironment(
- outputNode,
- inheritedEnvironment,
- environments[0]
- );
-}
-
-
-// This function converts a "MathML styled text" plane-1 character from the
-// code point that it SHOULD be at to the code point that it REALLY is at.
-//
-// For example, the double-struck "C" (&Copf;) should be at U+1D53A, but for
-// historical reasons it ended up at U+2102.
-wchar_t FixOutOfSequenceMathmlCharacter(wchar_t c)
-{
- switch (c)
- {
- case L'\U0001D49D': return L'\U0000212C'; // script B
- case L'\U0001D4A0': return L'\U00002130'; // script E
- case L'\U0001D4A1': return L'\U00002131'; // script F
- case L'\U0001D4A3': return L'\U0000210B'; // script H
- case L'\U0001D4A4': return L'\U00002110'; // script I
- case L'\U0001D4A7': return L'\U00002112'; // script L
- case L'\U0001D4A8': return L'\U00002133'; // script M
- case L'\U0001D4AD': return L'\U0000211B'; // script R
- case L'\U0001D53A': return L'\U00002102'; // double struck C
- case L'\U0001D53F': return L'\U0000210D'; // double struck H
- case L'\U0001D545': return L'\U00002115'; // double struck N
- case L'\U0001D547': return L'\U00002119'; // double struck P
- case L'\U0001D548': return L'\U0000211A'; // double struck Q
- case L'\U0001D549': return L'\U0000211D'; // double struck R
- case L'\U0001D551': return L'\U00002124'; // double struck Z
- case L'\U0001D506': return L'\U0000212D'; // fraktur C
- case L'\U0001D50B': return L'\U0000210C'; // fraktur H
- case L'\U0001D50C': return L'\U00002111'; // fraktur I
- case L'\U0001D515': return L'\U0000211C'; // fraktur R
- case L'\U0001D51D': return L'\U00002128'; // fraktur Z
- }
-
- return c;
-}
-
-
-auto_ptr<MathmlNode> SymbolIdentifier::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- auto_ptr<MathmlNode> node(new MathmlNode(MathmlNode::cTypeMi, mText));
- IncrementNodeCount(nodeCount);
-
- // Here we have a special case to deal with the "fancy" fonts
- // (fraktur, script, bold-fraktur, bold-script, double-struck)
- // when MathML version 1.x fonts are requested, since then we need
- // to explicitly substitute MathML entities.
- if (
- options.mUseVersion1FontAttributes &&
- (
- mFont == cMathmlFontFraktur ||
- mFont == cMathmlFontBoldFraktur ||
- mFont == cMathmlFontDoubleStruck ||
- mFont == cMathmlFontScript ||
- mFont == cMathmlFontBoldScript
- )
- )
- {
- if (mText.size() != 1)
- throw logic_error(
- "Unexpected string length in "
- "SymbolIdentifier::BuildMathmlTree()"
- );
-
- wchar_t replacement = 0;
-
- // These hold the explicit characters for "A" and "a" in the
- // desired font (or zero if unavailable)
- wchar_t baseUppercase = 0, baseLowercase = 0;
-
- switch (mFont)
- {
- case cMathmlFontBoldScript:
- if (options.mAllowPlane1)
- {
- baseUppercase = L'\U0001D4D0';
- break;
- }
- else
- {
- // If we don't have plane 1 characters available, then
- // we'll just have to do e.g.
- // <mi fontweight="bold">&Acal;</mi>
- // since there aren't specific MathML names for bold
- // script capitals.
- node->mAttributes
- [MathmlNode::cAttributeFontweight] = L"bold";
- baseUppercase = L'\U0001D49C';
- break;
- }
-
- case cMathmlFontScript:
- baseUppercase = L'\U0001D49C';
- break;
-
- case cMathmlFontBoldFraktur:
- if (options.mAllowPlane1)
- {
- baseUppercase = L'\U0001D56C';
- baseLowercase = L'\U0001D586';
- break;
- }
- else
- {
- // See comments above under cMathmlFontBoldScript
- node->mAttributes
- [MathmlNode::cAttributeFontweight] = L"bold";
- baseUppercase = L'\U0001D504';
- baseLowercase = L'\U0001D51E';
- break;
- }
-
- case cMathmlFontFraktur:
- baseUppercase = L'\U0001D504';
- baseLowercase = L'\U0001D51E';
- break;
-
- case cMathmlFontDoubleStruck:
- baseUppercase = L'\U0001D538';
- break;
- }
-
- if (baseUppercase && mText[0] >= 'A' && mText[0] <= 'Z')
- replacement = baseUppercase + (mText[0] - 'A');
- if (baseLowercase && mText[0] >= 'a' && mText[0] <= 'z')
- replacement = baseLowercase + (mText[0] - 'a');
-
- if (!replacement)
- throw logic_error(
- "Unexpected character/font combination in "
- "SymbolIdentifier::BuildMathmlTree()"
- );
-
- node->mText =
- wstring(1, FixOutOfSequenceMathmlCharacter(replacement));
-
- return AdjustMathmlEnvironment(
- node,
- inheritedEnvironment,
- MathmlEnvironment(mStyle, mColour)
- );
- }
-
- node->AddFontAttributes(mFont, options);
- return AdjustMathmlEnvironment(
- node, inheritedEnvironment, MathmlEnvironment(mStyle, mColour)
- );
-}
-
-
-auto_ptr<MathmlNode> SymbolOperator::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- // These are all the operators that stretch by default in the normative
- // operator dictionary. If we *don't* want them to stretch, we need
- // to explicitly say so.
- static wchar_t stretchyByDefaultArray[] =
- {
- L'(',
- L')',
- L'[',
- L']',
- L'{',
- L'}',
- L'|',
- L'/',
- L'\U000002DC', // DiacriticalTilde
- L'\U000002C7', // Hacek
- L'\U000002D8', // Breve
- L'\U00002216', // Backslash
- L'\U000027E8', // LeftAngleBracket
- L'\U000027E9', // RightAngleBracket
- L'\U00002308', // LeftCeiling
- L'\U00002309', // RightCeiling
- L'\U0000230A', // LeftFloor
- L'\U0000230B', // RightFloor
- L'\U00002211', // Sum
- L'\U0000220F', // Product
- L'\U0000222B', // Integral
- L'\U0000222C', // Int
- L'\U0000222D', // iiint
- L'\U00002A0C', // iiiint
- L'\U0000222E', // ContourIntegral
- L'\U000022C2', // Intersection
- L'\U00002A00', // bigodot
- L'\U00002A02', // bigotimes
- L'\U00002210', // Coproduct
- L'\U00002A06', // bigsqcup
- L'\U00002A01', // bigoplus
- L'\U000022C1', // Vee
- L'\U00002A04', // biguplus
- L'\U000022C0' // Wedge
- };
- static wishful_hash_set<wchar_t> stretchyByDefaultTable(
- stretchyByDefaultArray,
- END_ARRAY(stretchyByDefaultArray)
- );
-
- // Special case for "\not":
- if (mText == L"NOT")
- {
- auto_ptr<MathmlNode> node(new MathmlNode(MathmlNode::cTypeMpadded));
- auto_ptr<MathmlNode> space(new MathmlNode(MathmlNode::cTypeMspace));
- space->mAttributes[MathmlNode::cAttributeWidth] = L"0.1em";
- node->mChildren.push_back(space.release());
- node->mChildren.push_back(
- new MathmlNode(MathmlNode::cTypeMo, L"/")
- );
- node->mAttributes[MathmlNode::cAttributeWidth] = L"0";
- return node;
- }
-
- // And these are the characters that are accents by default;
- // again we may need to modify this explicitly.
- static wchar_t accentByDefaultArray[] =
- {
- L'\U0000FE37',
- L'\U0000FE38'
- };
- static wishful_hash_set<wchar_t> accentByDefaultTable(
- accentByDefaultArray,
- END_ARRAY(accentByDefaultArray)
- );
-
- auto_ptr<MathmlNode> node(new MathmlNode(MathmlNode::cTypeMo, mText));
-
- if (mIsStretchy)
- {
- node->mAttributes[MathmlNode::cAttributeStretchy] = L"true";
- if (!mSize.empty())
- node->mAttributes[MathmlNode::cAttributeMinsize] =
- node->mAttributes[MathmlNode::cAttributeMaxsize] = mSize;
- }
- else if (mText.size() == 1 && stretchyByDefaultTable.count(mText[0]))
- node->mAttributes[MathmlNode::cAttributeStretchy] = L"false";
-
- if (mIsAccent)
- {
- node->mAttributes[MathmlNode::cAttributeAccent] = L"true";
- return node;
- }
- else if (mText.size() == 1 && accentByDefaultTable.count(mText[0]))
- node->mAttributes[MathmlNode::cAttributeAccent] = L"false";
-
- node->AddFontAttributes(mFont, options);
-
- return AdjustMathmlEnvironment(
- node, inheritedEnvironment, MathmlEnvironment(mStyle, mColour)
- );
-}
-
-
-auto_ptr<MathmlNode> SymbolNumber::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- // FIX: what about merging commas, decimal points into <mn> nodes?
- // Might need to special-case it.
-
- auto_ptr<MathmlNode> node(new MathmlNode(MathmlNode::cTypeMn, mText));
- IncrementNodeCount(nodeCount);
- node->AddFontAttributes(mFont, options);
- return AdjustMathmlEnvironment(
- node, inheritedEnvironment, MathmlEnvironment(mStyle, mColour)
- );
-}
-
-
-auto_ptr<MathmlNode> SymbolText::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- auto_ptr<MathmlNode> node(
- new MathmlNode(MathmlNode::cTypeMtext, mText)
- );
- IncrementNodeCount(nodeCount);
- node->AddFontAttributes(mFont, options);
- return AdjustMathmlEnvironment(
- node, inheritedEnvironment, MathmlEnvironment(mStyle, mColour)
- );
-}
-
-
-auto_ptr<MathmlNode> Sqrt::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- MathmlEnvironment desiredEnvironment(mStyle, mColour);
-
- auto_ptr<MathmlNode> child =
- mChild->BuildMathmlTree(
- options, desiredEnvironment, nodeCount
- );
-
- auto_ptr<MathmlNode> node;
-
- if (child->mType == MathmlNode::cTypeMrow)
- {
- // This removes redundant <mrow>s, i.e. things like
- // <msqrt><mrow>...</mrow></msqrt>
- node = child;
- node->mType = MathmlNode::cTypeMsqrt;
- }
- else
- {
- node.reset(new MathmlNode(MathmlNode::cTypeMsqrt));
- IncrementNodeCount(nodeCount);
- node->mChildren.push_back(child.release());
- }
-
- return AdjustMathmlEnvironment(
- node, inheritedEnvironment, desiredEnvironment
- );
-}
-
-
-auto_ptr<MathmlNode> Root::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- auto_ptr<MathmlNode> node(new MathmlNode(MathmlNode::cTypeMroot));
- IncrementNodeCount(nodeCount);
-
- MathmlEnvironment desiredEnvironment(mStyle, mColour);
-
- node->mChildren.push_back(
- mInside->BuildMathmlTree(
- options,
- desiredEnvironment,
- nodeCount
- ).release()
- );
-
- node->mChildren.push_back(
- mOutside->BuildMathmlTree(
- options,
- MathmlEnvironment(false, 2, mColour),
- nodeCount
- ).release()
- );
-
- return AdjustMathmlEnvironment(
- node, inheritedEnvironment, desiredEnvironment
- );
-}
-
-
-auto_ptr<MathmlNode> Scripts::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- // Simulate the change in rendering environment for the super/
- // sub/over/underscripts.
- MathmlEnvironment baseEnvironment(mStyle, mColour);
- MathmlEnvironment scriptEnvironment = baseEnvironment;
- scriptEnvironment.mDisplayStyle = false;
- scriptEnvironment.mScriptLevel++;
-
- auto_ptr<MathmlNode> base;
- if (mBase.get())
- base = mBase->BuildMathmlTree(options, baseEnvironment, nodeCount);
- else
- {
- // An empty base gets represented by "<mrow/>"
- base.reset(new MathmlNode(MathmlNode::cTypeMrow));
- IncrementNodeCount(nodeCount);
- }
-
- MathmlNode::Type type;
-
- if (mUpper.get())
- {
- if (mLower.get())
- type = mIsSideset
- ? MathmlNode::cTypeMsubsup
- : MathmlNode::cTypeMunderover;
- else
- type = mIsSideset
- ? MathmlNode::cTypeMsup
- : MathmlNode::cTypeMover;
- }
- else
- type = mIsSideset
- ? MathmlNode::cTypeMsub
- : MathmlNode::cTypeMunder;
-
- auto_ptr<MathmlNode> scriptsNode(new MathmlNode(type));
- IncrementNodeCount(nodeCount);
- scriptsNode->mChildren.push_back(base.release());
-
- if (mUpper.get())
- {
- if (mLower.get())
- {
- scriptsNode->mChildren.push_back(
- mLower->BuildMathmlTree(
- options, scriptEnvironment, nodeCount
- ).release()
- );
- scriptsNode->mChildren.push_back(
- mUpper->BuildMathmlTree(
- options, scriptEnvironment, nodeCount
- ).release()
- );
- }
- else
- {
- scriptsNode->mChildren.push_back(
- mUpper->BuildMathmlTree(
- options, scriptEnvironment, nodeCount
- ).release()
- );
- }
- }
- else
- {
- scriptsNode->mChildren.push_back(
- mLower->BuildMathmlTree(
- options, scriptEnvironment, nodeCount
- ).release()
- );
- }
-
- if (!mIsSideset && mStyle != cStyleDisplay)
- {
- // This situation should be quite unusual, since the user would
- // have to force things using "\limits". If there's an operator in
- // the core, we need to set movablelimits just to be safe.
-
- // FIX: this code might let the user induce quadratic time, with
- // something like this:
- // "\textstyle \mathop{\mathop{\mathop{\mathop ... {x} ...
- // \limits^x}\limits^x}\limits^x}\limits^x" etc
-
- // FIX: we could add a table to check whether the operator inside
- // is likely to need movablelimits adjusted because of the
- // operator dictionary.
-
- MathmlNode* core = GetCore(scriptsNode->mChildren.front());
- if (core->mType == MathmlNode::cTypeMo)
- core->mAttributes
- [MathmlNode::cAttributeMovablelimits] = L"false";
- }
-
- return AdjustMathmlEnvironment(
- scriptsNode, inheritedEnvironment, baseEnvironment
- );
-}
-
-
-auto_ptr<MathmlNode> Fraction::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- // Determine the rendering style for the numerator and denominator.
- MathmlEnvironment baseEnvironment(mStyle, mColour);
- MathmlEnvironment smallerEnvironment = baseEnvironment;
- if (smallerEnvironment.mDisplayStyle)
- smallerEnvironment.mDisplayStyle = false;
- else
- smallerEnvironment.mScriptLevel++;
-
- auto_ptr<MathmlNode> node(new MathmlNode(MathmlNode::cTypeMfrac));
- IncrementNodeCount(nodeCount);
-
- node->mChildren.push_back(
- mNumerator->BuildMathmlTree(
- options, smallerEnvironment, nodeCount
- ).release()
- );
- node->mChildren.push_back(
- mDenominator->BuildMathmlTree(
- options, smallerEnvironment, nodeCount
- ).release()
- );
-
- if (!mIsLineVisible)
- node->mAttributes
- [MathmlNode::cAttributeLinethickness] = L"0";
-
- return AdjustMathmlEnvironment(
- node, inheritedEnvironment, baseEnvironment
- );
-}
-
-
-auto_ptr<MathmlNode> Space::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- if (!mIsUserRequested)
- throw logic_error(
- "Unexpected lonely automatic space in Space::BuildMathmlTree"
- );
-
- // FIX: what happens with negative space?
-
- auto_ptr<MathmlNode> node(new MathmlNode(MathmlNode::cTypeMspace));
- IncrementNodeCount(nodeCount);
-
- wostringstream wos;
- wos << fixed << setprecision(3) << (mWidth / 18.0) << L"em";
- node->mAttributes[MathmlNode::cAttributeWidth] = wos.str();
-
- return node;
-}
-
-
-auto_ptr<MathmlNode> Fenced::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- auto_ptr<MathmlNode> inside = mChild->BuildMathmlTree(
- options, MathmlEnvironment(mStyle, mColour), nodeCount
- );
-
- if (mLeftDelimiter.empty() && mRightDelimiter.empty())
- return inside;
-
- if (inside->mType != MathmlNode::cTypeMrow)
- {
- // Ensure that the stuff between the fences is surrounded by
- // an <mrow>. (I don't really understand why this is necessary,
- // but the MathML spec suggests it, and Firefox seems a bit fussy,
- // so let's just do it.)
- auto_ptr<MathmlNode> temp(new MathmlNode(MathmlNode::cTypeMrow));
- IncrementNodeCount(nodeCount);
- temp->mChildren.push_back(inside.release());
- inside = temp;
- }
-
- // And surround the whole thing by an <mrow> as well.
- // (This one makes more sense... we want the delimiters to stretch
- // around the correct stuff.)
- auto_ptr<MathmlNode> output(new MathmlNode(MathmlNode::cTypeMrow));
- IncrementNodeCount(nodeCount);
-
- if (!mLeftDelimiter.empty())
- {
- auto_ptr<MathmlNode> node(
- new MathmlNode(MathmlNode::cTypeMo, mLeftDelimiter)
- );
- IncrementNodeCount(nodeCount);
- node->mAttributes[MathmlNode::cAttributeStretchy] = L"true";
- output->mChildren.push_back(node.release());
- }
-
- output->mChildren.push_back(inside.release());
-
- if (!mRightDelimiter.empty())
- {
- auto_ptr<MathmlNode> node(
- new MathmlNode(MathmlNode::cTypeMo, mRightDelimiter)
- );
- IncrementNodeCount(nodeCount);
- node->mAttributes[MathmlNode::cAttributeStretchy] = L"true";
- output->mChildren.push_back(node.release());
- }
-
- return AdjustMathmlEnvironment(
- output, inheritedEnvironment, MathmlEnvironment(mStyle, mColour)
- );
-}
-
-
-auto_ptr<MathmlNode> Table::BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
-) const
-{
- auto_ptr<MathmlNode> node(new MathmlNode(MathmlNode::cTypeMtable));
- IncrementNodeCount(nodeCount);
-
- // Compute the table width. We do this so we can "fill out" each
- // row with the correct number of entries. Although the MathML spec
- // doesn't require this, it seems that Firefox doesn't always align
- // the entries properly unless we fill in the missing entries.
- int tableWidth = 0;
- for (vector<vector<Node*> >::const_iterator
- row = mRows.begin();
- row != mRows.end();
- row++
- )
- {
- if (tableWidth < row->size())
- tableWidth = row->size();
- }
-
- if (mAlign == cAlignLeft)
- node->mAttributes[MathmlNode::cAttributeColumnalign] = L"left";
- else if (mAlign == cAlignRightLeft)
- {
- wstring alignString = L"right";
- for (int i = 1; i < tableWidth; i++)
- alignString += (i % 2) ? L" left" : L" right";
- node->mAttributes[MathmlNode::cAttributeColumnalign] = alignString;
-
- wstring spacingString = L"0.2em";
- for (int i = 2; i < tableWidth; i++)
- spacingString += (i % 2) ? L" 0.2em" : L" 1em";
- node->mAttributes[MathmlNode::cAttributeColumnspacing] =
- spacingString;
- }
-
- // FIX: need to test this for Firefox whenever they get that bug fixed
- // (mozilla bug 330964)
- if (mRowSpacing == cRowSpacingTight)
- node->mAttributes[MathmlNode::cAttributeRowspacing] = L"0.3ex";
-
- for (vector<vector<Node*> >::const_iterator
- inRow = mRows.begin();
- inRow != mRows.end();
- inRow++
- )
- {
- auto_ptr<MathmlNode> outRow(new MathmlNode(MathmlNode::cTypeMtr));
- IncrementNodeCount(nodeCount);
- int count = 0;
- for (vector<Node*>::const_iterator
- inEntry = inRow->begin();
- inEntry != inRow->end();
- inEntry++, count++
- )
- {
- auto_ptr<MathmlNode> outEntry(
- new MathmlNode(MathmlNode::cTypeMtd)
- );
- IncrementNodeCount(nodeCount);
-
- auto_ptr<MathmlNode> child =
- (*inEntry)->BuildMathmlTree(
- options, MathmlEnvironment(mStyle, mColour), nodeCount
- );
-
- // Firefox has a bug (#236963) where it doesn't correctly put
- // an "inferred mrow" inside a <mtd> block, so for the moment
- // we add the <mrow> ourselves.
-#define MOZILLA_BUG_236963_WORKAROUND 1
-
-#if MOZILLA_BUG_236963_WORKAROUND
- if (child->mType == MathmlNode::cTypeMrow)
- {
- child->mType = MathmlNode::cTypeMtd;
- outEntry = child;
- }
- else
- outEntry->mChildren.push_back(child.release());
-#else
- if (child->mType != MathmlNode::cTypeMrow)
- {
- auto_ptr<MathmlNode> temp(
- new MathmlNode(MathmlNode::cTypeMrow)
- );
- IncrementNodeCount(nodeCount);
- temp->mChildren.push_back(child.release());
- child = temp;
- }
- outEntry->mChildren.push_back(child.release());
-#endif
-
- outRow->mChildren.push_back(outEntry.release());
- }
-
- // fill out the extra table entries:
- for (; count < tableWidth; count++)
- {
- outRow->mChildren.push_back(
- new MathmlNode(MathmlNode::cTypeMtd)
- );
- IncrementNodeCount(nodeCount);
- }
-
- node->mChildren.push_back(outRow.release());
- }
-
- return AdjustMathmlEnvironment(
- node, inheritedEnvironment, MathmlEnvironment(mStyle, mColour)
- );
-}
-
-
-// This is a list of all operators that we know how to negate.
-pair<wstring, wstring> gNegationArray[] =
-{
- // Element => NotElement
- make_pair(L"\U00002208", L"\U00002209"),
- // Congruent => NotCongruent
- make_pair(L"\U00002261", L"\U00002262"),
- // Exists => NotExists
- make_pair(L"\U00002203", L"\U00002204"),
- // = => NotEqual
- make_pair(L"=", L"\U00002260"),
- // SubsetEqual => NotSubsetEqual
- make_pair(L"\U00002286", L"\U00002288"),
- // Tilde => NotTilde
- make_pair(L"\U0000223C", L"\U00002241"),
- // LeftArrow => nleftarrow
- make_pair(L"\U00002190", L"\U0000219A"),
- // RightArrow => nrightarrow
- make_pair(L"\U00002192", L"\U0000219B"),
- // LeftRightArrow => nleftrightarrow
- make_pair(L"\U00002194", L"\U000021AE"),
- // DoubleLeftArrow => nLeftArrow
- make_pair(L"\U000021D0", L"\U000021CD"),
- // DoubleRightArrow => nRightArrow
- make_pair(L"\U000021D2", L"\U000021CF"),
- // DoubleLeftRightArrow => nLeftrightArrow
- make_pair(L"\U000021D4", L"\U000021CE"),
- // ReverseElement => NotReverseElement
- make_pair(L"\U0000220B", L"\U0000220C"),
- // FIX: what happens to the pipe character?
- // VerticalBar => NotVerticalBar
- make_pair(L"\U00002223", L"\U00002224"),
- // DoubleVerticalBar => NotDoubleVerticalBar
- make_pair(L"\U00002225", L"\U00002226"),
- // TildeEqual => NotTildeEqual
- make_pair(L"\U00002243", L"\U00002244"),
- // TildeFullEqual => NotTildeFullEqual
- make_pair(L"\U00002245", L"\U00002247"),
- // TildeTilde => NotTildeTilde
- make_pair(L"\U00002248", L"\U00002249"),
- // > => NotLess
- make_pair(L"<", L"\U0000226E"),
- // < => NotGreater
- make_pair(L">", L"\U0000226F"),
- // leq => NotLessEqual
- make_pair(L"\U00002264", L"\U00002270"),
- // GreaterEqual => NotGreaterEqual
- make_pair(L"\U00002265", L"\U00002271"),
- // FIX: what about "Precedes", "Succeeds"?
- // subset => nsub
- make_pair(L"\U00002282", L"\U00002284"),
- // Superset => nsup
- make_pair(L"\U00002283", L"\U00002285"),
- // SubsetEqual => NotSubsetEqual
- make_pair(L"\U00002286", L"\U00002288"),
- // SupersetEqual => NotSupersetEqual
- make_pair(L"\U00002287", L"\U00002289"),
- // RightTee => nvdash
- make_pair(L"\U000022A2", L"\U000022AC"),
- // DoubleRightTee => nvDash
- make_pair(L"\U000022A8", L"\U000022AD"),
- // Vdash => nVdash
- make_pair(L"\U000022A9", L"\U000022AE"),
- // SquareSubsetEqual => NotSquareSubsetEqual
- make_pair(L"\U00002291", L"\U000022E2"),
- // SquareSupersetEqual => NotSquareSupersetEqual
- make_pair(L"\U00002292", L"\U000022E3"),
- // LeftTriangle => NotLeftTriangle
- make_pair(L"\U000022B2", L"\U000022EA"),
- // RightTriangle => NotRightTriangle
- make_pair(L"\U000022B3", L"\U000022EB"),
- // LeftTriangleEqual => NotLeftTriangleEqual
- make_pair(L"\U000022B4", L"\U000022EC"),
- // RightTriangleEqual => NotRightTriangleEqual
- make_pair(L"\U000022B5", L"\U000022ED")
-};
-wishful_hash_map<wstring, wstring> gNegationTable(
- gNegationArray,
- END_ARRAY(gNegationArray)
-);
-
-
-void Row::Optimise()
-{
- list<Node*>::iterator lastSpace = mChildren.end();
- list<Node*>::iterator lastNonSpace = mChildren.end();
-
- // Throughout this loop, we ensure that:
- // * lastNonSpace points to the most recently seen non-Space node,
- // or mChildren.end() if none have yet been seen;
- // * lastSpace points to the most recently seen Space node *following*
- // lastNonSpace, or just the most recently seen Space node if
- // lastNonSpace == mChildren.end().
-
- for (list<Node*>::iterator
- current = mChildren.begin(); current != mChildren.end(); ++current
- )
- {
- // Recurse:
- (*current)->Optimise();
-
- Space* currentAsSpace = dynamic_cast<Space*>(*current);
- if (currentAsSpace)
- {
- if (lastSpace == mChildren.end())
- lastSpace = current;
- else
- {
- // Merge the two adjacent Space nodes.
- Space* lastSpaceAsSpace = dynamic_cast<Space*>(*lastSpace);
- if (lastSpaceAsSpace->mIsUserRequested)
- currentAsSpace->mIsUserRequested = true;
- currentAsSpace->mWidth += lastSpaceAsSpace->mWidth;
- mChildren.erase(lastSpace);
- lastSpace = current;
- }
- }
- else
- {
- if (
- lastNonSpace != mChildren.end() &&
- (
- lastSpace == mChildren.end() ||
- (dynamic_cast<Space*>(*lastSpace))->mWidth == 0
- )
- )
- {
- // We have found two non-Space nodes with zero space between
- // them. Now determine whether we want to merge them.
-
- // The first special case is if the first symbol is a
- // "\not" command, and we try to come up with a MathML
- // character which represents the negation of the following
- // operator.
- SymbolOperator* lastNonSpaceAsOperator =
- dynamic_cast<SymbolOperator*>(*lastNonSpace);
- SymbolOperator* currentAsOperator =
- dynamic_cast<SymbolOperator*>(*current);
- wishful_hash_map<wstring, wstring>::const_iterator
- negationLookup;
-
- if (
- lastNonSpaceAsOperator &&
- lastNonSpaceAsOperator->mText == L"NOT" &&
- currentAsOperator &&
- (negationLookup =
- gNegationTable.find(currentAsOperator->mText))
- != gNegationTable.end()
- )
- {
- // Replace with appropriate negated character.
-
- if (lastSpace != mChildren.end())
- mChildren.erase(lastSpace);
-
- currentAsOperator->mText = negationLookup->second;
- mChildren.erase(lastNonSpace);
- }
- else
- {
-
- // OK, that special case didn't work out.
- // If the current node is a scripts node, find its core.
- Node* currentCore = *current;
- Scripts* currentCoreAsScripts;
- while (
- currentCore &&
- (currentCoreAsScripts =
- dynamic_cast<Scripts*>(currentCore))
- )
- currentCore = currentCoreAsScripts->mBase.get();
-
- // Check candidates are Symbols and their fonts, styles,
- // colours match, and then either:
- // * both are SymbolNumber, or
- // * both are SymbolText, or
- // * both are SymbolIdentifier and their fonts are both
- // normal (this case covers things like <mi>sin</mi>)
-
- Symbol* currentCoreAsSymbol =
- dynamic_cast<Symbol*>(currentCore);
- Symbol* lastNonSpaceAsSymbol =
- dynamic_cast<Symbol*>(*lastNonSpace);
-
- if (
- currentCoreAsSymbol && lastNonSpaceAsSymbol
- &&
- currentCoreAsSymbol->mFont ==
- lastNonSpaceAsSymbol->mFont
- &&
- currentCoreAsSymbol->mStyle ==
- lastNonSpaceAsSymbol->mStyle
- &&
- currentCoreAsSymbol->mColour ==
- lastNonSpaceAsSymbol->mColour
- &&
- (
- (dynamic_cast<SymbolNumber*>(currentCore) &&
- dynamic_cast<SymbolNumber*>(*lastNonSpace))
- ||
- (dynamic_cast<SymbolText*>(currentCore) &&
- dynamic_cast<SymbolText*>(*lastNonSpace))
- ||
- (
- dynamic_cast<SymbolIdentifier*>
- (currentCore)
- &&
- dynamic_cast<SymbolIdentifier*>
- (*lastNonSpace)
- &&
- currentCoreAsSymbol->mFont ==
- cMathmlFontNormal
- &&
- lastNonSpaceAsSymbol->mFont ==
- cMathmlFontNormal
- )
- )
- )
- {
- // Let's MERGE.
- // (We do this a slightly odd way to maintain O(n)
- // complexity.)
-
- if (lastSpace != mChildren.end())
- mChildren.erase(lastSpace);
-
- lastNonSpaceAsSymbol->mText +=
- currentCoreAsSymbol->mText;
-
- lastNonSpaceAsSymbol->mText.swap(
- currentCoreAsSymbol->mText
- );
-
- mChildren.erase(lastNonSpace);
- }
- }
- }
-
- lastNonSpace = current;
- lastSpace = mChildren.end();
- }
- }
-}
-
-
-void Scripts::Optimise()
-{
- if (mBase.get())
- mBase->Optimise();
- if (mLower.get())
- mLower->Optimise();
- if (mUpper.get())
- mUpper->Optimise();
-}
-
-
-void Fraction::Optimise()
-{
- mNumerator->Optimise();
- mDenominator->Optimise();
-}
-
-
-void Fenced::Optimise()
-{
- mChild->Optimise();
-}
-
-
-void Sqrt::Optimise()
-{
- mChild->Optimise();
-}
-
-
-void Root::Optimise()
-{
- mInside->Optimise();
- mOutside->Optimise();
-}
-
-
-void Table::Optimise()
-{
- for (
- vector<vector<Node*> >::iterator row = mRows.begin();
- row != mRows.end();
- ++row
- )
- for (
- vector<Node*>::iterator entry = row->begin();
- entry != row->end();
- ++entry
- )
- (*entry)->Optimise();
-}
-
-
-// =========================================================================
-// Now all the LayoutTree debugging code
-
-
-wstring indent(int depth)
-{
- return wstring(2 * depth, L' ');
-}
-
-wstring Node::PrintFields() const
-{
- static wstring gFlavourStrings[] =
- {
- L"ord",
- L"op",
- L"bin",
- L"rel",
- L"open",
- L"close",
- L"punct",
- L"inner"
- };
-
- static wstring gLimitsStrings[] =
- {
- L"displaylimits",
- L"limits",
- L"nolimits"
- };
-
- static wstring gStyleStrings[] =
- {
- L"displaystyle",
- L"textstyle",
- L"scriptstyle",
- L"scriptscriptstyle"
- };
-
- wstring output = gFlavourStrings[mFlavour];
- if (mFlavour == cFlavourOp)
- output += L" " + gLimitsStrings[mLimits];
- output += L" " + gStyleStrings[mStyle];
- wostringstream colourHex;
- colourHex << hex << setw(6) << setfill(L'0') << mColour;
- output += L" 0x" + colourHex.str();
- return output;
-}
-
-void Row::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"Row " << PrintFields() << endl;
- for (list<Node*>::const_iterator
- ptr = mChildren.begin();
- ptr != mChildren.end();
- ptr++
- )
- (*ptr)->Print(os, depth+1);
-}
-
-void SymbolIdentifier::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"SymbolIdentifier \"" << mText << L"\" "
- << gMathmlFontStrings[mFont] << L" " << PrintFields() << endl;
-}
-
-void SymbolNumber::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"SymbolNumber \"" << mText << L"\" "
- << gMathmlFontStrings[mFont] << L" " << PrintFields() << endl;
-}
-
-void SymbolText::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"SymbolText \"" << mText << L"\" "
- << gMathmlFontStrings[mFont] << L" " << PrintFields() << endl;
-}
-
-void SymbolOperator::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"SymbolOperator \"" << mText << L"\" "
- << gMathmlFontStrings[mFont]
- << (mIsStretchy ? L" stretchy" : L" non-stretchy")
- << (mIsAccent ? L" accent" : L"");
- if (!mSize.empty())
- os << L" size=\"" << mSize << L"\"";
- os << L" " << PrintFields() << endl;
-}
-
-void Space::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"Space " << mWidth;
- if (mIsUserRequested)
- os << L" (user requested)";
- os << endl;
-}
-
-void Scripts::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"Scripts "
- << (mIsSideset ? L"sideset" : L"underover")
- << L" " << PrintFields() << endl;
-
- if (mBase.get())
- {
- os << indent(depth+1) << L"base" << endl;
- mBase->Print(os, depth+2);
- }
- if (mUpper.get())
- {
- os << indent(depth+1) << L"upper" << endl;
- mUpper->Print(os, depth+2);
- }
- if (mLower.get())
- {
- os << indent(depth+1) << L"lower" << endl;
- mLower->Print(os, depth+2);
- }
-}
-
-void Fraction::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"Fraction ";
- if (!mIsLineVisible)
- os << L"(no visible line) ";
- os << PrintFields() << endl;
- mNumerator->Print(os, depth+1);
- mDenominator->Print(os, depth+1);
-}
-
-void Fenced::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"Fenced \""
- << mLeftDelimiter << L"\" \""
- << mRightDelimiter << L"\" "
- << PrintFields() << endl;
- mChild->Print(os, depth+1);
-}
-
-void Sqrt::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"Sqrt " << PrintFields() << endl;
- mChild->Print(os, depth+1);
-}
-
-void Root::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"Root " << PrintFields() << endl;
- mInside->Print(os, depth+1);
- mOutside->Print(os, depth+1);
-}
-
-void Table::Print(wostream& os, int depth) const
-{
- static wstring gAlignStrings[] =
- {
- L"left",
- L"centre",
- L"rightleft"
- };
-
- os << indent(depth) << L"Table " << PrintFields() << L" "
- << gAlignStrings[mAlign] << endl;
- for (vector<vector<Node*> >::const_iterator
- row = mRows.begin();
- row != mRows.end();
- row++
- )
- {
- os << indent(depth+1) << L"Table row" << endl;
- for (vector<Node*>::const_iterator
- entry = row->begin();
- entry != row->end();
- entry++
- )
- (*entry)->Print(os, depth+2);
- }
-}
-
-
-}
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/LayoutTree.h b/blahtexml/source/BlahtexCore/LayoutTree.h
deleted file mode 100644
index 512fec2..0000000
--- a/blahtexml/source/BlahtexCore/LayoutTree.h
+++ /dev/null
@@ -1,670 +0,0 @@
-// File "LayoutTree.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_LAYOUTTREE_H
-#define BLAHTEX_LAYOUTTREE_H
-
-#include "MathmlNode.h"
-
-namespace blahtex
-{
-
-// The maximum number of nodes allowed in the output MathML tree.
-// (This limit is imposed to prevent users eliciting quadratic time by
-// inputting arrays with lots of empty entries.)
-const unsigned cMaxMathmlNodeCount = 2500;
-
-
-struct MathmlEnvironment;
-
-// The LayoutTree namespace contains all classes that represents nodes in
-// the layout tree. The layout tree is an intermediate stage between the
-// parse tree and the final output XML tree.
-namespace LayoutTree
-{
- // Base class for layout tree nodes.
- struct Node
- {
- virtual ~Node()
- { }
-
- // This field is only used during the layout tree building phase, to
- // determine inter-atomic spacing. The values correspond roughly
- // to TeX's differently flavoured atoms. (We omit several flavours
- // that TeX uses, like "acc" and "rad"; these are generally handled
- // as "ord".)
- //
- // This field is ignored for LayoutTree::Space nodes.
- enum Flavour
- {
- cFlavourOrd,
- cFlavourOp,
- cFlavourBin,
- cFlavourRel,
- cFlavourOpen,
- cFlavourClose,
- cFlavourPunct,
- cFlavourInner
- }
- mFlavour;
-
- // This field is only used during the layout tree building phase, to
- // determine script placement. It corresponds to TeX's "limits",
- // "nolimits", "displaylimits" trichotomy.
- //
- // It is only valid if mFlavour == cFlavourOp.
- enum Limits
- {
- cLimitsDisplayLimits,
- cLimitsLimits,
- cLimitsNoLimits
- }
- mLimits;
-
- // This field corresponds to TeX's displaystyle/textstyle/
- // scriptstyle/scriptscriptstyle setting. (We ignore the cramped/
- // uncramped variations.)
- //
- // This field is ignored for LayoutTree::Space nodes.
- enum Style
- {
- cStyleDisplay, // like \displaystyle
- cStyleText, // like \textstyle
- cStyleScript, // like \scriptstyle
- cStyleScriptScript // like \scriptscriptstyle
- }
- mStyle;
-
- // Colour of the node. For symbols this is the colour of the symbol;
- // for fractions it's the colour of the horizontal bar; for radicals
- // it's the colour of the radical symbol.
- //
- // This field is ignored for LayoutTree::Space nodes.
- RGBColour mColour;
-
-
- Node(
- Style style,
- Flavour flavour,
- Limits limits,
- RGBColour colour
- ) :
- mStyle(style),
- mFlavour(flavour),
- mLimits(limits),
- mColour(colour)
- { }
-
-
- // This function "optimises" the tree beneath the current node:
- // (1) It merges adjacent Space nodes into single spaces, and
- // (2) It merges adjacent Symbol nodes in certain situations.
- // For exammple, we want <mn>12</mn> instead of
- // <mn>1</mn><mn>2</mn>, and <mi>sin</mi> instead of
- // <mi mathvariant="normal">s</mi>
- // <mi mathvariant="normal">i</mi>
- // <mi mathvariant="normal">n</mi> !!!!
- virtual void Optimise()
- { }
-
-
- // This function converts the layout tree rooted at this node into
- // a MathML tree.
- //
- // The inheritedEnvironment parameter tells it what assumptions to
- // make about its rendering environment. It uses these to decide
- // whether to insert extra <mstyle> tags.
- //
- // The nodeCount parameter is used to keep track of the total number
- // of nodes in the MathML tree. For security reasons we put a hard
- // limit on this. (See cMaxMathmlNodeCount.)
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const = 0;
-
-
- // This function recursively prints the layout tree under this node.
- // Debugging use only.
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const = 0;
-
- std::wstring PrintFields() const; // used internally by Print
- };
-
-
- // A Row stores a list of children nodes. It gets translated into an
- // <mrow> node in the MathML tree.
- //
- // No Row ever has another Row node as its child.
- struct Row : Node
- {
- std::list<Node*> mChildren;
-
- Row(Style style, RGBColour colour) :
- Node(style, cFlavourOrd, cLimitsDisplayLimits, colour)
- { }
-
- ~Row();
-
- virtual void Optimise();
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // Symbol is an abstract class; its concrete subclasses are
- // SymbolIdentifier, SymbolNumber, SymbolOperator, SymbolText. It
- // represents anything that will get translated as <mn>, <mi>, <mo>
- // or <mtext>. It describes the text that goes inside the tags (mText)
- // and what font it should be in (mFont).
- struct Symbol : Node
- {
- std::wstring mText;
- MathmlFont mFont;
-
- Symbol(
- const std::wstring& text,
- MathmlFont font,
- Style style,
- Flavour flavour,
- Limits limits,
- RGBColour colour
- ) :
- Node(style, flavour, limits, colour),
- mText(text),
- mFont(font)
- { }
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const = 0;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const = 0;
- };
-
-
- // SymbolIdentifier represents things translated as <mi>.
- struct SymbolIdentifier : Symbol
- {
- SymbolIdentifier(
- const std::wstring& text,
- MathmlFont font,
- Style style,
- Flavour flavour,
- Limits limits,
- RGBColour colour
- ) :
- Symbol(text, font, style, flavour, limits, colour)
- { }
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // SymbolNumber represents things translated as <mn>.
- struct SymbolNumber : Symbol
- {
- SymbolNumber(
- const std::wstring& text,
- MathmlFont font,
- Style style,
- Flavour flavour,
- Limits limits,
- RGBColour colour
- ) :
- Symbol(text, font, style, flavour, limits, colour)
- { }
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // SymbolText represents things translated as <mtext>.
- //
- // Actually, each SymbolText represents just a single character;
- // they get merged by their parent's Row::BuildMathmlTree() function.
- struct SymbolText : Symbol
- {
- SymbolText(
- const std::wstring& text,
- MathmlFont font,
- Style style,
- RGBColour colour
- ) :
- Symbol(
- text, font, style, cFlavourOrd, cLimitsDisplayLimits, colour
- )
- { }
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // SymbolOperator represents things translated as <mo>.
- struct SymbolOperator : Symbol
- {
- // Whether or not this operator is stretchy.
- //
- // Note: because of the existence of the MathML operator dictionary,
- // BuildMathmlTree() needs to do a bit of work to decide whether
- // to actually use a "stretchy" attribute to implement this flag.
- bool mIsStretchy;
-
- // mSize, if non-empty, indicates the "minsize" and "maxsize"
- // attributes. It is only valid if mIsStretchy is true.
- std::wstring mSize;
-
- // Whether to use the accent="true" attribute.
- //
- // Again, BuildMathmlTree needs to do some work to decide if the
- // "accent" attribute is actually needed.
- bool mIsAccent;
-
- SymbolOperator(
- bool isStretchy,
- const std::wstring& size,
- bool isAccent,
- const std::wstring& text,
- MathmlFont font,
- Style style,
- Flavour flavour,
- Limits limits,
- RGBColour colour
- ) :
- Symbol(text, font, style, flavour, limits, colour),
- mIsStretchy(isStretchy),
- mSize(size),
- mIsAccent(isAccent)
- { }
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // Represents a space. This may or not actually end up as MathML markup,
- // depending on a variety of things.
- struct Space : Node
- {
- // mWidth is the width of the space, measured in mu.
- // (18mu = 1em in normal font size.)
- // It may be negative.
- int mWidth;
-
- // This flag indicates whether the space was requested by the user
- // via a TeX spacing command like "\quad". False means that blahtex
- // computed the space (according to TeX's rules).
- bool mIsUserRequested;
-
- Space(
- int width,
- bool isUserRequested
- ) :
- Node(cStyleDisplay, cFlavourOrd, cLimitsDisplayLimits, 0),
- mWidth(width),
- mIsUserRequested(isUserRequested)
- { }
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // Represents a base with a subscript and/or a superscript,
- // OR a base with an underscript and/or an overscript.
- struct Scripts : Node
- {
- // Any of the following three fields may be NULL (i.e. empty).
- std::auto_ptr<Node> mBase, mUpper, mLower;
-
- // True means sub/superscript; false means under/overscript.
- //
- // (This flag is computed from e.g. the "limits" setting of mBase,
- // and from the current TeX style.)
- bool mIsSideset;
-
- Scripts(
- Style style,
- Flavour flavour,
- Limits limits,
- RGBColour colour,
- bool isSideset,
- std::auto_ptr<Node> base,
- std::auto_ptr<Node> upper,
- std::auto_ptr<Node> lower
- ) :
- Node(style, flavour, limits, colour),
- mIsSideset(isSideset),
- mBase(base),
- mUpper(upper),
- mLower(lower)
- { }
-
- virtual void Optimise();
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // Represents something that will get translated as <mfrac>.
- struct Fraction : Node
- {
- std::auto_ptr<Node> mNumerator, mDenominator;
-
- // Does the fraction need a visible line?
- // True for ordinary vanilla fractions; false for things like
- // binomial coefficients.
- bool mIsLineVisible;
-
- Fraction(
- Style style,
- RGBColour colour,
- std::auto_ptr<Node> numerator,
- std::auto_ptr<Node> denominator,
- bool isLineVisible
- ) :
- Node(style, cFlavourOrd, cLimitsDisplayLimits, colour),
- mNumerator(numerator),
- mDenominator(denominator),
- mIsLineVisible(isLineVisible)
- { }
-
- virtual void Optimise();
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // Represents an expression between a pair of delimiters.
- //
- // (Blahtex doesn't translate this using <mfenced>, because then we
- // couldn't use more exotic (non-ASCII) fences in the "open" and
- // "close" attributes.)
- struct Fenced : Node
- {
- // The opening and closing delimiters, i.e. the text that goes
- // inside <mo>...</mo>.
- std::wstring mLeftDelimiter, mRightDelimiter;
-
- // The expression being surrounded by fences.
- std::auto_ptr<Node> mChild;
-
- Fenced(
- Style style,
- RGBColour colour,
- const std::wstring& leftDelimiter,
- const std::wstring& rightDelimiter,
- std::auto_ptr<Node> child
- ) :
- Node(style, cFlavourInner, cLimitsDisplayLimits, colour),
- mLeftDelimiter(leftDelimiter),
- mRightDelimiter(rightDelimiter),
- mChild(child)
- { }
-
- virtual void Optimise();
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // Represents an expression under a square root sign; i.e. something
- // translated as <msqrt>.
- struct Sqrt : Node
- {
- // The expression under the radical.
- std::auto_ptr<Node> mChild;
-
- Sqrt(
- std::auto_ptr<Node> child,
- RGBColour colour
- ) :
- Node(child->mStyle, cFlavourOrd, cLimitsDisplayLimits, colour),
- mChild(child)
- { }
-
- virtual void Optimise();
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // Represents an expression under a general radical sign; i.e. something
- // translated as <mroot>.
- struct Root : Node
- {
- // The expressions under and outside the radical.
- std::auto_ptr<Node> mInside, mOutside;
-
- Root(
- std::auto_ptr<Node> inside,
- std::auto_ptr<Node> outside,
- RGBColour colour
- ) :
- Node(inside->mStyle, cFlavourOrd, cLimitsDisplayLimits, colour),
- mInside(inside),
- mOutside(outside)
- { }
-
- virtual void Optimise();
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-
- // Represents something translated as <mtable>.
- struct Table : Node
- {
- // Array of rows of table entries.
- std::vector<std::vector<Node*> > mRows;
-
- // These values describe the possible alignment values for the
- // table. Most environments (e.g. "matrix", "pmatrix") use
- // cAlignCentre. The environments "cases" uses cAlignLeft (all table
- // entries aligned to the left). cAlignRightLeft alternates columns
- // aligned right and left; it's used for the "aligned" environment.
- enum Align
- {
- cAlignLeft,
- cAlignCentre,
- cAlignRightLeft
- }
- mAlign;
-
- // How much space to put between rows of the table. Currently
- // "tight" is used for "\substack" blocks, everything else
- // gets "normal".
- enum RowSpacing
- {
- cRowSpacingNormal,
- cRowSpacingTight
- }
- mRowSpacing;
-
- Table(
- Style style,
- RGBColour colour,
- RowSpacing rowSpacing = cRowSpacingNormal
- ) :
- Node(style, cFlavourOrd, cLimitsDisplayLimits, colour),
- mAlign(cAlignCentre),
- mRowSpacing(rowSpacing)
- { }
-
- ~Table();
-
- virtual void Optimise();
-
- virtual std::auto_ptr<MathmlNode> BuildMathmlTree(
- const MathmlOptions& options,
- const MathmlEnvironment& inheritedEnvironment,
- unsigned& nodeCount
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const;
- };
-
-} // end LayoutTree namespace
-
-
-// This struct records some information about the rendering environment for
-// a portion of the MathML tree. It is used when building the MathML tree
-// to decide when it is necessary to insert additional <mstyle> tags.
-struct MathmlEnvironment
-{
- // The "displaystyle" and "scriptlevel" attributes.
- bool mDisplayStyle;
- int mScriptLevel;
-
- // The "mathcolor" attribute.
- RGBColour mColour;
-
- MathmlEnvironment(
- bool displayStyle = false,
- int scriptLevel = 0,
- RGBColour colour = 0
- ) :
- mDisplayStyle(displayStyle),
- mScriptLevel(scriptLevel),
- mColour(colour)
- { }
-
- // This constructor determines the displayStyle and scriptLevel settings
- // corresponding to the given TeX style.
- MathmlEnvironment(
- LayoutTree::Node::Style style,
- RGBColour colour
- );
-};
-
-}
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/MacroProcessor.cpp b/blahtexml/source/BlahtexCore/MacroProcessor.cpp
deleted file mode 100644
index f1a066d..0000000
--- a/blahtexml/source/BlahtexCore/MacroProcessor.cpp
+++ /dev/null
@@ -1,332 +0,0 @@
-// File "MacroProcessor.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include "MacroProcessor.h"
-
-using namespace std;
-
-namespace blahtex
-{
-
-// Implemented in Parser.cpp:
-extern bool IsInTokenTables(const wstring& token);
-
-// If the input string ends with "Reserved", this function strips it off.
-// All other input is returned unharmed.
-//
-// The purpose is to convert internal commands like "\textReserved" into
-// plain old "\text" for error reporting purposes.
-wstring StripReservedSuffix(const wstring& input)
-{
- if (input.size() >= 8 &&
- input.substr(input.size() - 8, 8) == L"Reserved"
- )
- return input.substr(0, input.size() - 8);
- else
- return input;
-}
-
-MacroProcessor::MacroProcessor(const vector<wstring>& input)
-{
- copy(input.rbegin(), input.rend(), inserter(mTokens, mTokens.begin()));
- mCostIncurred = input.size();
- mIsTokenReady = false;
-}
-
-void MacroProcessor::Advance()
-{
- if (!mTokens.empty())
- {
- mTokens.pop_back();
- mCostIncurred++;
- mIsTokenReady = false;
- }
-}
-
-void MacroProcessor::SkipWhitespace()
-{
- while (Peek() == L" ")
- Advance();
-}
-
-void MacroProcessor::SkipWhitespaceRaw()
-{
- while (!mTokens.empty() && mTokens.back() == L" ")
- Advance();
-}
-
-bool MacroProcessor::ReadArgument(vector<wstring>& output)
-{
- SkipWhitespaceRaw();
- if (mTokens.empty())
- // Missing argument
- return false;
-
- wstring token = mTokens.back();
- mTokens.pop_back();
- mCostIncurred++;
- if (token == L"}")
- // Argument can't start with "}"
- return false;
-
- if (token == L"{")
- {
- // Keep track of brace nesting depth so we know which is the
- // matching closing brace
- int braceDepth = 1;
- while (!mTokens.empty())
- {
- mCostIncurred++;
- wstring token = mTokens.back();
- mTokens.pop_back();
- if (token == L"{")
- braceDepth++;
- else if (token == L"}" && --braceDepth == 0)
- break;
- output.push_back(token);
- }
- if (braceDepth > 0)
- throw Exception(L"UnmatchedOpenBrace");
- }
- else
- output.push_back(token);
-
- mIsTokenReady = false;
- return true;
-}
-
-wstring MacroProcessor::Get()
-{
- wstring token = Peek();
- Advance();
- return token;
-}
-
-void MacroProcessor::HandleNewcommand()
-{
- // pop the "\newcommand" command:
- mTokens.pop_back();
- mCostIncurred++;
-
- // gobble opening brace
- SkipWhitespaceRaw();
- if (mTokens.empty() || mTokens.back() != L"{")
- throw Exception(L"MissingOpenBraceAfter", L"\\newcommand");
- mTokens.pop_back();
-
- // grab new command being defined
- SkipWhitespaceRaw();
- if (mTokens.empty() ||
- mTokens.back().empty() ||
- mTokens.back()[0] != L'\\'
- )
- throw Exception(L"MissingCommandAfterNewcommand");
- wstring newCommand = mTokens.back();
- if (mMacros.count(newCommand) || IsInTokenTables(newCommand))
- throw Exception(
- L"IllegalRedefinition",
- StripReservedSuffix(newCommand)
- );
- mTokens.pop_back();
-
- // gobble close brace
- SkipWhitespaceRaw();
- if (mTokens.empty())
- throw Exception(L"UnmatchedOpenBrace");
- if (mTokens.back() != L"}")
- throw Exception(L"MissingCommandAfterNewcommand");
- mTokens.pop_back();
-
- Macro& macro = mMacros[newCommand];
-
- SkipWhitespaceRaw();
- // Determine the number of arguments, if specified.
- if (!mTokens.empty() && mTokens.back() == L"[")
- {
- mTokens.pop_back();
-
- SkipWhitespaceRaw();
- if (mTokens.empty() || mTokens.back().size() != 1)
- throw Exception(L"MissingOrIllegalParameterCount", newCommand);
- macro.mParameterCount = static_cast<int>(mTokens.back()[0] - L'0');
- if (macro.mParameterCount <= 0 || macro.mParameterCount > 9)
- throw Exception(L"MissingOrIllegalParameterCount", newCommand);
- mTokens.pop_back();
-
- SkipWhitespaceRaw();
- if (mTokens.empty() || mTokens.back() != L"]")
- throw Exception(L"UnmatchedOpenBracket");
- mTokens.pop_back();
- }
-
- // Read and store the tokens which make up the macro replacement.
- if (!ReadArgument(macro.mReplacement))
- throw Exception(L"NotEnoughArguments", L"\\newcommand");
-}
-
-wstring MacroProcessor::Peek()
-{
- while (!mTokens.empty())
- {
- // This is the only place that we check that the user hasn't
- // exceeded the token limit.
- if (mTokens.size() + (++mCostIncurred) >= cMaxParseCost)
- throw Exception(L"TooManyTokens");
-
- if (mIsTokenReady)
- return mTokens.back();
-
- // "\sqrt" needs special handling due to its optional argument.
- // Something like "\sqrtReserved{x}" gets converted to "\sqrt{x}".
- // Something like "\sqrtReserved[y]{x}" gets converted to
- // "\rootReserved{y}{x}".
- //
- // (Blahtex doesn't handle grouping of [...] the same way as texvc;
- // it does it the TeX way. For example, "\sqrt[\sqrt[2]{3}]{4}"
- // generates an error, whereas it is valid in texvc.)
- //
- // We need to take into account grouping braces,
- // e.g. "\sqrt[{]}]{2}" should be valid.
- if (mTokens.back() == L"\\sqrtReserved")
- {
- mTokens.pop_back();
-
- SkipWhitespaceRaw();
- if (!mTokens.empty() && mTokens.back() == L"[")
- {
- mTokens.back() = L"{";
-
- vector<wstring>::reverse_iterator ptr = mTokens.rbegin();
- ptr++;
-
- int braceDepth = 0;
- while (ptr != mTokens.rend() &&
- (braceDepth > 0 || *ptr != L"]")
- )
- {
- mCostIncurred++;
- if (*ptr == L"{")
- braceDepth++;
- else if (*ptr == L"}")
- {
- if (--braceDepth < 0)
- throw Exception(L"UnmatchedCloseBrace");
- }
- ptr++;
- }
- if (ptr == mTokens.rend())
- throw Exception(L"UnmatchedOpenBracket");
- if (*ptr != L"]")
- throw Exception(L"NotEnoughArguments", L"\\sqrt");
- *ptr = L"}";
- mTokens.push_back(L"\\rootReserved");
- mIsTokenReady = true;
- return L"\\rootReserved";
- }
- else
- {
- mTokens.push_back(L"\\sqrt");
- mIsTokenReady = true;
- return L"\\sqrt";
- }
- }
- else
- {
- wstring token = mTokens.back();
- wishful_hash_map<wstring, Macro>::const_iterator
- macroPtr = mMacros.find(token);
- if (macroPtr == mMacros.end())
- {
- // In this case it's not "\sqrt" and not a macro, so
- // we're finished here.
- mIsTokenReady = true;
- return token;
- }
-
- const Macro& macro = macroPtr->second;
- mTokens.pop_back();
-
- // It's a macro. Determines the arguments to substitute in....
- vector<vector<wstring> > arguments(macro.mParameterCount);
- for (int argumentIndex = 0;
- argumentIndex < macro.mParameterCount;
- argumentIndex++
- )
- if (!ReadArgument(arguments[argumentIndex]))
- throw Exception(
- L"NotEnoughArguments",
- StripReservedSuffix(token)
- );
-
- // ... and now write the replacement, substituting
- // arguments as we go.
- const vector<wstring>& replacement = macro.mReplacement;
- vector<wstring> output;
- for (vector<wstring>::const_iterator
- source = replacement.begin();
- source != replacement.end();
- source++
- )
- {
- mCostIncurred++;
- if (*source == L"#")
- {
- if (++source == replacement.end() ||
- source->size() != 1
- )
- throw Exception(
- L"MissingOrIllegalParameterIndex",
- token
- );
-
- int parameterIndex
- = static_cast<int>((*source)[0] - '1');
-
- // FIX: perhaps this next error should be flagged when
- // reading the definition of the macro rather than
- // during macro expansion
- if (parameterIndex < 0 ||
- parameterIndex >= macro.mParameterCount
- )
- throw Exception(
- L"MissingOrIllegalParameterIndex",
- token
- );
- copy(
- arguments[parameterIndex].begin(),
- arguments[parameterIndex].end(),
- back_inserter(output)
- );
- mCostIncurred += arguments[parameterIndex].size();
- }
- else
- output.push_back(*source);
- }
- copy(output.rbegin(), output.rend(), back_inserter(mTokens));
- mCostIncurred += output.size();
- }
- }
-
- return L"";
-}
-
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/MacroProcessor.h b/blahtexml/source/BlahtexCore/MacroProcessor.h
deleted file mode 100644
index 3fdc377..0000000
--- a/blahtexml/source/BlahtexCore/MacroProcessor.h
+++ /dev/null
@@ -1,125 +0,0 @@
-// File "MacroProcessor.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_MACROPROCESSOR_H
-#define BLAHTEX_MACROPROCESSOR_H
-
-#include <string>
-#include <vector>
-#include <map>
-#include "Misc.h"
-
-namespace blahtex
-{
-
-// The time spent by the parser should be O(cMaxParseCost).
-// The aim is to prevent a nasty user inducing exponential time via
-// tricky macro definitions.
-const unsigned cMaxParseCost = 20000;
-
-
-// MacroProcessor maintains a stack of tokens, can be queried for the next
-// available token, and expands macros automatically. It is the layer
-// between tokenising (handled by the Manager class) and parsing proper
-// (handled by the Parser class).
-//
-// It does not process "\newcommand" commands automatically; instead it
-// passes "\newcommand" straight back to the caller, and the caller is
-// responsible for calling MacroProcessor::HandleNewcommand.
-// (Rationale: this gives results much closer to real TeX parsing. For
-// example, we wouldn't want "x^\newcommand{\stuff}{xyz}\stuff" to be
-// construed as legal input.)
-class MacroProcessor
-{
-public:
- // Input is a vector of strings, one for each input token.
- MacroProcessor(const std::vector<std::wstring>& input);
-
- // Returns the next token on the stack (without removing it), after
- // expanding macros.
- // Returns empty string if there are no tokens left.
- std::wstring Peek();
-
- // Same as Peek(), but also removes the token.
- // Returns empty string if there are no tokens left.
- std::wstring Get();
-
- // Pops the current token.
- void Advance();
-
- // Pops consecutive whitespace tokens.
- void SkipWhitespace();
-
- // Assuming that "\newcommand" has just been seen and popped off the
- // stack, this function processes a subsequent macro definition.
- void HandleNewcommand();
-
-private:
-
- // Records information about a single macro.
- struct Macro
- {
- // The number of parameters the macro accepts. (Blahtex doesn't
- // handle optional arguments.)
- int mParameterCount;
-
- // The sequence of tokens that get substituted when this macro is
- // expanded. Arguments are indicated as follows: first the string
- // "#", and then the string "n", where n is a number between 1 and
- // 9, indicating which argument to substitute.
- std::vector<std::wstring> mReplacement;
-
- Macro() :
- mParameterCount(0)
- { }
- };
-
- // List of all currently recognised macros.
- wishful_hash_map<std::wstring, Macro> mMacros;
-
- // The token stack; the top of the stack is mTokens.back().
- std::vector<std::wstring> mTokens;
-
- // This flag is set if we have already ascertained that the current
- // token doesn't need to undergo macro expansion.
- // (This is just an optimisation so that successive calls to Peek/Get
- // don't have to do extra work.)
- bool mIsTokenReady;
-
- // Reads a single macro argument; that is, either a single token, or if
- // that token is "{", reads all the way up to the matching "}". The
- // argument (not including delimiting braces) is appended to "output".
- //
- // Returns true on success, or false if the argument is missing.
- bool ReadArgument(std::vector<std::wstring>& output);
-
- // Skips whitespace without expanding macros.
- void SkipWhitespaceRaw();
-
- // Total approximate cost of parsing activity so far.
- // (See cMaxParseCost.)
- unsigned mCostIncurred;
-};
-
-}
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/Manager.cpp b/blahtexml/source/BlahtexCore/Manager.cpp
deleted file mode 100644
index 25d5a05..0000000
--- a/blahtexml/source/BlahtexCore/Manager.cpp
+++ /dev/null
@@ -1,553 +0,0 @@
-// File "Manager.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <sstream>
-#include <stdexcept>
-#include "Manager.h"
-#include "Parser.h"
-
-using namespace std;
-
-namespace blahtex
-{
-
-
-// I don't entirely trust the wide versions of isalpha etc, so this
-// function does the job instead.
-bool IsAlphabetic(wchar_t c)
-{
- return (c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z');
-}
-
-
-// Tokenise() splits the given input into tokens, each represented by a
-// string. The output is APPENDED to "output".
-//
-// There are several types of tokens:
-// * single characters like "a", or "{", or single non-ASCII unicode
-// characters
-// * alphabetic commands like "\frac"
-// * commands like "\," which have a single nonalphabetic character
-// after the backslash
-// * commands like "\ " which have their whitespace collapsed,
-// stored as "\ "
-// * other consecutive whitespace characters which get collapsed to
-// just " "
-// * the sequence "\begin { stuff }" gets stored as the single token
-// "\begin{ stuff }". Note that whitespace is preserved between the
-// braces but not between "\begin" and "{". Similarly for "\end".
-void Tokenise(const wstring& input, vector<wstring>& output)
-{
- wstring::const_iterator ptr = input.begin();
-
- while (ptr != input.end())
- {
- // merge adjacent whitespace
- if (iswspace(*ptr))
- {
- output.push_back(L" ");
- do
- ptr++;
- while (ptr != input.end() && iswspace(*ptr));
- }
- // boring single character tokens
- else if (*ptr != L'\\')
- {
- // Disallow non-printable, non-whitespace ASCII
- if (*ptr < L' ' || *ptr == 0x7F)
- throw Exception(L"IllegalCharacter");
- output.push_back(wstring(1, *ptr++));
- }
- else
- {
- // tokens starting with backslash
- wstring token = L"\\";
-
- if (++ptr == input.end())
- throw Exception(L"IllegalFinalBackslash");
- if (IsAlphabetic(*ptr))
- {
- // plain alphabetic commands
- do
- token += *ptr++;
- while (ptr != input.end() && IsAlphabetic(*ptr));
-
- // Special treatment for "\begin" and "\end"; need to
- // collapse "\begin {xyz}" to "\begin{xyz}", and store it
- // as a single token.
- if (token == L"\\begin" || token == L"\\end")
- {
- while (ptr != input.end() && iswspace(*ptr))
- ptr++;
- if (ptr == input.end() || *ptr != L'{')
- throw Exception(L"MissingOpenBraceAfter", token);
- token += *ptr++;
- while (ptr != input.end() && *ptr != L'}')
- token += *ptr++;
- if (ptr == input.end())
- throw Exception(L"UnmatchedOpenBrace");
- token += *ptr++;
- }
- }
- else if (iswspace(*ptr))
- {
- // commands like "\ "
- token += L" ";
- do
- ptr++;
- while (ptr != input.end() && iswspace(*ptr));
- }
- // commands like "\," and "\;"
- else
- token += *ptr++;
-
- output.push_back(token);
- }
- }
-}
-
-
-wstring Manager::gTexvcCompatibilityMacros =
-
- // First we have some macros which are not part of tex/latex/amslatex
- // but which texvc recognises, so for backward compatibility we define
- // them here too. Most of these are apparently intended to cater for
- // those more familiar with HTML entities.
-
- L"\\newcommand{\\R}{{\\mathbb R}}"
- L"\\newcommand{\\Reals}{\\R}"
- L"\\newcommand{\\reals}{\\R}"
- L"\\newcommand{\\Z}{{\\mathbb Z}}"
- L"\\newcommand{\\N}{{\\mathbb N}}"
- L"\\newcommand{\\natnums}{\\N}"
- L"\\newcommand{\\Complex}{{\\mathbb C}}"
- L"\\newcommand{\\cnums}{\\Complex}"
- L"\\newcommand{\\alefsym}{\\aleph}"
- L"\\newcommand{\\alef}{\\aleph}"
- L"\\newcommand{\\larr}{\\leftarrow}"
- L"\\newcommand{\\rarr}{\\rightarrow}"
- L"\\newcommand{\\Larr}{\\Leftarrow}"
- L"\\newcommand{\\lArr}{\\Leftarrow}"
- L"\\newcommand{\\Rarr}{\\Rightarrow}"
- L"\\newcommand{\\rArr}{\\Rightarrow}"
- L"\\newcommand{\\uarr}{\\uparrow}"
- L"\\newcommand{\\uArr}{\\Uparrow}"
- L"\\newcommand{\\Uarr}{\\Uparrow}"
- L"\\newcommand{\\darr}{\\downarrow}"
- L"\\newcommand{\\dArr}{\\Downarrow}"
- L"\\newcommand{\\Darr}{\\Downarrow}"
- L"\\newcommand{\\lrarr}{\\leftrightarrow}"
- L"\\newcommand{\\harr}{\\leftrightarrow}"
- L"\\newcommand{\\Lrarr}{\\Leftrightarrow}"
- L"\\newcommand{\\Harr}{\\Leftrightarrow}"
- L"\\newcommand{\\lrArr}{\\Leftrightarrow}"
- // The next one looks like a typo in the texvc source code:
- L"\\newcommand{\\hAar}{\\Leftrightarrow}"
- L"\\newcommand{\\sub}{\\subset}"
- L"\\newcommand{\\supe}{\\supseteq}"
- L"\\newcommand{\\sube}{\\subseteq}"
- L"\\newcommand{\\infin}{\\infty}"
- L"\\newcommand{\\lang}{\\langle}"
- L"\\newcommand{\\rang}{\\rangle}"
- L"\\newcommand{\\real}{\\Re}"
- L"\\newcommand{\\image}{\\Im}"
- L"\\newcommand{\\bull}{\\bullet}"
- L"\\newcommand{\\weierp}{\\wp}"
- L"\\newcommand{\\isin}{\\in}"
- L"\\newcommand{\\plusmn}{\\pm}"
- L"\\newcommand{\\Dagger}{\\ddagger}"
- L"\\newcommand{\\exist}{\\exists}"
- L"\\newcommand{\\sect}{\\S}"
- L"\\newcommand{\\clubs}{\\clubsuit}"
- L"\\newcommand{\\spades}{\\spadesuit}"
- L"\\newcommand{\\hearts}{\\heartsuit}"
- L"\\newcommand{\\diamonds}{\\diamondsuit}"
- L"\\newcommand{\\sdot}{\\cdot}"
- L"\\newcommand{\\ang}{\\angle}"
- L"\\newcommand{\\thetasym}{\\theta}"
- L"\\newcommand{\\Alpha}{A}"
- L"\\newcommand{\\Beta}{B}"
- L"\\newcommand{\\Epsilon}{E}"
- L"\\newcommand{\\Zeta}{Z}"
- L"\\newcommand{\\Eta}{H}"
- L"\\newcommand{\\Iota}{I}"
- L"\\newcommand{\\Kappa}{K}"
- L"\\newcommand{\\Mu}{M}"
- L"\\newcommand{\\Nu}{N}"
- L"\\newcommand{\\Rho}{P}"
- L"\\newcommand{\\Tau}{T}"
- L"\\newcommand{\\Chi}{X}"
- L"\\newcommand{\\arccot}{\\operatorname{arccot}}"
- L"\\newcommand{\\arcsec}{\\operatorname{arcsec}}"
- L"\\newcommand{\\arccsc}{\\operatorname{arccsc}}"
- L"\\newcommand{\\sgn}{\\operatorname{sgn}}"
-
- // The commands in this next group are defined in tex/latex/amslatex,
- // but they don't get mapped to what texvc thinks (e.g. "\part" is used
- // in typesetting books to mean a unit somewhat larger than a chapter,
- // like "Part IV").
- //
- // We'll stick to the way texvc does it, especially since wikipedia has
- // quite a number of equations using them.
- L"\\newcommand{\\empty}{\\emptyset}"
- L"\\newcommand{\\and}{\\wedge}"
- L"\\newcommand{\\or}{\\vee}"
- L"\\newcommand{\\part}{\\partial}"
-;
-
-wstring Manager::gStandardMacros =
-
- // The next group are standard TeX/LaTeX/AMS-LaTeX synonyms.
- L"\\newcommand{\\|}{\\Vert}"
- L"\\newcommand{\\implies}{\\;\\Longrightarrow\\;}"
- L"\\newcommand{\\neg}{\\lnot}"
- L"\\newcommand{\\ne}{\\neq}"
- L"\\newcommand{\\ge}{\\geq}"
- L"\\newcommand{\\le}{\\leq}"
- L"\\newcommand{\\land}{\\wedge}"
- L"\\newcommand{\\lor}{\\vee}"
- L"\\newcommand{\\gets}{\\leftarrow}"
- L"\\newcommand{\\to}{\\rightarrow}"
- L"\\newcommand{\\doublecap}{\\Cap}"
- L"\\newcommand{\\restriction}{\\upharpoonright}"
- L"\\newcommand{\\llless}{\\lll}"
- L"\\newcommand{\\gggtr}{\\ggg}"
- L"\\newcommand{\\Doteq}{\\doteqdot}"
- L"\\newcommand{\\doublecup}{\\Cup}"
- L"\\newcommand{\\dasharrow}{\\dashleftarrow}"
- L"\\newcommand{\\vartriangleleft}{\\lhd}"
- L"\\newcommand{\\vartriangleright}{\\rhd}"
- L"\\newcommand{\\trianglelefteq}{\\unlhd}"
- L"\\newcommand{\\trianglerighteq}{\\unrhd}"
- L"\\newcommand{\\Join}{\\bowtie}"
- L"\\newcommand{\\Diamond}{\\lozenge}"
-
- // The amsfonts package accepts the following two commands, but warns
- // that they are obsolete, so let's just quietly replace them.
- L"\\newcommand{\\Bbb}{\\mathbb}"
- L"\\newcommand{\\bold}{\\mathbf}"
-
- // Now we come to the xxxReserved commands. These are all implemented
- // as macros in TeX, so for maximum compatibility, we want to treat
- // their arguments the way a TeX macro does. The strategy is the
- // following. First, in Manager::ProcessInput, we convert e.g. "\mbox"
- // into "\mboxReserved". Then, the MacroProcessor object sees e.g.
- // "\mboxReserved A" and converts it to "\mbox{A}". This simplifies
- // things enormously for the parser, since now it can treat "\mbox"
- // and "\hbox" in the same way. ("\hbox" requires braces around its
- // argument, even if it's just a single character.) This strategy also
- // keeps TeX happy when we send off the purified TeX, since TeX doesn't
- // care about the extra braces.
-
- L"\\newcommand{\\mboxReserved} [1]{\\mbox{#1}}"
- L"\\newcommand{\\substackReserved} [1]{\\substack{#1}}"
- L"\\newcommand{\\oversetReserved} [2]{\\overset{#1}{#2}}"
- L"\\newcommand{\\undersetReserved} [2]{\\underset{#1}{#2}}"
-
- // The following are all similar, but they get extra "safety braces"
- // placed around them. For example, "x^\frac yz" is legal, because it
- // becomes "x^{y \over z}".
-
- L"\\newcommand{\\textReserved} [1]{{\\text{#1}}}"
- L"\\newcommand{\\textitReserved} [1]{{\\textit{#1}}}"
- L"\\newcommand{\\textrmReserved} [1]{{\\textrm{#1}}}"
- L"\\newcommand{\\textbfReserved} [1]{{\\textbf{#1}}}"
- L"\\newcommand{\\textsfReserved} [1]{{\\textsf{#1}}}"
- L"\\newcommand{\\textttReserved} [1]{{\\texttt{#1}}}"
- L"\\newcommand{\\emphReserved} [1]{{\\emph{#1}}}"
- L"\\newcommand{\\fracReserved} [2]{{\\frac{#1}{#2}}}"
- L"\\newcommand{\\mathrmReserved} [1]{{\\mathrm{#1}}}"
- L"\\newcommand{\\mathbfReserved} [1]{{\\mathbf{#1}}}"
- L"\\newcommand{\\mathbbReserved} [1]{{\\mathbb{#1}}}"
- L"\\newcommand{\\mathitReserved} [1]{{\\mathit{#1}}}"
- L"\\newcommand{\\mathcalReserved} [1]{{\\mathcal{#1}}}"
- L"\\newcommand{\\mathfrakReserved} [1]{{\\mathfrak{#1}}}"
- L"\\newcommand{\\mathttReserved} [1]{{\\mathtt{#1}}}"
- L"\\newcommand{\\mathsfReserved} [1]{{\\mathsf{#1}}}"
- L"\\newcommand{\\bigReserved} [1]{{\\big#1}}"
- L"\\newcommand{\\biggReserved} [1]{{\\bigg#1}}"
- L"\\newcommand{\\BigReserved} [1]{{\\Big#1}}"
- L"\\newcommand{\\BiggReserved} [1]{{\\Bigg#1}}"
-
- L"\\newcommand{\\japReserved} [1]{{\\jap{#1}}}"
- L"\\newcommand{\\cyrReserved} [1]{{\\cyr{#1}}}"
-;
-
-vector<wstring> Manager::gStandardMacrosTokenised;
-vector<wstring> Manager::gTexvcCompatibilityMacrosTokenised;
-
-Manager::Manager()
-{
- if (sizeof(RGBColour) != 4)
- throw runtime_error("The \"unsigned\" type is not 4 bytes wide!");
-
- // Tokenise the standard macros if it hasn't been done already.
-
- if (gTexvcCompatibilityMacrosTokenised.empty())
- Tokenise(
- gTexvcCompatibilityMacros,
- gTexvcCompatibilityMacrosTokenised
- );
-
- if (gStandardMacrosTokenised.empty())
- Tokenise(gStandardMacros, gStandardMacrosTokenised);
-
- mStrictSpacingRequested = false;
-}
-
-void Manager::ProcessInput(const wstring& input, bool texvcCompatibility)
-{
- // Here are all the commands which get "Reserved" tacked on the end
- // before the MacroProcessor sees them:
-
- static wstring reservedCommandArray[] =
- {
- L"\\sqrt",
- L"\\mbox",
- L"\\text",
- L"\\textit",
- L"\\textrm",
- L"\\textbf",
- L"\\textsf",
- L"\\texttt",
- L"\\jap",
- L"\\cyr",
- L"\\emph",
- L"\\frac",
- L"\\mathrm",
- L"\\mathbf",
- L"\\mathbb",
- L"\\mathit",
- L"\\mathcal",
- L"\\mathfrak",
- L"\\mathtt",
- L"\\mathsf",
- L"\\big",
- L"\\bigg",
- L"\\Big",
- L"\\Bigg",
- L"\\overset",
- L"\\underset",
- L"\\substack"
- };
- static wishful_hash_set<wstring> reservedCommandTable(
- reservedCommandArray,
- END_ARRAY(reservedCommandArray)
- );
-
- vector<wstring> inputTokens;
- Tokenise(input, inputTokens);
-
- mStrictSpacingRequested = false;
-
- // Check that the user hasn't supplied any input directly containing the
- // "Reserved" suffix, and add Reserved suffixes appropriately.
- //
- // Also search for magic commands (currently the only magic command is
- // "\strictspacing")
- for (vector<wstring>::iterator
- ptr = inputTokens.begin();
- ptr != inputTokens.end();
- ptr++
- )
- {
- if (reservedCommandTable.count(*ptr))
- *ptr += L"Reserved";
-
- else if (
- ptr->size() >= 8 &&
- ptr->substr(ptr->size() - 8, 8) == L"Reserved"
- )
- throw Exception(L"ReservedCommand", *ptr);
-
- else if (*ptr == L"\\strictspacing")
- {
- mStrictSpacingRequested = true;
- *ptr = L" ";
- }
- }
-
- vector<wstring> tokens;
-
- // Append the texvc-compatibility and standard macros where appropriate.
-
- if (texvcCompatibility)
- tokens = gTexvcCompatibilityMacrosTokenised;
-
- copy(
- gStandardMacrosTokenised.begin(),
- gStandardMacrosTokenised.end(),
- back_inserter(tokens)
- );
- copy(inputTokens.begin(), inputTokens.end(), back_inserter(tokens));
-
- // Generate the parse tree and the layout tree.
- Parser P;
- mParseTree = P.DoParse(tokens);
- mHasDelayedMathmlError = false;
-
- try
- {
- TexProcessingState topState;
- topState.mStyle = LayoutTree::Node::cStyleText;
- topState.mColour = 0;
- mLayoutTree = mParseTree->BuildLayoutTree(topState);
- mLayoutTree->Optimise();
- }
- catch (Exception& e)
- {
- // Some types of error need to returned as MathML errors, not
- // parsing errors.
- if (e.GetCode() == L"UnavailableSymbolFontCombination")
- {
- mHasDelayedMathmlError = true;
- mDelayedMathmlError = e;
- mLayoutTree.reset(NULL);
- }
- else
- throw e;
- }
-}
-
-
-auto_ptr<MathmlNode> Manager::GenerateMathml(
- const MathmlOptions& options
-) const
-{
- if (mHasDelayedMathmlError)
- throw mDelayedMathmlError;
-
- if (!mLayoutTree.get())
- throw logic_error(
- "Layout tree not yet built in Manager::GenerateMathml"
- );
-
- MathmlOptions optionsCopy = options;
- if (mStrictSpacingRequested)
- // Override the spacing control setting if the "\strictspacing"
- // command appeared somewhere in the input.
- optionsCopy.mSpacingControl = MathmlOptions::cSpacingControlStrict;
-
- // Build the MathML tree. The nodeCount variables counts the number
- // of nodes being generated; if too many appear, an exception is thrown.
- unsigned nodeCount = 0;
- auto_ptr<MathmlNode> root = mLayoutTree->BuildMathmlTree(
- optionsCopy,
- MathmlEnvironment(LayoutTree::Node::cStyleText, RGBColour(0)),
- nodeCount
- );
-
- return root;
-}
-
-
-wstring Manager::GeneratePurifiedTex(
- const PurifiedTexOptions& options
-) const
-{
- if (!mParseTree.get())
- throw logic_error(
- "Parse tree not yet built in Manager::GeneratePurifiedTex"
- );
-
- wostringstream os;
- LatexFeatures features;
- mParseTree->GetPurifiedTex(os, features, cFontEncodingDefault);
- wstring latex = os.str();
-
- if (features.mNeedsX2 || features.mNeedsCJK)
- {
- features.mNeedsUcs = true;
- features.mNeedsAmsmath = true; // for the "\text" command
- }
-
- // Generate purified tex output
-
- wostringstream output;
-
- output <<
- L"\\nonstopmode\n"
- L"\\documentclass[12pt]{article}\n";
-
- if (features.mNeedsAmsmath)
- output << L"\\usepackage{amsmath}\n";
- if (features.mNeedsAmsfonts)
- output << L"\\usepackage{amsfonts}\n";
- if (features.mNeedsAmssymb)
- output << L"\\usepackage{amssymb}\n";
- if (features.mNeedsColor)
- output << L"\\usepackage[dvips,usenames]{color}\n";
-
- if (features.mNeedsUcs)
- {
- if (!options.mAllowUcs)
- throw Exception(L"LatexPackageUnavailable", L"ucs");
-
- output << L"\\usepackage[utf8x]{inputenc}\n";
- }
-
- if (features.mNeedsX2)
- output <<
- L"\\usepackage[X2,T1]{fontenc}\n"
- L"\\newcommand{\\cyr}[1]{\\text{"
- L"\\bgroup\\fontencoding{X2}\\selectfont #1\\egroup}}\n";
-
- if (features.mNeedsCJK)
- {
- if (!options.mAllowCJK)
- throw Exception(L"LatexPackageUnavailable", L"CJK");
-
- output << L"\\usepackage{CJK}\n";
-
- if (features.mNeedsJapaneseFont)
- {
- if (options.mJapaneseFont.empty())
- throw Exception(L"LatexFontNotSpecified", L"japanese");
-
- output
- << L"\\newcommand{\\jap}[1]{\\text{\\begin{CJK}{UTF8}{"
- << options.mJapaneseFont
- << L"}#1\\end{CJK}}}\n";
- }
- }
-
- if (options.mAllowPreview)
- output << L"\\usepackage[active]{preview}\n";
- else
- output << L"\\pagestyle{empty}\n";
-
- output << L"\\begin{document}\n";
-
- if (options.mAllowPreview)
- output << L"\\begin{preview}\n";
-
- output << L"$\n" << latex << L"\n$\n";
-
- if (options.mAllowPreview)
- output << L"\\end{preview}\n";
-
- output << L"\\end{document}\n";
-
- return output.str();
-}
-
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/Manager.h b/blahtexml/source/BlahtexCore/Manager.h
deleted file mode 100644
index 44b5a22..0000000
--- a/blahtexml/source/BlahtexCore/Manager.h
+++ /dev/null
@@ -1,127 +0,0 @@
-// File "Manager.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_MANAGER_H
-#define BLAHTEX_MANAGER_H
-
-#include <string>
-#include <vector>
-#include <memory>
-#include <set>
-#include "Misc.h"
-#include "MathmlNode.h"
-#include "LayoutTree.h"
-#include "ParseTree.h"
-
-namespace blahtex
-{
-
-// The Manager class coordinates all the bits and pieces required to convert
-// the given TeX input into MathML and purified TeX output, including
-// tokenising, texvc-compatiblity macros, building the parse and layout
-// trees, deciding which LaTeX packages to include, converting mathvariant
-// to MathML version 1 fonts.
-//
-// The Manager class could be used as an interface between the blahtex core
-// and an external program; alternatively, the Interface class (see
-// Interface.h) provides a simpler interface.
-
-class Manager
-{
-public:
- Manager();
-
- // ProcessInput generates a parse tree and a layout tree from the
- // supplied input.
- //
- // If texvcCompatibility is set, then ProcessInput will append a series
- // of macros to emulate various non-standard commands that texvc
- // recognises (see gTexvcCompatibilityMacros). This corresponds to the
- // command line option "--texvc-compatible-commands".
- void ProcessInput(
- const std::wstring& input,
- bool texvcCompatibility = false
- );
-
- // GenerateMathml generates a XML tree containing MathML markup.
- // Returns the root node.
- std::auto_ptr<MathmlNode> GenerateMathml(
- const MathmlOptions& options
- ) const;
-
- // GeneratePurifiedTex returns a string containing a complete TeX file
- // (including any required \usepackage commands) that could be fed to
- // LaTeX to produce a graphical version of the input.
- std::wstring GeneratePurifiedTex(
- const PurifiedTexOptions& options
- ) const;
-
- // A few accessor functions.
- const ParseTree::MathNode* GetParseTree() const
- {
- return mParseTree.get();
- }
-
- const LayoutTree::Node* GetLayoutTree() const
- {
- return mLayoutTree.get();
- }
-
-private:
- // These store the parse tree and layout tree generated by ProcessInput.
- std::auto_ptr<ParseTree::MathNode> mParseTree;
- std::auto_ptr<LayoutTree::Node> mLayoutTree;
-
- // This flag is set if the user has requested "strict spacing" rules
- // (see SpacingControl) via the magic "\strictspacing" command.
- bool mStrictSpacingRequested;
-
- // There are a handful of errors that get picked up during the layout
- // tree building phase, but which we want to return as MathML-related
- // errors; i.e. we can still run PNG generation. If one of these
- // happens, we cache it in mDelayedMathmlError, and return it when
- // someone tries to GenerateMathml().
- // FIX: this is a bit hacky and badly designed.
- // Come back and fix it up one day.
- bool mHasDelayedMathmlError;
- Exception mDelayedMathmlError;
-
- // gStandardMacros is a string which, in effect, gets inserted at the
- // beginning of any input string handled by ProcessInput. It contains
- // a sequence of macro definitions ("\newcommand"s) which set up some
- // standard TeX synonyms.
- static std::wstring gStandardMacros;
-
- // gTexvcCompatibilityMacros is similar; it contains definitions for
- // commands recognised by texvc but that are not standard TeX/LaTeX/
- // AMS-LaTeX. (See also the texvcCompatibility flag.)
- static std::wstring gTexvcCompatibilityMacros;
-
- // Tokenised version of gStandardMacros and gTexvcCompatibilityMacros
- // (computed only once, when first used):
- static std::vector<std::wstring> gStandardMacrosTokenised;
- static std::vector<std::wstring> gTexvcCompatibilityMacrosTokenised;
-};
-
-}
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/MathmlNode.cpp b/blahtexml/source/BlahtexCore/MathmlNode.cpp
deleted file mode 100644
index 6c49dd8..0000000
--- a/blahtexml/source/BlahtexCore/MathmlNode.cpp
+++ /dev/null
@@ -1,330 +0,0 @@
-// File "MathmlNode.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <iomanip>
-#include <sstream>
-#include <stdexcept>
-#include "MathmlNode.h"
-#include "XmlEncode.h"
-
-#ifdef BLAHTEXML_USING_XERCES
-#include <xercesc/util/XMLString.hpp>
-#include "../BlahtexXMLin/AttributesImpl.h"
-#include "../BlahtexXMLin/XercesString.h"
-#endif
-
-using namespace std;
-
-namespace blahtex
-{
-
-// Strings for each MathML "mathvariant" value.
-wstring gMathmlFontStrings[] =
-{
- L"normal",
- L"bold",
- L"italic",
- L"bold-italic",
- L"double-struck",
- L"bold-fraktur",
- L"script",
- L"bold-script",
- L"fraktur",
- L"sans-serif",
- L"bold-sans-serif",
- L"sans-serif-italic",
- L"sans-serif-bold-italic",
- L"monospace"
-};
-
-
-MathmlNode::~MathmlNode()
-{
- for (list<MathmlNode*>::iterator
- p = mChildren.begin(); p != mChildren.end(); p++
- )
- delete *p;
-}
-
-
-void MathmlNode::AddFontAttributes(
- MathmlFont desiredFont,
- const MathmlOptions& options
-)
-{
- if (options.mUseVersion1FontAttributes)
- {
- // MathML version 1.x fonts requested.
-
- if (
- desiredFont == cMathmlFontDoubleStruck ||
- desiredFont == cMathmlFontBoldFraktur ||
- desiredFont == cMathmlFontScript ||
- desiredFont == cMathmlFontBoldScript ||
- desiredFont == cMathmlFontFraktur
- )
- {
- // The only way we can end up here is with a fraktur <mn>.
- // TeX has decent fraktur digits, but unicode doesn't seem to
- // list them. (FIX: this might be changing in an upcoming
- // revision of unicode. I thought I saw the stix fonts website
- // mention something.) Therefore we can't access them with
- // version 1 font attributes, so let's just map it to bold
- // instead.
- if (mType == cTypeMn &&
- (
- desiredFont == cMathmlFontFraktur ||
- desiredFont == cMathmlFontBoldFraktur
- )
- )
- mAttributes[cAttributeFontweight] = L"bold";
- else
- throw logic_error(
- "Unexpected font/symbol combination "
- "in MathmlNode::AddFontAttributes"
- );
- }
- else
- {
-
- bool defaultItalic = (mType == cTypeMi && mText.size() == 1);
-
- bool desiredItalic = (
- desiredFont == cMathmlFontItalic ||
- desiredFont == cMathmlFontBoldItalic ||
- desiredFont == cMathmlFontSansSerifItalic ||
- desiredFont == cMathmlFontSansSerifBoldItalic
- );
-
- if (defaultItalic != desiredItalic)
- mAttributes[cAttributeFontstyle] =
- desiredItalic ? L"italic" : L"normal";
-
- if (
- desiredFont == cMathmlFontBold ||
- desiredFont == cMathmlFontBoldItalic ||
- desiredFont == cMathmlFontBoldSansSerif ||
- desiredFont == cMathmlFontSansSerifBoldItalic
- )
- mAttributes[cAttributeFontweight] = L"bold";
-
- if (
- desiredFont == cMathmlFontSansSerif ||
- desiredFont == cMathmlFontBoldSansSerif ||
- desiredFont == cMathmlFontSansSerifItalic ||
- desiredFont == cMathmlFontSansSerifBoldItalic
- )
- mAttributes[cAttributeFontfamily] = L"sans-serif";
-
- else if (desiredFont == cMathmlFontMonospace)
- mAttributes[cAttributeFontfamily] = L"monospace";
- }
- }
- else
- {
- // MathML version 2.0 fonts requested.
-
- MathmlFont defaultFont =
- (mType == cTypeMi && mText.size() == 1)
- ? cMathmlFontItalic : cMathmlFontNormal;
-
- if (desiredFont != defaultFont)
- mAttributes[cAttributeMathvariant] =
- gMathmlFontStrings[desiredFont];
- }
-}
-
-
-void WriteIndent(
- wostream& os,
- int depth
-)
-{
- for (int i = 0; i < depth; i++)
- os << L" ";
-}
-
- static wstring gTypeArray[] =
- {
- L"mi",
- L"mo",
- L"mn",
- L"mspace",
- L"mtext",
- L"mrow",
- L"mstyle",
- L"msub",
- L"msup",
- L"msubsup",
- L"munder",
- L"mover",
- L"munderover",
- L"mfrac",
- L"msqrt",
- L"mroot",
- L"mtable",
- L"mtr",
- L"mtd",
- L"mpadded"
- };
-
-void MathmlNode::PrintType(wostream& os) const
-{
- if (mType < 0 || mType >= sizeof(gTypeArray))
- throw logic_error("Illegal node type in MathmlNode::PrintType");
-
- os << gTypeArray[mType];
-}
-
- static wstring gAttributeArray[] =
- {
- L"displaystyle",
- L"scriptlevel",
- L"mathvariant",
- L"mathcolor",
- L"lspace",
- L"rspace",
- L"width",
- L"stretchy",
- L"minsize",
- L"maxsize",
- L"accent",
- L"movablelimits",
- L"linethickness",
- L"columnalign",
- L"columnspacing",
- L"rowspacing",
- L"fontfamily",
- L"fontstyle",
- L"fontweight"
- };
-
-void MathmlNode::PrintAttributes(wostream& os) const
-{
- for (map<Attribute, wstring>::const_iterator
- attribute = mAttributes.begin();
- attribute != mAttributes.end();
- attribute++
- )
- {
- if (
- attribute->first < 0 ||
- attribute->first >= sizeof(gAttributeArray)
- )
- throw logic_error(
- "Illegal attribute in MathmlNode::PrintAttributes"
- );
-
- os << L" " << gAttributeArray[attribute->first] << L"=\""
- << attribute->second << L"\"";
- }
-}
-
-void MathmlNode::Print(
- wostream& os,
- const EncodingOptions& options,
- bool indent,
- int depth
-) const
-{
- if (indent)
- WriteIndent(os, depth);
-
- os << L"<";
- PrintType(os);
- PrintAttributes(os);
- if (mText.empty() && mChildren.empty())
- os << L"/>";
- else
- {
- if (!mText.empty())
- {
- // is a leaf node with text
- os << L">" << XmlEncode(mText, options);
- }
- else
- {
- // is a internal node with at least one child
- os << L">";
- if (indent)
- os << endl;
-
- for (list<MathmlNode*>::const_iterator
- child = mChildren.begin(); child != mChildren.end(); child++
- )
- (*child)->Print(os, options, indent, depth + 1);
-
- if (indent)
- WriteIndent(os, depth);
- }
-
- os << L"</";
- PrintType(os);
- os << L">";
- }
-
- if (indent)
- os << endl;
-}
-
-#ifdef BLAHTEXML_USING_XERCES
-void MathmlNode::PrintAsSAX2(ContentHandler& sax, const wstring& prefix, bool ignoreFirstmrow) const
-{
- if (mType < 0 || mType >= sizeof(gTypeArray))
- throw logic_error("Illegal node type in MathmlNode::PrintType");
- bool skipElement = ignoreFirstmrow && (mType == cTypeMrow) && (mAttributes.size() == 0) && (mText.empty());
- if (skipElement) {
- for (list<MathmlNode*>::const_iterator child = mChildren.begin(); child != mChildren.end(); ++child)
- (*child)->PrintAsSAX2(sax, prefix, false);
- }
- else {
- XercesString elementLocalName(gTypeArray[mType]);
- XercesString elementQName((prefix == L"") ? gTypeArray[mType] : (prefix + L":" + gTypeArray[mType]));
- AttributesImpl attributes;
- for (map<Attribute, wstring>::const_iterator attribute = mAttributes.begin();
- attribute != mAttributes.end(); ++attribute) {
- if (attribute->first < 0 || attribute->first >= sizeof(gAttributeArray))
- throw logic_error("Illegal attribute in MathmlNode::PrintAttributes");
- XercesString localPart(gAttributeArray[attribute->first]);
- XercesString qName = localPart;
- XercesString uri;
- XercesString value(attribute->second);
- XercesString type;
- attributes.addAttribute(qName, uri, localPart, value, type);
- }
- XercesString MathMLnamespace("http://www.w3.org/1998/Math/MathML");
- sax.startElement(MathMLnamespace.c_str(), elementLocalName.c_str(), elementQName.c_str(), attributes);
- if (!mText.empty()) {
- XercesString text(mText);
- sax.characters(text.data(), text.size());
- }
- for (list<MathmlNode*>::const_iterator child = mChildren.begin(); child != mChildren.end(); ++child)
- (*child)->PrintAsSAX2(sax, prefix, false);
- sax.endElement(MathMLnamespace.c_str(), elementLocalName.c_str(), elementQName.c_str());
- }
-}
-#endif
-
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/MathmlNode.h b/blahtexml/source/BlahtexCore/MathmlNode.h
deleted file mode 100644
index dc4307a..0000000
--- a/blahtexml/source/BlahtexCore/MathmlNode.h
+++ /dev/null
@@ -1,173 +0,0 @@
-// File "MathmlNode.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_MATHMLNODE_H
-#define BLAHTEX_MATHMLNODE_H
-
-#include <iostream>
-#include <map>
-#include <list>
-#include <string>
-#include "Misc.h"
-
-#ifdef BLAHTEXML_USING_XERCES
-#include <xercesc/sax2/ContentHandler.hpp>
-XERCES_CPP_NAMESPACE_USE
-#endif
-
-namespace blahtex
-{
-
-// MathmlFont lists all possible MathML "mathvariant" values. Blahtex
-// uses these to record fonts in the layout tree; they get converted to
-// MathML 1.x font attributes if needed.
-enum MathmlFont
-{
- cMathmlFontNormal,
- cMathmlFontBold,
- cMathmlFontItalic,
- cMathmlFontBoldItalic,
- cMathmlFontDoubleStruck,
- cMathmlFontBoldFraktur,
- cMathmlFontScript,
- cMathmlFontBoldScript,
- cMathmlFontFraktur,
- cMathmlFontSansSerif,
- cMathmlFontBoldSansSerif,
- cMathmlFontSansSerifItalic,
- cMathmlFontSansSerifBoldItalic,
- cMathmlFontMonospace
-};
-
-// String versions of the MathML mathvariant fonts.
-// (See enum MathmlFont in LayoutTree.h.)
-extern std::wstring gMathmlFontStrings[];
-
-
-// Represents a node in an MathML tree.
-struct MathmlNode
-{
- enum Type
- {
- // Leaf nodes types ("token elements" in MathML documentation):
- cTypeMi,
- cTypeMo,
- cTypeMn,
- cTypeMspace,
- cTypeMtext,
-
- // Internal nodes types:
- cTypeMrow,
- cTypeMstyle,
- cTypeMsub,
- cTypeMsup,
- cTypeMsubsup,
- cTypeMunder,
- cTypeMover,
- cTypeMunderover,
- cTypeMfrac,
- cTypeMsqrt,
- cTypeMroot,
- cTypeMtable,
- cTypeMtr,
- cTypeMtd,
- cTypeMpadded
- }
- mType;
-
- enum Attribute
- {
- cAttributeDisplaystyle,
- cAttributeScriptlevel,
- cAttributeMathvariant,
- cAttributeMathcolor,
- cAttributeLspace,
- cAttributeRspace,
- cAttributeWidth,
- cAttributeStretchy,
- cAttributeMinsize,
- cAttributeMaxsize,
- cAttributeAccent,
- cAttributeMovablelimits,
- cAttributeLinethickness,
- cAttributeColumnalign,
- cAttributeColumnspacing,
- cAttributeRowspacing,
- cAttributeFontfamily,
- cAttributeFontstyle,
- cAttributeFontweight
- };
-
- std::map<Attribute, std::wstring> mAttributes;
-
- // mText is only used for leaf nodes: it holds the text that is
- // displayed between the opening and closing tags
- std::wstring mText;
-
- // mChildren is only used for internal nodes
- std::list<MathmlNode*> mChildren;
-
- MathmlNode(Type type, const std::wstring& text = L"") :
- mType(type),
- mText(text)
- { }
-
- ~MathmlNode();
-
- // This function adds mathvariant (for MathML 2.0) or fontstyle/
- // fontweight/fontfamily (for MathML 1.x) as appropriate to this node
- // to obtain the desired font. It knows about MathML defaults (like the
- // annoying automatic italic for single character <mi> nodes).
- void AddFontAttributes(
- MathmlFont desiredFont,
- const MathmlOptions& options
- );
-
-
- // Print() recursively prints the tree rooted at this node to the
- // given output stream.
- //
- // XML entities translated according to EncodingOptions.
- //
- // If "indent" is true, it will print each tag pair on a new line, and
- // add appropriate indenting.
- void Print(
- std::wostream& os,
- const EncodingOptions& options,
- bool indent,
- int depth = 0
- ) const;
-
- // Used internally by Print:
- void PrintType(std::wostream& os) const;
- void PrintAttributes(std::wostream& os) const;
-#ifdef BLAHTEXML_USING_XERCES
- void PrintAsSAX2(ContentHandler& sax, const std::wstring& prefix, bool ignoreFirstmrow) const;
-#endif
-};
-
-}
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/Misc.h b/blahtexml/source/BlahtexCore/Misc.h
deleted file mode 100644
index 97353dc..0000000
--- a/blahtexml/source/BlahtexCore/Misc.h
+++ /dev/null
@@ -1,222 +0,0 @@
-// File "Misc.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_MISC_H
-#define BLAHTEX_MISC_H
-
-
-#include <set>
-#include <vector>
-#include <string>
-
-
-// I use wishful_hash_set/map wherever I really want to use hash_set/map.
-// Unfortunately hash_set/map is not quite standard enough yet, so for now
-// it just gets mapped to set/map.
-#define wishful_hash_map std::map
-#define wishful_hash_set std::set
-
-
-// The macro END_ARRAY is used in several places to simplify code that
-// constructs an STL container from an array of data.
-// (Yes, I hate macros too. Sorry.)
-#define END_ARRAY(zzz_array) \
- ((zzz_array) + sizeof(zzz_array)/sizeof((zzz_array)[0]))
-
-
-namespace blahtex
-{
-
-
-// Stores colours in 0x00rrggbb format.
-// Better be 32 bits wide!
-typedef unsigned RGBColour;
-
-
-// The blahtex core throws an Exception object when it detects the input is
-// invalid in some way. This doesn't include more serious things like debug
-// assertions (these are thrown as std::logic_error).
-//
-// Each exception consists of an identifying string (mCode) plus zero or
-// more arguments (mArgs). This scheme is designed to facilitate
-// localisation of error messages. A complete list of corresponding
-// messages in English is provided in Messages.cpp (not part of the
-// blahtex core).
-class Exception
-{
-private:
- std::wstring mCode;
- std::vector<std::wstring> mArgs;
-
-public:
- Exception()
- {
- }
-
- Exception(
- const std::wstring& code,
- const std::wstring& arg1 = L"",
- const std::wstring& arg2 = L"",
- const std::wstring& arg3 = L""
- ) :
- mCode(code)
- {
- if (!arg1.empty())
- mArgs.push_back(arg1);
- if (!arg2.empty())
- mArgs.push_back(arg2);
- if (!arg3.empty())
- mArgs.push_back(arg3);
- }
-
- const std::wstring& GetCode() const
- {
- return mCode;
- }
-
- const std::vector<std::wstring>& GetArgs() const
- {
- return mArgs;
- }
-};
-
-
-// EncodingOptions describes output character encoding options.
-struct EncodingOptions
-{
- // mMathmlEncoding tells what to do with non-ASCII MathML characters.
- // It corresponds to the "--mathml-encoding" option on the command line.
- enum MathmlEncoding
- {
- cMathmlEncodingRaw, // directly in unicode
- cMathmlEncodingNumeric, // use e.g. "&#x2329;"
- cMathmlEncodingShort, // use e.g. "&lang;"
- cMathmlEncodingLong // use e.g. "&LeftAngleBracket;"
- }
- mMathmlEncoding;
-
- // mOtherEncodingRaw tells what to do with non-ASCII, non-MathML
- // characters:
- // * true means use unicode directly
- // * false means use e.g. "&#x1234;"
- bool mOtherEncodingRaw;
-
- // mAllowPlane1 tells whether to allow unicode plane-1 characters.
- // (This facility is included because some browsers don't have decent
- // support for plane 1 characters.)
- //
- // If this flag is NOT set, then blahtex will never output things like
- // "&#x1d504;", even when mMathmlEncoding is set to cMathmlEncodingRaw
- // or cMathmlEncodingNumeric. Instead it will fall back on something
- // like "&Afr;".
- //
- // (This flag is also present in struct MathmlOptions.)
- bool mAllowPlane1;
-
- EncodingOptions() :
- mMathmlEncoding(cMathmlEncodingNumeric),
- mOtherEncodingRaw(false),
- mAllowPlane1(true)
- { }
-};
-
-
-// MathmlOptions stores options that affect the MathML output.
-struct MathmlOptions
-{
- // mSpacingControl controls blahtex's MathML spacing markup output. It
- // corresponds to the command line "--spacing" option.
- //
- // Blahtex always uses TeX's rules (or an approximation thereof) to
- // determine spacing, but the SpacingControl values describe how much of
- // the time it actually outputs markup (<mspace>, lspace, rspace) to
- // implement its spacing decisions.
- //
- // cSpacingControlStrict:
- // Blahtex outputs spacing commands everywhere possible, doesn't
- // leave any choice to the MathML renderer.
- //
- // cSpacingControlModerate:
- // Blahtex outputs spacing commands where it thinks a typical MathML
- // renderer is likely to do something visually unsatisfactory
- // without additional help. The aim is to get good agreement with
- // TeX without overly bloated MathML markup. (It's very difficult
- // to get this right, so I expect it to be under continual review.)
- //
- // cSpacingControlRelaxed:
- // Blahtex only outputs spacing commands when the user specifically
- // asks for them, using TeX commands like "\," or "\quad".
- enum SpacingControl
- {
- cSpacingControlStrict,
- cSpacingControlModerate,
- cSpacingControlRelaxed
- }
- mSpacingControl;
-
- // If mUseVersion1FontAttributes is set, blahtex will use MathML version
- // 1 font attributes (fontstyle, fontweight, fontfamily) instead of
- // mathvariant, and it will handle the fancier fonts (script,
- // bold-script, fraktur, bold-fraktur, double-struck) by explicitly
- // using appropriate MathML entities (e.g. "&Afr;").
- bool mUseVersion1FontAttributes;
-
- // Discussed at struct EncodingOptions.
- bool mAllowPlane1;
-
- MathmlOptions() :
- mSpacingControl(cSpacingControlStrict),
- mUseVersion1FontAttributes(false),
- mAllowPlane1(true)
- { }
-};
-
-
-// This class contains options to control how blahtex generates
-// "purified Tex", that is, the .tex file which is sent to LaTeX to
-// generate PNG output.
-struct PurifiedTexOptions
-{
- // Blahtex may use "\usepackage[utf8x]{inputenc}" (which also requires
- // the "ucs" package)
- bool mAllowUcs;
-
- // Blahtex may use "\usepackage{CJK}"
- bool mAllowCJK;
-
- // Blahtex may use the "preview" package.
- bool mAllowPreview;
-
- // The font name (e.g. "ipam") which gets passed to "\begin{CJK}..."
- // for handling japanese, or blank if no font is available.
- std::wstring mJapaneseFont;
-
- PurifiedTexOptions() :
- mAllowUcs(false),
- mAllowCJK(false),
- mAllowPreview(false)
- { }
-};
-
-}
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/ParseTree.h b/blahtexml/source/BlahtexCore/ParseTree.h
deleted file mode 100644
index 1651fc0..0000000
--- a/blahtexml/source/BlahtexCore/ParseTree.h
+++ /dev/null
@@ -1,896 +0,0 @@
-// File "ParseTree.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_PARSETREE_H
-#define BLAHTEX_PARSETREE_H
-
-// Everything here is implemented variously in ParseTree1.cpp,
-// ParseTree2.cpp and ParseTree3.cpp.
-
-#include <memory>
-#include "LayoutTree.h"
-
-// The ParseTree namespace contains all classes representing nodes in the
-// parse tree. This is essentially a tree representation of the input
-// TeX expression, with as little additional processing done as possible.
-// The idea is that the "purified TeX" should be easily reconstructible
-// from the parse tree.
-
-namespace blahtex
-{
-
-// This struct describes (approximately) a TeX font during math mode.
-struct TexMathFont
-{
- enum Family
- {
- cFamilyDefault, // indicates default font
- // (e.g. "x" gets italics, "1" gets roman)
- cFamilyRm, // roman
- cFamilyBf, // bold
- cFamilyIt, // italics
- cFamilySf, // sans serif
- cFamilyTt, // typewriter
- cFamilyBb, // blackboard bold
- cFamilyCal, // calligraphic
- cFamilyFrak // fraktur
- }
- mFamily;
-
- // Whether or not we are in "\boldsymbol" mode (from AMS packages).
- // This seems to be mostly orthogonal to the family. (I haven't
- // studied carefully how this is implemented in TeX.)
- bool mIsBoldsymbol;
-
- TexMathFont(
- Family family = cFamilyDefault,
- bool isBoldsymbol = false
- ) :
- mFamily(family),
- mIsBoldsymbol(isBoldsymbol)
- { }
-
- // This function finds the closest MathML font (i.e. value of
- // mathvariant) which matches this TeX font.
- MathmlFont GetMathmlApproximation() const;
-};
-
-// This struct describes (approximately) a TeX font during text mode.
-struct TexTextFont
-{
- enum Family
- {
- cFamilyRm, // roman
- cFamilySf, // sans serif
- cFamilyTt // typewriter
- }
- mFamily;
-
- bool mIsBold;
- bool mIsItalic;
-
- TexTextFont(
- Family family = cFamilyRm,
- bool isBold = false,
- bool isItalic = false
- ) :
- mFamily(family),
- mIsBold(isBold),
- mIsItalic(isItalic)
- { }
-
- // This function finds the closest MathML font (i.e. value of
- // mathvariant) which matches this TeX font.
- MathmlFont GetMathmlApproximation() const;
-};
-
-
-// This struct represents some state information during the parse tree =>
-// layout tree building phase (i.e. while within BuildLayoutTree).
-struct TexProcessingState
-{
- TexMathFont mMathFont;
- TexTextFont mTextFont;
- LayoutTree::Node::Style mStyle;
- RGBColour mColour;
-};
-
-
-// This struct keeps track of the packages, encodings etc, that LaTeX will
-// need to be able to handle the given input.
-struct LatexFeatures
-{
- // Requires amsmath, amsfonts, amssymb packages
- bool mNeedsAmsmath;
- bool mNeedsAmsfonts;
- bool mNeedsAmssymb;
-
- // Requires "\usepackage[utf8x]{inputenc}".
- bool mNeedsUcs;
-
- // Requires the "color" package.
- bool mNeedsColor;
-
- // Requires "X2" font encoding (for cyrillic).
- bool mNeedsX2;
-
- // Requires the "CJK" package.
- bool mNeedsCJK;
-
- // Needs a japanese font to be installed.
- bool mNeedsJapaneseFont;
-
- LatexFeatures() :
- mNeedsAmsmath(false),
- mNeedsAmsfonts(false),
- mNeedsAmssymb(false),
- mNeedsUcs(false),
- mNeedsColor(false),
- mNeedsX2(false),
- mNeedsCJK(false),
- mNeedsJapaneseFont(false)
- { }
-
- // Given the LaTeX command "command", checks to see if any of the above
- // flags need to be switched on for that command to work.
- void Update(const std::wstring& command);
-};
-
-
-// While preparing the purified TeX, blahtex keeps track of something
-// approximating the current font encoding. E.g. while in X2 encoding, only
-// cyrillic characters and whitespace are allowed.
-enum FontEncoding
-{
- cFontEncodingDefault,
- cFontEncodingCyrillic,
- cFontEncodingJapanese
-};
-
-
-namespace ParseTree
-{
- // Base class for nodes in the parse tree.
- struct Node
- {
- virtual ~Node()
- { };
-
- // This function converts the parse tree under this node into a
- // layout tree. This is where most of blahtex's hard work is done.
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const = 0;
-
- // This function converts the parse tree under this node to
- // "purified TeX"; that is, TeX markup that can get sent to LaTeX
- // for PNG generation. Output gets written to the supplied stream.
- //
- // This (obviously) does not include the file header and footer;
- // see Manager::GeneratePurifiedTex for that.
- //
- // The "features" object is used to store a list of e.g. LaTeX
- // packages that will be required to handle the given output.
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const = 0;
-
- // Print() recursively prints the parse tree under this node.
- // Debugging use only.
- virtual void Print(
- std::wostream& os,
- int depth = 0
- ) const = 0;
- };
-
-
- // MathNode represents any node occurring during math mode.
- struct MathNode : Node
- {
- };
-
- // TextNode represents any node occurring during text mode.
- struct TextNode : Node
- {
- };
-
-
- // Represents any command like "a", "1", "\alpha", "\int" which blahtex
- // treats as a single symbol. Also includes spacing commands like "\,".
- struct MathSymbol : MathNode
- {
- // The command, e.g. "a", "\alpha".
- std::wstring mCommand;
-
- MathSymbol(const std::wstring& command) :
- mCommand(command)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
- // Represents a command taking a single argument.
- struct MathCommand1Arg : MathNode
- {
- // The command, e.g. "\hat", "\mathop".
- std::wstring mCommand;
-
- // Node corresponding to the argument of the command.
- std::auto_ptr<MathNode> mChild;
-
- MathCommand1Arg(
- const std::wstring& command,
- std::auto_ptr<MathNode> child
- ) :
- mCommand(command),
- mChild(child)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a TeX state change command like "\rm", "\scriptstyle",
- // "\color".
- struct MathStateChange : MathNode
- {
- // The style change command, e.g. "\scriptstyle".
- std::wstring mCommand;
-
- MathStateChange(
- const std::wstring& command
- ) :
- mCommand(command)
- { }
-
- // Modifies "state" according to the state change command.
- virtual void Apply(
- TexProcessingState& state
- ) const;
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a "\color{xyz}" command in math mode.
- struct MathColour : MathStateChange
- {
- // The colour name, e.g. "red".
- std::wstring mColourName;
-
- MathColour(
- const std::wstring& colourName
- ) :
- MathStateChange(L"\\color"),
- mColourName(colourName)
- { }
-
- virtual void Apply(
- TexProcessingState& state
- ) const;
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a command taking two arguments, including infix commands.
- struct MathCommand2Args : MathNode
- {
- // The command, e.g. "\frac", "\choose".
- std::wstring mCommand;
-
- // The two arguments.
- std::auto_ptr<MathNode> mChild1, mChild2;
-
- // This flag is set for infix commands like "\over".
- bool mIsInfix;
-
- MathCommand2Args(
- const std::wstring& command,
- std::auto_ptr<MathNode> child1,
- std::auto_ptr<MathNode> child2,
- bool isInfix
- ) :
- mCommand(command),
- mChild1(child1),
- mChild2(child2),
- mIsInfix(isInfix)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a "big" command like "\big", "\bigg" etc.
- struct MathBig : MathNode
- {
- // The command, e.g. "\big".
- std::wstring mCommand;
-
- // The delimiter that the big command is applied to, e.g. "\langle".
- std::wstring mDelimiter;
-
- MathBig(
- const std::wstring& command,
- const std::wstring& delimiter
- ) :
- mCommand(command),
- mDelimiter(delimiter)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents material surrounded by grouping braces, e.g. "{abc}" gets
- // stored as a MathGroup node whose child contains "abc".
- struct MathGroup : MathNode
- {
- // The enclosed material.
- std::auto_ptr<MathNode> mChild;
-
- MathGroup(std::auto_ptr<MathNode> child) :
- mChild(child)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a sequence of nodes in math mode, concatenated together.
- // e.g. "a\alpha 2" is stored as a MathList containing three MathSymbol
- // nodes.
- struct MathList : MathNode
- {
- std::vector<MathNode*> mChildren;
-
- ~MathList();
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a base with a superscript and/or subscript.
- // (i.e. an expression like "x^y_z".)
- struct MathScripts : MathNode
- {
- // All three fields are optional (NULL indicates an empty field).
- std::auto_ptr<MathNode> mBase, mUpper, mLower;
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a "limits" command, i.e. one of "\limits", "\nolimits",
- // or "\displaylimits".
- struct MathLimits : MathNode
- {
- // The command, e.g. "\limits".
- std::wstring mCommand;
-
- // mChild is the operator that the limits command is applied to.
- // e.g. for the input "x^2\limits_5", the base of the MathScripts
- // node should be a MathLimits node, whose child is the MathSymbol
- // node representing "x".
- std::auto_ptr<MathNode> mChild;
-
- MathLimits(
- const std::wstring& command,
- std::auto_ptr<MathNode> child
- ) :
- mCommand(command),
- mChild(child)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents an expression surrounded by "\left( ... \right)".
- struct MathDelimited : MathNode
- {
- // The delimiters, e.g. "\langle", "(".
- std::wstring mLeftDelimiter, mRightDelimiter;
-
- // The stuff enclosed by the delimiters:
- std::auto_ptr<MathNode> mChild;
-
- MathDelimited(
- std::auto_ptr<MathNode> child,
- const std::wstring& leftDelimiter,
- const std::wstring& rightDelimiter
- ) :
- mChild(child),
- mLeftDelimiter(leftDelimiter),
- mRightDelimiter(rightDelimiter)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a row of a table, e.g. might represent the
- // TeX subexpression "a & b & c".
- struct MathTableRow : MathNode
- {
- // The entries in the row.
- std::vector<MathNode*> mEntries;
-
- ~MathTableRow();
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a table, e.g. might represent the TeX subexpression
- // expression "a & b & c \\ \\ d & e & f \\ g & h".
- struct MathTable : MathNode
- {
- // The rows of the table.
- std::vector<MathTableRow*> mRows;
-
- ~MathTable();
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents an environment, i.e. "\begin{xxx} ... \end{xxx}".
- // Currently all supported environments are just various forms of table,
- // so for the moment we insist that it contains a table.
- struct MathEnvironment : MathNode
- {
- // Currently one of:
- // "matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix",
- // "cases", "smallmatrix", "aligned", "substack"
- std::wstring mName;
-
- // True for things like "\substack" which don't need "\begin"
- // and "\end";
- // False for anything involving "\begin" and "\end"
- bool mIsShort;
-
- // The contained table.
- std::auto_ptr<MathTable> mTable;
-
- MathEnvironment(
- const std::wstring& name,
- std::auto_ptr<MathTable> table,
- bool isShort
- ) :
- mName(name),
- mTable(table),
- mIsShort(isShort)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a command that switches from math mode into text mode,
- // e.g. "\text". Note that certain commands (e.g. "\text") will be
- // translated into a TextCommand1Arg node if encountered during text
- // mode, but into a EnterTextMode if encountered during math mode.
- struct EnterTextMode : MathNode
- {
- // The command, e.g. "\text".
- std::wstring mCommand;
-
- // The enclosed *text-mode* node.
- std::auto_ptr<TextNode> mChild;
-
- EnterTextMode(
- const std::wstring& command,
- std::auto_ptr<TextNode> child
- ) :
- mCommand(command),
- mChild(child)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a sequence of nodes in text mode, concatenated together.
- // e.g. "abc" is stored as a TextList containing three TextSymbol nodes.
- struct TextList : TextNode
- {
- std::vector<TextNode*> mChildren;
-
- ~TextList();
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents text mode material surrounded by grouping braces.
- struct TextGroup : TextNode
- {
- // The enclosed material.
- std::auto_ptr<TextNode> mChild;
-
- TextGroup(std::auto_ptr<TextNode> child) :
- mChild(child)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents any text mode command like "a", "1", "\textbackslash"
- // that is treated as a single symbol (includes spacing commands
- // like "\,").
- struct TextSymbol : TextNode
- {
- // The command, e.g. "a" or "\textbackslash"
- std::wstring mCommand;
-
- TextSymbol(const std::wstring& command) :
- mCommand(command)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a state change command like "\rm" occurring in text mode.
- struct TextStateChange : TextNode
- {
- // The command, e.g. "\rm".
- std::wstring mCommand;
-
- TextStateChange(
- const std::wstring& command
- ) :
- mCommand(command)
- { }
-
- // Modifies "state" according to the state change command.
- virtual void Apply(
- TexProcessingState& state
- ) const;
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a "\color{xyz}" command in text mode.
- struct TextColour : TextStateChange
- {
- // The colour name, e.g. "red".
- std::wstring mColourName;
-
- TextColour(
- const std::wstring& colourName
- ) :
- TextStateChange(L"\\color"),
- mColourName(colourName)
- { }
-
- virtual void Apply(
- TexProcessingState& state
- ) const;
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-
- // Represents a command in text mode taking a single argument.
- struct TextCommand1Arg : TextNode
- {
- // The command, e.g. "\textrm".
- std::wstring mCommand;
-
- // Node corresponding to the argument of the command.
- std::auto_ptr<TextNode> mChild;
-
- TextCommand1Arg(
- const std::wstring& command,
- std::auto_ptr<TextNode> child
- ) :
- mCommand(command),
- mChild(child)
- { }
-
- virtual std::auto_ptr<LayoutTree::Node> BuildLayoutTree(
- const TexProcessingState& state
- ) const;
-
- virtual void GetPurifiedTex(
- std::wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
- ) const;
-
- virtual void Print(
- std::wostream& os,
- int depth
- ) const;
- };
-
-} // end ParseTree namespace
-
-}
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/ParseTree1.cpp b/blahtexml/source/BlahtexCore/ParseTree1.cpp
deleted file mode 100644
index 4912b38..0000000
--- a/blahtexml/source/BlahtexCore/ParseTree1.cpp
+++ /dev/null
@@ -1,1290 +0,0 @@
-// File "ParseTree1.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <stdexcept>
-#include "ParseTree.h"
-
-using namespace std;
-
-namespace blahtex
-{
-
-// This is a list of delimiters which may appear after "\left", "\right"
-// and "\big", and of which MathML characters they get mapped to.
-
-static pair<wstring, wstring> gDelimiterArray[] =
-{
- make_pair(L".", L""),
- make_pair(L"[", L"["),
- make_pair(L"]", L"]"),
- make_pair(L"\\lbrack", L"["),
- make_pair(L"\\rbrack", L"]"),
- make_pair(L"(", L"("),
- make_pair(L")", L")"),
- make_pair(L"<", L"\U000027E8"),
- make_pair(L">", L"\U000027E9"),
- make_pair(L"\\langle", L"\U000027E8"),
- make_pair(L"\\rangle", L"\U000027E9"),
- make_pair(L"/", L"/"),
- make_pair(L"\\backslash", L"\U00002216"),
- make_pair(L"\\{", L"{"),
- make_pair(L"\\}", L"}"),
- make_pair(L"\\lbrace", L"{"),
- make_pair(L"\\rbrace", L"}"),
- make_pair(L"|", L"|"),
- make_pair(L"\\vert", L"|"),
- make_pair(L"\\lvert", L"|"),
- make_pair(L"\\rvert", L"|"),
- make_pair(L"\\Vert", L"\U00002225"),
- make_pair(L"\\lVert", L"\U00002225"),
- make_pair(L"\\rVert", L"\U00002225"),
- make_pair(L"\\uparrow", L"\U00002191"),
- make_pair(L"\\downarrow", L"\U00002193"),
- make_pair(L"\\updownarrow", L"\U00002195"),
- make_pair(L"\\Uparrow", L"\U000021D1"),
- make_pair(L"\\Downarrow", L"\U000021D3"),
- make_pair(L"\\Updownarrow", L"\U000021D5"),
- make_pair(L"\\lfloor", L"\U0000230A"),
- make_pair(L"\\rfloor", L"\U0000230B"),
- make_pair(L"\\lceil", L"\U00002308"),
- make_pair(L"\\rceil", L"\U00002309")
-};
-
-wishful_hash_map<wstring, wstring> gDelimiterTable(
- gDelimiterArray,
- END_ARRAY(gDelimiterArray)
-);
-
-
-namespace ParseTree
-{
-
-
-auto_ptr<LayoutTree::Node> MathList::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- auto_ptr<LayoutTree::Row> output(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
- list<LayoutTree::Node*>& targetList = output->mChildren;
-
-
- // 1st pass: recursively build layout trees for all children in
- // this row, and process state changes
- TexProcessingState currentState = state;
- for (vector<MathNode*>::const_iterator
- node = mChildren.begin(); node != mChildren.end(); node++
- )
- {
- MathStateChange* nodeAsStateChange =
- dynamic_cast<MathStateChange*>(*node);
-
- if (nodeAsStateChange)
- nodeAsStateChange->Apply(currentState);
- else
- targetList.push_back(
- (*node)->BuildLayoutTree(currentState).release()
- );
- }
-
-
- // 2nd pass: modify atom flavours according to TeX's rules.
- for (list<LayoutTree::Node*>::iterator
- node = targetList.begin(); node != targetList.end(); node++
- )
- {
- switch ((*node)->mFlavour)
- {
- case LayoutTree::Node::cFlavourBin:
- {
- if (node == targetList.begin())
- (*node)->mFlavour = LayoutTree::Node::cFlavourOrd;
- else
- {
- list<LayoutTree::Node*>::iterator previous = node;
- previous--;
- switch ((*previous)->mFlavour)
- {
- case LayoutTree::Node::cFlavourBin:
- case LayoutTree::Node::cFlavourOp:
- case LayoutTree::Node::cFlavourRel:
- case LayoutTree::Node::cFlavourOpen:
- case LayoutTree::Node::cFlavourPunct:
- (*node)->mFlavour =
- LayoutTree::Node::cFlavourOrd;
- break;
- }
- }
- break;
- }
-
- case LayoutTree::Node::cFlavourRel:
- case LayoutTree::Node::cFlavourClose:
- case LayoutTree::Node::cFlavourPunct:
- {
- if (node != targetList.begin())
- {
- list<LayoutTree::Node*>::iterator previous = node;
- previous--;
- if ((*previous)->mFlavour ==
- LayoutTree::Node::cFlavourBin
- )
- (*previous)->mFlavour =
- LayoutTree::Node::cFlavourOrd;
- }
-
- break;
- }
- }
- }
- if (!targetList.empty() &&
- targetList.back()->mFlavour == LayoutTree::Node::cFlavourBin
- )
- targetList.back()->mFlavour = LayoutTree::Node::cFlavourOrd;
-
-
- // 3rd pass: insert inter-atomic spacing according to TeX's rules.
-
- // spaceTable[i][j] gives the amount of space that should be inserted
- // between nodes of flavour i and flavour j.
-
- // ignoreSpaceTable[i][j] is nonzero whenever the space between i and j
- // should be ignored while in script or scriptscript style.
-
- static int spaceTable[8][8] =
- {
- // RIGHT
- // ord op bin rel open close punct inner
- {0, 3, 4, 5, 0, 0, 0, 3}, // ord
- {3, 3, 0, 5, 0, 0, 0, 3}, // op
- {4, 4, 0, 0, 4, 0, 0, 4}, // bin
- {5, 5, 0, 0, 5, 0, 0, 5}, // rel
- {0, 0, 0, 0, 0, 0, 0, 0}, // open // LEFT
- {0, 3, 4, 5, 0, 0, 0, 3}, // close
- {3, 3, 0, 3, 3, 3, 3, 3}, // punct
- {3, 3, 4, 5, 3, 0, 3, 3} // inner
- };
-
- static int ignoreSpaceTable[8][8] =
- {
- // RIGHT
- // ord op bin rel open close punct inner
- {0, 0, 1, 1, 0, 0, 0, 1}, // ord
- {0, 0, 0, 1, 0, 0, 0, 1}, // op
- {1, 1, 0, 0, 1, 0, 0, 1}, // bin
- {1, 1, 0, 0, 1, 0, 0, 1}, // rel
- {0, 0, 0, 0, 0, 0, 0, 0}, // open // LEFT
- {0, 0, 1, 1, 0, 0, 0, 1}, // close
- {1, 1, 0, 1, 1, 1, 1, 1}, // punct
- {1, 0, 1, 1, 1, 0, 1, 1} // inner
- };
-
- list<LayoutTree::Node*>::iterator currentAtom = targetList.begin();
- list<LayoutTree::Node*>::iterator previousAtom;
- bool foundFirst = false;
- while (true)
- {
- while (
- currentAtom != targetList.end() &&
- dynamic_cast<LayoutTree::Space*>(*currentAtom)
- )
- currentAtom++;
-
- if (currentAtom == targetList.end())
- break;
-
- if (!foundFirst)
- foundFirst = true;
- else
- {
- LayoutTree::Node::Flavour leftFlavour =
- (*previousAtom)->mFlavour;
- LayoutTree::Node::Flavour rightFlavour =
- (*currentAtom)->mFlavour;
-
- int width =
- (
- ignoreSpaceTable[leftFlavour][rightFlavour] &&
- (
- state.mStyle ==
- LayoutTree::Node::cStyleScript
- ||
- state.mStyle ==
- LayoutTree::Node::cStyleScriptScript
- )
- )
- ? 0 : spaceTable[leftFlavour][rightFlavour];
-
- targetList.insert(
- currentAtom,
- new LayoutTree::Space(
- width,
- false // indicates non-user-specified space
- )
- );
- }
-
- previousAtom = currentAtom;
- currentAtom++;
- }
-
-
- // 4th pass: splice any children Rows into this Row.
- // The idea is that no Row node should have any Rows as children.
- for (list<LayoutTree::Node*>::iterator
- child = targetList.begin(); child != targetList.end(); child++
- )
- {
- LayoutTree::Row* childAsRow
- = dynamic_cast<LayoutTree::Row*>(*child);
-
- if (childAsRow)
- {
- targetList.splice(child, childAsRow->mChildren);
- delete childAsRow;
- child = targetList.erase(child);
- }
- }
-
- return static_cast< auto_ptr<LayoutTree::Node> >(output);
-}
-
-
-// Stores info about accent commands (like "\hat", "\overrightarrow", etc)
-struct AccentInfo {
- wstring mText;
- bool mIsStretchy;
-
- AccentInfo(
- const wstring& text,
- bool isStretchy
- ) :
- mText(text),
- mIsStretchy(isStretchy)
- { }
-};
-
-
-auto_ptr<LayoutTree::Node> MathCommand1Arg::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- if (mCommand == L"\\sqrt")
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Sqrt(
- mChild->BuildLayoutTree(state),
- state.mColour
- )
- );
-
- if (mCommand == L"\\overbrace" || mCommand == L"\\underbrace")
- {
- auto_ptr<LayoutTree::Node> brace(
- new LayoutTree::SymbolOperator(
- true,
- L"",
- false,
- mCommand == L"\\overbrace" ? L"\U0000FE37" : L"\U0000FE38",
- cMathmlFontNormal,
- LayoutTree::Node::cStyleScript,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
-
- TexProcessingState newState = state;
- newState.mStyle =
- (state.mStyle == LayoutTree::Node::cStyleDisplay)
- ? LayoutTree::Node::cStyleDisplay
- : LayoutTree::Node::cStyleText;
-
- auto_ptr<LayoutTree::Node> empty;
-
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Scripts(
- newState.mStyle,
- LayoutTree::Node::cFlavourOp,
- LayoutTree::Node::cLimitsLimits,
- state.mColour,
- false,
- mChild->BuildLayoutTree(newState),
- (mCommand == L"\\overbrace") ? brace : empty,
- (mCommand == L"\\underbrace") ? brace : empty
- )
- );
- }
-
- if (mCommand == L"\\pmod")
- {
- auto_ptr<LayoutTree::Row> row(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
-
- MathmlFont font =
- state.mMathFont.mIsBoldsymbol
- ? cMathmlFontBold : cMathmlFontNormal;
-
- row->mChildren.push_back(new LayoutTree::Space(18, true));
- row->mChildren.push_back(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- false,
- L"(",
- font,
- state.mStyle,
- LayoutTree::Node::cFlavourOpen,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- row->mChildren.push_back(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- false,
- L"mod",
- font,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- row->mChildren.push_back(new LayoutTree::Space(6, true));
- row->mChildren.push_back(
- mChild->BuildLayoutTree(state).release()
- );
- row->mChildren.push_back(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- false,
- L")",
- font,
- state.mStyle,
- LayoutTree::Node::cFlavourClose,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
-
- return static_cast<auto_ptr<LayoutTree::Node> >(row);
- }
-
- if (mCommand == L"\\operatorname" ||
- mCommand == L"\\operatornamewithlimits"
- )
- {
- // Essentially this just writes the argument in upright font and
- // sets limits correctly. So initially it looks like
- // <mi mathvariant="normal">s</mi>
- // <mi mathvariant="normal">i</mi>
- // <mi mathvariant="normal">n</mi>
- // But then these get merged later on, to produce the more
- // reasonable <mi>sin</mi>.
-
- TexProcessingState newState = state;
- newState.mMathFont.mFamily = TexMathFont::cFamilyRm;
- auto_ptr<LayoutTree::Node> node
- = mChild->BuildLayoutTree(newState);
- node->mFlavour = LayoutTree::Node::cFlavourOp;
- node->mLimits =
- (mCommand == L"\\operatorname")
- ? LayoutTree::Node::cLimitsNoLimits
- : LayoutTree::Node::cLimitsDisplayLimits;
- return node;
- }
-
-
- static pair<wstring, LayoutTree::Node::Flavour> flavourCommandArray[] =
- {
- make_pair(L"\\mathop", LayoutTree::Node::cFlavourOp),
- make_pair(L"\\mathrel", LayoutTree::Node::cFlavourRel),
- make_pair(L"\\mathbin", LayoutTree::Node::cFlavourBin),
- make_pair(L"\\mathord", LayoutTree::Node::cFlavourOrd),
- make_pair(L"\\mathopen", LayoutTree::Node::cFlavourOpen),
- make_pair(L"\\mathclose", LayoutTree::Node::cFlavourClose),
- make_pair(L"\\mathpunct", LayoutTree::Node::cFlavourPunct),
- make_pair(L"\\mathinner", LayoutTree::Node::cFlavourInner)
- };
- static wishful_hash_map<wstring, LayoutTree::Node::Flavour>
- flavourCommandTable(
- flavourCommandArray,
- END_ARRAY(flavourCommandArray)
- );
-
- wishful_hash_map<wstring, LayoutTree::Node::Flavour>::const_iterator
- flavourCommand = flavourCommandTable.find(mCommand);
- if (flavourCommand != flavourCommandTable.end())
- {
- auto_ptr<LayoutTree::Node> node
- = mChild->BuildLayoutTree(state);
- node->mFlavour = flavourCommand->second;
- if (node->mFlavour == LayoutTree::Node::cFlavourOp)
- node->mLimits = LayoutTree::Node::cLimitsDisplayLimits;
- return node;
- }
-
- static pair<wstring, TexMathFont::Family> fontCommandArray[] =
- {
- make_pair(L"\\mathbf", TexMathFont::cFamilyBf),
- make_pair(L"\\mathbb", TexMathFont::cFamilyBb),
- make_pair(L"\\mathit", TexMathFont::cFamilyIt),
- make_pair(L"\\mathrm", TexMathFont::cFamilyRm),
- make_pair(L"\\mathsf", TexMathFont::cFamilySf),
- make_pair(L"\\mathtt", TexMathFont::cFamilyTt),
- make_pair(L"\\mathcal", TexMathFont::cFamilyCal),
- make_pair(L"\\mathfrak", TexMathFont::cFamilyFrak)
- };
- static wishful_hash_map<wstring, TexMathFont::Family> fontCommandTable(
- fontCommandArray,
- END_ARRAY(fontCommandArray)
- );
-
- wishful_hash_map<wstring, TexMathFont::Family>::const_iterator
- fontCommand = fontCommandTable.find(mCommand);
- if (fontCommand != fontCommandTable.end())
- {
- TexProcessingState newState = state;
- newState.mMathFont.mFamily = fontCommand->second;
- return mChild->BuildLayoutTree(newState);
- }
-
- if (mCommand == L"\\boldsymbol")
- {
- TexProcessingState newState = state;
- newState.mMathFont.mIsBoldsymbol = true;
- newState.mMathFont.mFamily = TexMathFont::cFamilyDefault;
- return mChild->BuildLayoutTree(newState);
- }
-
- // Here is a list of all the accent commands we know about.
- static pair<wstring, AccentInfo> accentCommandArray[] =
- {
- // FIX: there's some funny inconsistency between the definition of
- // &Hat; among MathML versions. I was originally using plain "^" for
- // these accents, but Roger recommended using 0x302 instead.
- make_pair(L"\\hat", AccentInfo(L"\U00000302", false)),
- make_pair(L"\\widehat", AccentInfo(L"\U00000302", true)),
- make_pair(L"\\bar", AccentInfo(L"\U000000AF", false)),
- make_pair(L"\\overline", AccentInfo(L"\U000000AF", true)),
- make_pair(L"\\underline", AccentInfo(L"\U000000AF", true)),
- make_pair(L"\\tilde", AccentInfo(L"\U000002DC", false)),
- make_pair(L"\\widetilde", AccentInfo(L"\U000002DC", true)),
- make_pair(L"\\overleftarrow", AccentInfo(L"\U00002190", true)),
- make_pair(L"\\vec", AccentInfo(L"\U000020D7", true)),
- make_pair(L"\\overrightarrow", AccentInfo(L"\U00002192", true)),
- make_pair(L"\\overleftrightarrow", AccentInfo(L"\U00002194", true)),
- make_pair(L"\\dot", AccentInfo(L"\U000000B7", false)),
- make_pair(L"\\ddot", AccentInfo(L"\U000000B7\U000000B7", false)),
- make_pair(L"\\check", AccentInfo(L"\U000002C7", false)),
- make_pair(L"\\acute", AccentInfo(L"\U000000B4", false)),
- make_pair(L"\\grave", AccentInfo(L"\U00000060", false)),
- make_pair(L"\\breve", AccentInfo(L"\U000002D8", false)
- )
- };
- static wishful_hash_map<wstring, AccentInfo> accentCommandTable(
- accentCommandArray,
- END_ARRAY(accentCommandArray)
- );
-
- wishful_hash_map<wstring, AccentInfo>::const_iterator
- accentCommand = accentCommandTable.find(mCommand);
- if (accentCommand != accentCommandTable.end())
- {
- auto_ptr<LayoutTree::Node> base
- = mChild->BuildLayoutTree(state);
- auto_ptr<LayoutTree::Node> lower, upper;
-
- auto_ptr<LayoutTree::Node> accent(
- new LayoutTree::SymbolOperator(
- accentCommand->second.mIsStretchy,
- L"",
- true, // is an accent
- accentCommand->second.mText,
- state.mMathFont.mIsBoldsymbol
- ? cMathmlFontBold : cMathmlFontNormal,
- // We don't need to decrement the style here, because
- // LayoutTree::SymbolOperator knows not to insert style
- // changes for accent operators
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
-
- if (mCommand == L"\\underline")
- lower = accent;
- else
- upper = accent;
-
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Scripts(
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour,
- false, // not sideset
- base,
- upper,
- lower
- )
- );
- }
-
- throw logic_error(
- "Unexpected command in MathCommand1Arg::BuildLayoutTree"
- );
-}
-
-
-auto_ptr<LayoutTree::Node> MathStateChange::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- // We should only arrive here if there was a state change command all
- // by its lonesome self in its own math list, so we can safely ignore
- // it.
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
-}
-
-auto_ptr<LayoutTree::Node> MathColour::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- // See above in MathStateChange::BuildLayoutTree
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
-}
-
-auto_ptr<LayoutTree::Node> TextStateChange::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- // See above in MathStateChange::BuildLayoutTree
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
-}
-
-auto_ptr<LayoutTree::Node> TextColour::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- // See above in MathStateChange::BuildLayoutTree
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
-}
-
-
-auto_ptr<LayoutTree::Node> MathCommand2Args::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- bool isFractionCommand = false;
- bool hasParentheses;
- bool isLineVisible;
-
- if (mCommand == L"\\frac" || mCommand == L"\\over")
- {
- isFractionCommand = true;
- isLineVisible = true;
- hasParentheses = false;
- }
- else if (mCommand == L"\\atop")
- {
- isFractionCommand = true;
- isLineVisible = false;
- hasParentheses = false;
- }
- else if (mCommand == L"\\binom" || mCommand == L"\\choose")
- {
- isFractionCommand = true;
- isLineVisible = false;
- hasParentheses = true;
- }
-
- if (isFractionCommand)
- {
- // Work out what style the numerator/denominator should be.
- TexProcessingState newState = state;
- switch (state.mStyle)
- {
- case LayoutTree::Node::cStyleDisplay:
- newState.mStyle = LayoutTree::Node::cStyleText;
- break;
-
- case LayoutTree::Node::cStyleText:
- newState.mStyle = LayoutTree::Node::cStyleScript;
- break;
-
- case LayoutTree::Node::cStyleScript:
- newState.mStyle = LayoutTree::Node::cStyleScriptScript;
- break;
- }
-
- auto_ptr<LayoutTree::Node> inside(
- new LayoutTree::Fraction(
- state.mStyle,
- state.mColour,
- mChild1->BuildLayoutTree(newState),
- mChild2->BuildLayoutTree(newState),
- isLineVisible
- )
- );
-
- if (hasParentheses)
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Fenced(
- state.mStyle,
- state.mColour,
- L"(", L")", inside
- )
- );
- else
- return inside;
- }
-
- if (mCommand == L"\\rootReserved")
- {
- TexProcessingState newState = state;
- newState.mStyle = LayoutTree::Node::cStyleScriptScript;
-
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Root(
- mChild2->BuildLayoutTree(state),
- mChild1->BuildLayoutTree(newState),
- state.mColour
- )
- );
- }
-
- if (mCommand == L"\\cfrac")
- {
- TexProcessingState newState = state;
- newState.mStyle = LayoutTree::Node::cStyleText;
-
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Fraction(
- LayoutTree::Node::cStyleDisplay,
- state.mColour,
- mChild1->BuildLayoutTree(newState),
- mChild2->BuildLayoutTree(newState),
- true // true = should be a visible fraction line
- )
- );
- }
-
- if (mCommand == L"\\overset" || mCommand == L"\\underset")
- {
- // Work out what style the under/overset node should be.
- TexProcessingState newState = state;
- switch (state.mStyle)
- {
- case LayoutTree::Node::cStyleDisplay:
- case LayoutTree::Node::cStyleText:
- newState.mStyle = LayoutTree::Node::cStyleScript;
- break;
-
- case LayoutTree::Node::cStyleScript:
- case LayoutTree::Node::cStyleScriptScript:
- newState.mStyle = LayoutTree::Node::cStyleScriptScript;
- break;
- }
-
- auto_ptr<LayoutTree::Node> upper, lower;
- if (mCommand == L"\\overset")
- upper = mChild1->BuildLayoutTree(newState);
- else // else underset
- lower = mChild1->BuildLayoutTree(newState);
-
- auto_ptr<LayoutTree::Node> base =
- mChild2->BuildLayoutTree(state);
-
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Scripts(
- state.mStyle,
- base->mFlavour,
- LayoutTree::Node::cLimitsNoLimits,
- state.mColour,
- false, // false = NOT sideset
- base,
- upper,
- lower
- )
- );
- }
-
- throw logic_error(
- "Unexpected command in MathCommand2Args::BuildLayoutTree"
- );
-}
-
-
-auto_ptr<LayoutTree::Node> MathScripts::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- auto_ptr<LayoutTree::Node> base, upper, lower;
-
- LayoutTree::Node::Flavour flavour = LayoutTree::Node::cFlavourOrd;
- LayoutTree::Node::Limits limits =
- LayoutTree::Node::cLimitsDisplayLimits;
-
- if (mBase.get())
- {
- // If the base is nonempty, we inherit its flavour and limits
- // settings
- base = mBase->BuildLayoutTree(state);
- flavour = base->mFlavour;
- limits = base->mLimits;
- }
-
- // Work out the style for the super/subscripts
- TexProcessingState newState = state;
- switch (state.mStyle)
- {
- case LayoutTree::Node::cStyleDisplay:
- case LayoutTree::Node::cStyleText:
- newState.mStyle = LayoutTree::Node::cStyleScript;
- break;
-
- case LayoutTree::Node::cStyleScript:
- case LayoutTree::Node::cStyleScriptScript:
- newState.mStyle = LayoutTree::Node::cStyleScriptScript;
- break;
- }
-
- if (mUpper.get())
- upper = mUpper->BuildLayoutTree(newState);
- if (mLower.get())
- lower = mLower->BuildLayoutTree(newState);
-
- // Determine from the flavour and limits settings whether we should
- // be putting limits above/below or to the side.
- bool isSideset =
- (flavour != LayoutTree::Node::cFlavourOp) ||
- (
- limits != LayoutTree::Node::cLimitsLimits &&
- (
- limits != LayoutTree::Node::cLimitsDisplayLimits ||
- state.mStyle != LayoutTree::Node::cStyleDisplay
- )
- );
-
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Scripts(
- state.mStyle,
- flavour,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour,
- isSideset,
- base,
- upper,
- lower
- )
- );
-}
-
-
-auto_ptr<LayoutTree::Node> MathLimits::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- auto_ptr<LayoutTree::Node> node =
- mChild->BuildLayoutTree(state);
-
- if (node->mFlavour != LayoutTree::Node::cFlavourOp)
- throw Exception(L"MisplacedLimits", mCommand);
-
- if (mCommand == L"\\limits")
- node->mLimits = LayoutTree::Node::cLimitsLimits;
- else if (mCommand == L"\\nolimits")
- node->mLimits = LayoutTree::Node::cLimitsNoLimits;
- else if (mCommand == L"\\displaylimits")
- node->mLimits = LayoutTree::Node::cLimitsDisplayLimits;
- else
- throw logic_error(
- "Unexpected command in MathLimits::BuildLayoutTree."
- );
-
- return node;
-}
-
-auto_ptr<LayoutTree::Node> MathGroup::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- // TeX treates any group enclosed by curly braces as an "ordinary" atom.
- // This is why e.g. "123{,}456" looks different to "123,456"
- auto_ptr<LayoutTree::Node> node
- = mChild->BuildLayoutTree(state);
- node->mFlavour = LayoutTree::Node::cFlavourOrd;
- return node;
-}
-
-
-auto_ptr<LayoutTree::Node> MathDelimited::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Fenced(
- state.mStyle,
- state.mColour,
- gDelimiterTable[mLeftDelimiter],
- gDelimiterTable[mRightDelimiter],
- mChild->BuildLayoutTree(state)
- )
- );
-}
-
-
-// Stores information about the various "\big..." commands.
-struct BigInfo
-{
- LayoutTree::Node::Flavour mFlavour;
- wstring mSize;
-
- BigInfo(
- LayoutTree::Node::Flavour flavour,
- const wstring& size
- ) :
- mFlavour(flavour),
- mSize(size)
- { }
-};
-
-
-auto_ptr<LayoutTree::Node> MathBig::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- // Here's a list of all the "\big..." commands, how big the delimiter
- // should become, and what flavour it should be, for each one.
- static pair<wstring, BigInfo> bigCommandArray[] =
- {
- make_pair(L"\\big", BigInfo(LayoutTree::Node::cFlavourOrd, L"1.2em")),
- make_pair(L"\\bigl", BigInfo(LayoutTree::Node::cFlavourOpen, L"1.2em")),
- make_pair(L"\\bigr", BigInfo(LayoutTree::Node::cFlavourClose, L"1.2em")),
-
- make_pair(L"\\Big", BigInfo(LayoutTree::Node::cFlavourOrd, L"1.8em")),
- make_pair(L"\\Bigl", BigInfo(LayoutTree::Node::cFlavourOpen, L"1.8em")),
- make_pair(L"\\Bigr", BigInfo(LayoutTree::Node::cFlavourClose, L"1.8em")),
-
- make_pair(L"\\bigg", BigInfo(LayoutTree::Node::cFlavourOrd, L"2.4em")),
- make_pair(L"\\biggl", BigInfo(LayoutTree::Node::cFlavourOpen, L"2.4em")),
- make_pair(L"\\biggr", BigInfo(LayoutTree::Node::cFlavourClose, L"2.4em")),
-
- make_pair(L"\\Bigg", BigInfo(LayoutTree::Node::cFlavourOrd, L"3em")),
- make_pair(L"\\Biggl", BigInfo(LayoutTree::Node::cFlavourOpen, L"3em")),
- make_pair(L"\\Biggr", BigInfo(LayoutTree::Node::cFlavourClose, L"3em"))
- };
- static wishful_hash_map<wstring, BigInfo> bigCommandTable(
- bigCommandArray,
- END_ARRAY(bigCommandArray)
- );
-
- wishful_hash_map<wstring, BigInfo>::const_iterator
- bigCommand = bigCommandTable.find(mCommand);
-
- if (bigCommand != bigCommandTable.end())
- {
- LayoutTree::Node::Style newStyle = state.mStyle;
- if (state.mStyle != LayoutTree::Node::cStyleDisplay &&
- state.mStyle != LayoutTree::Node::cStyleText
- )
- newStyle = LayoutTree::Node::cStyleText;
-
- // FIX: TeX allows "\big."; do we?
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolOperator(
- true, // indicates stretchy="true"
- bigCommand->second.mSize,
- false, // not an accent
- gDelimiterTable[mDelimiter],
- cMathmlFontNormal,
- newStyle,
- bigCommand->second.mFlavour,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- }
-
- throw logic_error("Unknown command in MathBig::BuildLayoutTree");
-}
-
-
-auto_ptr<LayoutTree::Node> MathTableRow::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- // We should never get here, because MathTable::BuildLayoutTree
- // handles the whole table.
- throw logic_error(
- "Arrived unexpectedly in MathTableRow::BuildLayoutTree"
- );
-}
-
-
-auto_ptr<LayoutTree::Node> MathTable::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- auto_ptr<LayoutTree::Table> table(
- new LayoutTree::Table(state.mStyle, state.mColour)
- );
- table->mRows.reserve(mRows.size());
-
- // Walk the table, building the layout tree as we go.
- for (vector<MathTableRow*>::const_iterator
- inRow = mRows.begin();
- inRow != mRows.end();
- inRow++
- )
- {
- table->mRows.push_back(vector<LayoutTree::Node*>());
- vector<LayoutTree::Node*>& outRow = table->mRows.back();
- for (vector<MathNode*>::const_iterator
- entry = (*inRow)->mEntries.begin();
- entry != (*inRow)->mEntries.end();
- entry++
- )
- outRow.push_back(
- (*entry)->
- BuildLayoutTree(state).release()
- );
- }
-
- return static_cast<auto_ptr<LayoutTree::Node> >(table);
-}
-
-
-// Stores information about an environment.
-struct EnvironmentInfo
-{
- wstring mLeftDelimiter, mRightDelimiter;
-
- EnvironmentInfo(
- const wstring& leftDelimiter,
- const wstring& rightDelimiter
- ) :
- mLeftDelimiter(leftDelimiter),
- mRightDelimiter(rightDelimiter)
- { }
-};
-
-
-auto_ptr<LayoutTree::Node> MathEnvironment::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- // A list of all environments, and which delimiters appear on each
- // side of the corresponding table.
- // FIX: this is kind of stupid... almost every environment ends up
- // with its own special-case code!
- static pair<wstring, EnvironmentInfo> environmentArray[] =
- {
- make_pair(L"matrix", EnvironmentInfo(L"", L"")),
- make_pair(L"pmatrix", EnvironmentInfo(L"(", L")")),
- make_pair(L"bmatrix", EnvironmentInfo(L"[", L"]")),
- make_pair(L"Bmatrix", EnvironmentInfo(L"{", L"}")),
- make_pair(L"vmatrix", EnvironmentInfo(L"|", L"|")),
- // DoubleVerticalBar:
- make_pair(L"Vmatrix", EnvironmentInfo(L"\U00002225", L"\U00002225")),
- make_pair(L"cases", EnvironmentInfo(L"{", L"")),
- make_pair(L"aligned", EnvironmentInfo(L"", L"")),
- make_pair(L"smallmatrix", EnvironmentInfo(L"", L"")),
- make_pair(L"substack", EnvironmentInfo(L"", L""))
- };
- static wishful_hash_map<wstring, EnvironmentInfo> environmentTable(
- environmentArray,
- END_ARRAY(environmentArray)
- );
-
- wishful_hash_map<wstring, EnvironmentInfo>::const_iterator
- environmentLookup = environmentTable.find(mName);
-
- if (environmentLookup == environmentTable.end())
- throw logic_error(
- "Unexpected environment name in "
- "MathEnvironment::BuildLayoutTree"
- );
-
- // For reasons I haven't investigated, the "boldsymbol" flag persists
- // into environments, but the math font doesn't.
- TexProcessingState newState = state;
- newState.mMathFont = TexMathFont();
- newState.mMathFont.mIsBoldsymbol = state.mMathFont.mIsBoldsymbol;
-
- LayoutTree::Node::Style fencedStyle;
- if (mName == L"smallmatrix" || mName == L"substack")
- newState.mStyle = LayoutTree::Node::cStyleScript;
- else if (mName == L"aligned")
- newState.mStyle = LayoutTree::Node::cStyleDisplay;
- else
- {
- newState.mStyle = LayoutTree::Node::cStyleText;
- fencedStyle =
- (state.mStyle == LayoutTree::Node::cStyleDisplay)
- ? LayoutTree::Node::cStyleDisplay
- : LayoutTree::Node::cStyleText;
- }
-
- auto_ptr<LayoutTree::Node> table = mTable->BuildLayoutTree(newState);
- LayoutTree::Table* tablePtr =
- dynamic_cast<LayoutTree::Table*>(table.get());
- if (!tablePtr)
- throw logic_error(
- "Unexpected node type in MathEnvironment::BuildLayoutTree"
- );
-
- if (mName == L"substack")
- tablePtr->mRowSpacing = LayoutTree::Table::cRowSpacingTight;
-
- if (mName == L"aligned")
- tablePtr->mAlign = LayoutTree::Table::cAlignRightLeft;
- else if (mName == L"cases")
- tablePtr->mAlign = LayoutTree::Table::cAlignLeft;
-
- if (environmentLookup->second.mLeftDelimiter.empty() &&
- environmentLookup->second.mRightDelimiter.empty()
- )
- return table;
-
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Fenced(
- fencedStyle,
- state.mColour,
- environmentLookup->second.mLeftDelimiter,
- environmentLookup->second.mRightDelimiter,
- table
- )
- );
-}
-
-
-auto_ptr<LayoutTree::Node> EnterTextMode::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- // List of all commands that launch into text mode, and some information
- // about which font they select.
- static pair<wstring, TexTextFont> textCommandArray[] =
- { // flags are: bold? italic?
- make_pair(L"\\mbox", TexTextFont(TexTextFont::cFamilyRm, false, false)),
- make_pair(L"\\hbox", TexTextFont(TexTextFont::cFamilyRm, false, false)),
- make_pair(L"\\text", TexTextFont(TexTextFont::cFamilyRm, false, false)),
- make_pair(L"\\textrm", TexTextFont(TexTextFont::cFamilyRm, false, false)),
- make_pair(L"\\textbf", TexTextFont(TexTextFont::cFamilyRm, true, false)),
- make_pair(L"\\emph", TexTextFont(TexTextFont::cFamilyRm, false, true)),
- make_pair(L"\\textit", TexTextFont(TexTextFont::cFamilyRm, false, true)),
- make_pair(L"\\textsf", TexTextFont(TexTextFont::cFamilySf, false, false)),
- make_pair(L"\\texttt", TexTextFont(TexTextFont::cFamilyTt, false, false)),
- make_pair(L"\\cyr", TexTextFont(TexTextFont::cFamilyRm, false, false)),
- make_pair(L"\\jap", TexTextFont(TexTextFont::cFamilyRm, false, false))
- };
- static wishful_hash_map<wstring, TexTextFont> textCommandTable(
- textCommandArray,
- END_ARRAY(textCommandArray)
- );
-
- wishful_hash_map<wstring, TexTextFont>::iterator
- textCommand = textCommandTable.find(mCommand);
-
- if (textCommand == textCommandTable.end())
- throw logic_error(
- "Unexpected command in EnterTextMode::BuildLayoutTree"
- );
-
- TexProcessingState newState = state;
- newState.mTextFont = textCommand->second;
-
- if (mCommand == L"\\hbox" || mCommand == L"\\mbox")
- newState.mStyle = LayoutTree::Node::cStyleText;
-
- return mChild->BuildLayoutTree(newState);
-}
-
-
-auto_ptr<LayoutTree::Node> TextList::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- auto_ptr<LayoutTree::Row> node(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
-
- // Recursively build layout trees for children, and merge Rows to obtain
- // a single Row, and apply state changes as appropriate.
- TexProcessingState currentState = state;
- for (vector<TextNode*>::const_iterator
- child = mChildren.begin();
- child != mChildren.end();
- child++
- )
- {
- TextStateChange* childAsStateChange =
- dynamic_cast<TextStateChange*>(*child);
-
- if (childAsStateChange)
- childAsStateChange->Apply(currentState);
- else
- {
- auto_ptr<LayoutTree::Node>
- newNode = (*child)->BuildLayoutTree(currentState);
-
- LayoutTree::Row* isRow =
- dynamic_cast<LayoutTree::Row*>(newNode.get());
-
- if (isRow)
- node->mChildren.splice(
- node->mChildren.end(),
- isRow->mChildren
- );
- else
- node->mChildren.push_back(newNode.release());
- }
- }
-
- return static_cast<auto_ptr<LayoutTree::Node> >(node);
-}
-
-
-auto_ptr<LayoutTree::Node> TextSymbol::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- static pair<wstring, wstring> textCommandArray[] =
- {
- make_pair(L"\\!", L""),
- make_pair(L" ", L"\U000000A0"), // NonBreakingSpace
- make_pair(L"~", L"\U000000A0"),
- make_pair(L"\\,", L"\U000000A0"),
- make_pair(L"\\ ", L"\U000000A0"),
- make_pair(L"\\;", L"\U000000A0"),
- make_pair(L"\\quad", L"\U000000A0\U000000A0"),
- make_pair(L"\\qquad", L"\U000000A0\U000000A0\U000000A0\U000000A0"),
-
- make_pair(L"\\&", L"&"),
- // FIX: why did I put in these next two lines again?
- // FIX: The character "<" and ">" actually do funny things in TeX...
- make_pair(L"<", L"<"),
- make_pair(L">", L">"),
- make_pair(L"\\_", L"_"),
- make_pair(L"\\$", L"$"),
- make_pair(L"\\#", L"#"),
- make_pair(L"\\%", L"%"),
- make_pair(L"\\{", L"{"),
- make_pair(L"\\}", L"}"),
- make_pair(L"\\textbackslash", L"\\"),
- // FIX: for some reason in Firefox the caret is much lower
- // than it should be
- make_pair(L"\\textasciicircum", L"^"),
- make_pair(L"\\textasciitilde", L"~"),
- make_pair(L"\\textvisiblespace", L"\U000023B5"),
- make_pair(L"\\O", L"\U000000D8"),
- make_pair(L"\\S", L"\U000000A7")
- };
- static wishful_hash_map<wstring, wstring> textCommandTable(
- textCommandArray,
- END_ARRAY(textCommandArray)
- );
-
- wishful_hash_map<wstring, wstring>::iterator
- textCommand = textCommandTable.find(mCommand);
-
- if (textCommand != textCommandTable.end())
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolText(
- textCommand->second,
- state.mTextFont.GetMathmlApproximation(),
- state.mStyle,
- state.mColour
- )
- );
-
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolText(
- mCommand,
- state.mTextFont.GetMathmlApproximation(),
- state.mStyle,
- state.mColour
- )
- );
-}
-
-
-auto_ptr<LayoutTree::Node> TextGroup::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- return mChild->BuildLayoutTree(state);
-}
-
-
-auto_ptr<LayoutTree::Node> TextCommand1Arg::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- TexProcessingState newState = state;
-
- if (mCommand == L"\\textrm")
- newState.mTextFont.mFamily = TexTextFont::cFamilyRm;
- else if (mCommand == L"\\texttt")
- newState.mTextFont.mFamily = TexTextFont::cFamilyTt;
- else if (mCommand == L"\\textsf")
- newState.mTextFont.mFamily = TexTextFont::cFamilySf;
- else if (mCommand == L"\\textit")
- newState.mTextFont.mIsItalic = true;
- else if (mCommand == L"\\emph")
- newState.mTextFont.mIsItalic = !newState.mTextFont.mIsItalic;
- else if (mCommand == L"\\textbf")
- newState.mTextFont.mIsBold = true;
- else if (
- mCommand == L"\\text" ||
- mCommand == L"\\hbox" ||
- mCommand == L"\\mbox" ||
- mCommand == L"\\cyr" ||
- mCommand == L"\\jap"
- )
- // do nothing!
- { }
- else
- throw logic_error(
- "Unexpected command in TextCommand1Arg::BuildLayoutTree"
- );
-
- return mChild->BuildLayoutTree(newState);
-}
-
-}
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/ParseTree2.cpp b/blahtexml/source/BlahtexCore/ParseTree2.cpp
deleted file mode 100644
index 45231a9..0000000
--- a/blahtexml/source/BlahtexCore/ParseTree2.cpp
+++ /dev/null
@@ -1,1089 +0,0 @@
-// File "ParseTree2.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <stdexcept>
-#include "ParseTree.h"
-
-using namespace std;
-
-namespace blahtex
-{
-
-pair<wstring, wchar_t> lowercaseGreekArray[] =
-{
- make_pair(L"\\alpha", L'\U000003B1'),
- make_pair(L"\\beta", L'\U000003B2'),
- make_pair(L"\\gamma", L'\U000003B3'),
- make_pair(L"\\delta", L'\U000003B4'),
- make_pair(L"\\epsilon", L'\U000003F5'), // straightepsilon
- make_pair(L"\\varepsilon", L'\U000003B5'), // varepsilon
- make_pair(L"\\zeta", L'\U000003B6'),
- make_pair(L"\\eta", L'\U000003B7'),
- make_pair(L"\\theta", L'\U000003B8'),
- make_pair(L"\\vartheta", L'\U000003D1'),
- make_pair(L"\\iota", L'\U000003B9'),
- make_pair(L"\\kappa", L'\U000003BA'),
- make_pair(L"\\varkappa", L'\U000003F0'),
- make_pair(L"\\lambda", L'\U000003BB'),
- make_pair(L"\\mu", L'\U000003BC'),
- make_pair(L"\\nu", L'\U000003BD'),
- make_pair(L"\\pi", L'\U000003C0'),
- make_pair(L"\\varpi", L'\U000003D6'),
- make_pair(L"\\rho", L'\U000003C1'),
- make_pair(L"\\varrho", L'\U000003F1'),
- make_pair(L"\\sigma", L'\U000003C3'),
- make_pair(L"\\varsigma", L'\U000003C2'),
- make_pair(L"\\tau", L'\U000003C4'),
- make_pair(L"\\upsilon", L'\U000003C5'),
- make_pair(L"\\phi", L'\U000003D5'), // straightphi
- make_pair(L"\\varphi", L'\U000003C6'),
- make_pair(L"\\chi", L'\U000003C7'),
- make_pair(L"\\psi", L'\U000003C8'),
- make_pair(L"\\omega", L'\U000003C9'),
- make_pair(L"\\xi", L'\U000003BE'),
- make_pair(L"\\digamma", L'\U000003DD')
-};
-wishful_hash_map<wstring, wchar_t> lowercaseGreekTable(
- lowercaseGreekArray,
- END_ARRAY(lowercaseGreekArray)
-);
-
-
-pair<wstring, wchar_t> uppercaseGreekArray[] =
-{
- make_pair(L"\\Gamma", L'\U00000393'),
- make_pair(L"\\Delta", L'\U00000394'),
- make_pair(L"\\Theta", L'\U00000398'),
- make_pair(L"\\Lambda", L'\U0000039B'),
- make_pair(L"\\Pi", L'\U000003A0'),
- make_pair(L"\\Sigma", L'\U000003A3'),
- make_pair(L"\\Upsilon", L'\U000003A5'),
- make_pair(L"\\Phi", L'\U000003A6'),
- make_pair(L"\\Psi", L'\U000003A8'),
- make_pair(L"\\Omega", L'\U000003A9'),
- make_pair(L"\\Xi", L'\U0000039E')
-};
-wishful_hash_map<wstring, wchar_t> uppercaseGreekTable(
- uppercaseGreekArray,
- END_ARRAY(uppercaseGreekArray)
-);
-
-
-pair<wstring, int> spaceArray[] =
-{
- make_pair(L"\\!", -3),
- make_pair(L"\\,", 3),
- make_pair(L"\\>", 4),
- make_pair(L"\\;", 5),
- make_pair(L"\\quad", 18),
- make_pair(L"\\qquad", 36),
- // These last two aren't quite right, but hopefully they're close
- // enough. TeX's rules are too complicated for me to care :-)
- make_pair(L"~", 6),
- make_pair(L"\\ ", 6)
-};
-wishful_hash_map<wstring, int> spaceTable(
- spaceArray,
- END_ARRAY(spaceArray)
-);
-
-
-struct OperatorInfo
-{
- wstring mText;
- LayoutTree::Node::Flavour mFlavour;
- LayoutTree::Node::Limits mLimits;
-
- OperatorInfo(
- const wstring& text,
- LayoutTree::Node::Flavour flavour,
- LayoutTree::Node::Limits limits =
- LayoutTree::Node::cLimitsDisplayLimits
- ) :
- mText(text),
- mFlavour(flavour),
- mLimits(limits)
- { }
-};
-
-// Here is a list of all commands that get translated as operators,
-// together with their MathML translation and flavour.
-pair<wstring, OperatorInfo> operatorArray[] =
-{
- make_pair(L"(", OperatorInfo(L"(", LayoutTree::Node::cFlavourOpen)),
- make_pair(L")", OperatorInfo(L")", LayoutTree::Node::cFlavourClose)),
- make_pair(L"[", OperatorInfo(L"[", LayoutTree::Node::cFlavourOpen)),
- make_pair(L"]", OperatorInfo(L"]", LayoutTree::Node::cFlavourClose)),
- make_pair(L"<", OperatorInfo(L"<", LayoutTree::Node::cFlavourRel)),
- make_pair(L">", OperatorInfo(L">", LayoutTree::Node::cFlavourRel)),
- make_pair(L"+", OperatorInfo(L"+", LayoutTree::Node::cFlavourBin)),
- make_pair(L"-", OperatorInfo(L"-", LayoutTree::Node::cFlavourBin)),
- make_pair(L"=", OperatorInfo(L"=", LayoutTree::Node::cFlavourRel)),
- make_pair(L"|", OperatorInfo(L"|", LayoutTree::Node::cFlavourOrd)),
- make_pair(L";", OperatorInfo(L";", LayoutTree::Node::cFlavourPunct)),
- make_pair(L":", OperatorInfo(L":", LayoutTree::Node::cFlavourRel)),
- make_pair(L",", OperatorInfo(L",", LayoutTree::Node::cFlavourPunct)),
- make_pair(L".", OperatorInfo(L".", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"/", OperatorInfo(L"/", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"?", OperatorInfo(L"?", LayoutTree::Node::cFlavourClose)),
- make_pair(L"!", OperatorInfo(L"!", LayoutTree::Node::cFlavourClose)),
- make_pair(L"@", OperatorInfo(L"@", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"*", OperatorInfo(L"*", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\_", OperatorInfo(L"_", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\&", OperatorInfo(L"&", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\$", OperatorInfo(L"$", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\#", OperatorInfo(L"#", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\%", OperatorInfo(L"%", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\{", OperatorInfo(L"{", LayoutTree::Node::cFlavourOpen)),
- make_pair(L"\\}", OperatorInfo(L"}", LayoutTree::Node::cFlavourClose)),
- make_pair(L"\\ast", OperatorInfo(L"*", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\lbrace", OperatorInfo(L"{", LayoutTree::Node::cFlavourOpen)),
- make_pair(L"\\rbrace", OperatorInfo(L"}", LayoutTree::Node::cFlavourClose)),
- make_pair(L"\\vert", OperatorInfo(L"|", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\lvert", OperatorInfo(L"|", LayoutTree::Node::cFlavourOpen)),
- make_pair(L"\\rvert", OperatorInfo(L"|", LayoutTree::Node::cFlavourClose)),
- make_pair(L"\\lbrack", OperatorInfo(L"[", LayoutTree::Node::cFlavourOpen)),
- make_pair(L"\\rbrack", OperatorInfo(L"]", LayoutTree::Node::cFlavourClose)),
- make_pair(L"\\Vert", OperatorInfo(L"\U00002225", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\lVert", OperatorInfo(L"\U00002225", LayoutTree::Node::cFlavourOpen)),
- make_pair(L"\\rVert", OperatorInfo(L"\U00002225", LayoutTree::Node::cFlavourClose)),
- make_pair(L"\\lfloor", OperatorInfo(L"\U0000230A", LayoutTree::Node::cFlavourOpen)),
- make_pair(L"\\rfloor", OperatorInfo(L"\U0000230B", LayoutTree::Node::cFlavourClose)),
- make_pair(L"\\lceil", OperatorInfo(L"\U00002308", LayoutTree::Node::cFlavourOpen)),
- make_pair(L"\\rceil", OperatorInfo(L"\U00002309", LayoutTree::Node::cFlavourClose)),
- make_pair(L"\\langle", OperatorInfo(L"\U000027E8", LayoutTree::Node::cFlavourOpen)),
- make_pair(L"\\rangle", OperatorInfo(L"\U000027E9", LayoutTree::Node::cFlavourClose)),
- make_pair(L"\\forall", OperatorInfo(L"\U00002200", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\exists", OperatorInfo(L"\U00002203", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\leftarrow", OperatorInfo(L"\U00002190", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\rightarrow", OperatorInfo(L"\U00002192", LayoutTree::Node::cFlavourRel)),
-
- // FIX: The first version below has the correct MathML characters.
- // They seem to be missing in the fonts currently shipped with
- // Firefox, so we just map them to their short counterparts (second
- // version) for the moment.
- // FIX: perhaps it's possible to do this with the "stretchy" attribute
- // instead?
-#if 0
- make_pair(L"\\longleftarrow", OperatorInfo(L"\U000027F5", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\longrightarrow", OperatorInfo(L"\U000027F6", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Longleftarrow", OperatorInfo(L"\U000027F8", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Longrightarrow", OperatorInfo(L"\U000027F9", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\longmapsto", OperatorInfo(L"\U000027FC", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\longleftrightarrow", OperatorInfo(L"\U000027F7", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Longleftrightarrow", OperatorInfo(L"\U000027FA", LayoutTree::Node::cFlavourRel)),
-#else
- make_pair(L"\\longleftarrow", OperatorInfo(L"\U00002190", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\longrightarrow", OperatorInfo(L"\U00002192", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Longleftarrow", OperatorInfo(L"\U000021D0", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Longrightarrow", OperatorInfo(L"\U000021D2", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\longmapsto", OperatorInfo(L"\U000021A6", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\longleftrightarrow", OperatorInfo(L"\U00002194", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Longleftrightarrow", OperatorInfo(L"\U000021D4", LayoutTree::Node::cFlavourRel)),
-#endif
-
- make_pair(L"\\Leftarrow", OperatorInfo(L"\U000021D0", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Rightarrow", OperatorInfo(L"\U000021D2", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\mapsto", OperatorInfo(L"\U000021A6", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\leftrightarrow", OperatorInfo(L"\U00002194", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Leftrightarrow", OperatorInfo(L"\U000021D4", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\uparrow", OperatorInfo(L"\U00002191", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Uparrow", OperatorInfo(L"\U000021D1", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\downarrow", OperatorInfo(L"\U00002193", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Downarrow", OperatorInfo(L"\U000021D3", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\updownarrow", OperatorInfo(L"\U00002195", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Updownarrow", OperatorInfo(L"\U000021D5", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\searrow", OperatorInfo(L"\U00002198", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nearrow", OperatorInfo(L"\U00002197", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\swarrow", OperatorInfo(L"\U00002199", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nwarrow", OperatorInfo(L"\U00002196", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\hookrightarrow", OperatorInfo(L"\U000021AA", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\hookleftarrow", OperatorInfo(L"\U000021A9", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\upharpoonright", OperatorInfo(L"\U000021BE", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\upharpoonleft", OperatorInfo(L"\U000021BF", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\downharpoonright", OperatorInfo(L"\U000021C2", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\downharpoonleft", OperatorInfo(L"\U000021C3", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\rightharpoonup", OperatorInfo(L"\U000021C0", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\rightharpoondown", OperatorInfo(L"\U000021C1", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\leftharpoonup", OperatorInfo(L"\U000021BC", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\leftharpoondown", OperatorInfo(L"\U000021BD", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nleftarrow", OperatorInfo(L"\U0000219A", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nrightarrow", OperatorInfo(L"\U0000219B", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\supset", OperatorInfo(L"\U00002283", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\subset", OperatorInfo(L"\U00002282", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\supseteq", OperatorInfo(L"\U00002287", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\subseteq", OperatorInfo(L"\U00002286", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\sqsupset", OperatorInfo(L"\U00002290", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\sqsubset", OperatorInfo(L"\U0000228F", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\sqsupseteq", OperatorInfo(L"\U00002292", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\sqsubseteq", OperatorInfo(L"\U00002291", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\supsetneq", OperatorInfo(L"\U0000228B", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\subsetneq", OperatorInfo(L"\U0000228A", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\in", OperatorInfo(L"\U00002208", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ni", OperatorInfo(L"\U0000220B", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\notin", OperatorInfo(L"\U00002209", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\mid", OperatorInfo(L"|", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\sim", OperatorInfo(L"\U0000223C", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\simeq", OperatorInfo(L"\U00002243", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\approx", OperatorInfo(L"\U00002248", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\propto", OperatorInfo(L"\U0000221D", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\equiv", OperatorInfo(L"\U00002261", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\cong", OperatorInfo(L"\U00002245", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\neq", OperatorInfo(L"\U00002260", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ll", OperatorInfo(L"\U0000226A", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\gg", OperatorInfo(L"\U0000226B", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\geq", OperatorInfo(L"\U00002265", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\leq", OperatorInfo(L"\U00002264", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\triangleleft", OperatorInfo(L"\U000025C3", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\triangleright", OperatorInfo(L"\U000025B9", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\models", OperatorInfo(L"\U000022A7", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\vdash", OperatorInfo(L"\U000022A2", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Vdash", OperatorInfo(L"\U000022A9", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\vDash", OperatorInfo(L"\U000022A8", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\lesssim", OperatorInfo(L"\U00002272", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nless", OperatorInfo(L"\U0000226E", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ngeq", OperatorInfo(L"\U00002271", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nleq", OperatorInfo(L"\U00002270", LayoutTree::Node::cFlavourRel)),
-
- // FIX: the fonts shipped with Firefox 1.5 don't know about
- // 0x2a2f (&Cross;). So I'm mapping it to 0xd7 (&times;) for now.
-#if 0
- make_pair(L"\\times", OperatorInfo(L"\U00002A2F", LayoutTree::Node::cFlavourBin)),
-#else
- make_pair(L"\\times", OperatorInfo(L"\U000000D7", LayoutTree::Node::cFlavourBin)),
-#endif
-
- make_pair(L"\\div", OperatorInfo(L"\U000000F7", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\wedge", OperatorInfo(L"\U00002227", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\vee", OperatorInfo(L"\U00002228", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\oplus", OperatorInfo(L"\U00002295", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\otimes", OperatorInfo(L"\U00002297", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\cap", OperatorInfo(L"\U00002229", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\cup", OperatorInfo(L"\U0000222A", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\sqcap", OperatorInfo(L"\U00002293", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\sqcup", OperatorInfo(L"\U00002294", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\smile", OperatorInfo(L"\U00002323", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\frown", OperatorInfo(L"\U00002322", LayoutTree::Node::cFlavourRel)),
- // FIX: how to make these smiles/frowns smaller?
- make_pair(L"\\smallsmile", OperatorInfo(L"\U00002323", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\smallfrown", OperatorInfo(L"\U00002322", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\setminus", OperatorInfo(L"\U00002216", LayoutTree::Node::cFlavourBin)),
- // FIX: how to make smallsetminus smaller?
- make_pair(L"\\smallsetminus", OperatorInfo(L"\U00002216", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\star", OperatorInfo(L"\U000022C6", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\triangle", OperatorInfo(L"\U000025B3", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\wr", OperatorInfo(L"\U00002240", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\circ", OperatorInfo(L"\U00002218", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\lnot", OperatorInfo(L"\U000000AC", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\nabla", OperatorInfo(L"\U00002207", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\prime", OperatorInfo(L"\U00002032", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\backslash", OperatorInfo(L"\U00002216", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\pm", OperatorInfo(L"\U000000B1", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\mp", OperatorInfo(L"\U00002213", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\angle", OperatorInfo(L"\U00002220", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\nmid", OperatorInfo(L"\U00002224", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\square", OperatorInfo(L"\U000025A1", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\Box", OperatorInfo(L"\U000025A1", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\checkmark", OperatorInfo(L"\U00002713", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\complement", OperatorInfo(L"\U00002201", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\flat", OperatorInfo(L"\U0000266D", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\sharp", OperatorInfo(L"\U0000266F", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\natural", OperatorInfo(L"\U0000266E", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\bullet", OperatorInfo(L"\U00002022", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\dagger", OperatorInfo(L"\U00002020", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\ddagger", OperatorInfo(L"\U00002021", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\clubsuit", OperatorInfo(L"\U00002663", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\spadesuit", OperatorInfo(L"\U00002660", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\heartsuit", OperatorInfo(L"\U00002665", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\diamondsuit", OperatorInfo(L"\U00002666", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\top", OperatorInfo(L"\U000022A4", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\bot", OperatorInfo(L"\U000022A5", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\perp", OperatorInfo(L"\U000022A5", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\cdot", OperatorInfo(L"\U000022C5", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\vdots", OperatorInfo(L"\U000022EE", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\ddots", OperatorInfo(L"\U000022F1", LayoutTree::Node::cFlavourInner)),
- make_pair(L"\\cdots", OperatorInfo(L"\U000022EF", LayoutTree::Node::cFlavourInner)),
- make_pair(L"\\ldots", OperatorInfo(L"\U00002026", LayoutTree::Node::cFlavourInner)),
- // FIX: these next two aren't right. The amsmath package does tricky
- // things so that the dots change their vertical position depending
- // on the surrounding operators. We chicken out and just map them
- // to the same as \cdots and \ldots respectively.
- make_pair(L"\\dotsb", OperatorInfo(L"\U000022EF", LayoutTree::Node::cFlavourInner)),
- make_pair(L"\\dots", OperatorInfo(L"\U00002026", LayoutTree::Node::cFlavourInner)),
- make_pair(L"\\sum", OperatorInfo(L"\U00002211", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\prod", OperatorInfo(L"\U0000220F", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\int", OperatorInfo(L"\U0000222B", LayoutTree::Node::cFlavourOp, LayoutTree::Node::cLimitsNoLimits)),
- make_pair(L"\\iint", OperatorInfo(L"\U0000222C", LayoutTree::Node::cFlavourOp, LayoutTree::Node::cLimitsNoLimits)),
- make_pair(L"\\iiint", OperatorInfo(L"\U0000222D", LayoutTree::Node::cFlavourOp, LayoutTree::Node::cLimitsNoLimits)),
- make_pair(L"\\iiiint", OperatorInfo(L"\U00002A0C", LayoutTree::Node::cFlavourOp, LayoutTree::Node::cLimitsNoLimits)),
- make_pair(L"\\oint", OperatorInfo(L"\U0000222E", LayoutTree::Node::cFlavourOp, LayoutTree::Node::cLimitsNoLimits)),
- make_pair(L"\\bigcap", OperatorInfo(L"\U000022C2", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\bigodot", OperatorInfo(L"\U00002A00", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\bigcup", OperatorInfo(L"\U000022C3", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\bigotimes", OperatorInfo(L"\U00002A02", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\coprod", OperatorInfo(L"\U00002210", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\bigsqcup", OperatorInfo(L"\U00002A06", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\bigoplus", OperatorInfo(L"\U00002A01", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\bigvee", OperatorInfo(L"\U000022C1", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\biguplus", OperatorInfo(L"\U00002A04", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\bigwedge", OperatorInfo(L"\U000022C0", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\ulcorner", OperatorInfo(L"\U0000231C", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\urcorner", OperatorInfo(L"\U0000231D", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\llcorner", OperatorInfo(L"\U0000231E", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\lrcorner", OperatorInfo(L"\U0000231F", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\dashrightarrow", OperatorInfo(L"\U0000290F", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\dashleftarrow", OperatorInfo(L"\U0000290E", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\backprime", OperatorInfo(L"\U00002035", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\vartriangle", OperatorInfo(L"\U000025B5", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\blacktriangle", OperatorInfo(L"\U000025B4", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\triangledown", OperatorInfo(L"\U000025BF", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\blacktriangledown", OperatorInfo(L"\U000025BE", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\blacksquare", OperatorInfo(L"\U000025FC", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\lozenge", OperatorInfo(L"\U000025CA", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\blacklozenge", OperatorInfo(L"\U000029EB", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\bigstar", OperatorInfo(L"\U00002605", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\sphericalangle", OperatorInfo(L"\U00002222", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\measuredangle", OperatorInfo(L"\U00002221", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\dotplus", OperatorInfo(L"\U00002214", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\ltimes", OperatorInfo(L"\U000022C9", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\rtimes", OperatorInfo(L"\U000022CA", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\Cap", OperatorInfo(L"\U000022D2", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\leftthreetimes", OperatorInfo(L"\U000022CB", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\rightthreetimes", OperatorInfo(L"\U000022CC", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\Cup", OperatorInfo(L"\U000022D3", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\barwedge", OperatorInfo(L"\U00002305", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\curlywedge", OperatorInfo(L"\U000022CF", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\veebar", OperatorInfo(L"\U000022BB", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\curlyvee", OperatorInfo(L"\U000022CE", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\doublebarwedge", OperatorInfo(L"\U00002306", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\boxminus", OperatorInfo(L"\U0000229F", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\circleddash", OperatorInfo(L"\U0000229D", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\boxtimes", OperatorInfo(L"\U000022A0", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\circledast", OperatorInfo(L"\U0000229B", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\boxdot", OperatorInfo(L"\U000022A1", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\circledcirc", OperatorInfo(L"\U0000229A", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\boxplus", OperatorInfo(L"\U0000229E", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\centerdot", OperatorInfo(L"\U000022C5", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\divideontimes", OperatorInfo(L"\U000022C7", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\intercal", OperatorInfo(L"\U000022BA", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\leqq", OperatorInfo(L"\U00002266", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\geqq", OperatorInfo(L"\U00002267", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\leqslant", OperatorInfo(L"\U00002A7D", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\geqslant", OperatorInfo(L"\U00002A7E", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\eqslantless", OperatorInfo(L"\U00002A95", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\eqslantgtr", OperatorInfo(L"\U00002A96", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\gtrsim", OperatorInfo(L"\U00002273", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\lessapprox", OperatorInfo(L"\U00002A85", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\gtrapprox", OperatorInfo(L"\U00002A86", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\approxeq", OperatorInfo(L"\U0000224A", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\eqsim", OperatorInfo(L"\U00002242", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\lessdot", OperatorInfo(L"\U000022D6", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\gtrdot", OperatorInfo(L"\U000022D7", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\lll", OperatorInfo(L"\U000022D8", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ggg", OperatorInfo(L"\U000022D9", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\lessgtr", OperatorInfo(L"\U00002276", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\gtrless", OperatorInfo(L"\U00002277", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\lesseqgtr", OperatorInfo(L"\U000022DA", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\gtreqless", OperatorInfo(L"\U000022DB", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\lesseqqgtr", OperatorInfo(L"\U00002A8B", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\gtreqqless", OperatorInfo(L"\U00002A8C", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\doteqdot", OperatorInfo(L"\U00002251", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\eqcirc", OperatorInfo(L"\U00002256", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\risingdotseq", OperatorInfo(L"\U00002253", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\circeq", OperatorInfo(L"\U00002257", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\fallingdotseq", OperatorInfo(L"\U00002252", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\triangleq", OperatorInfo(L"\U0000225C", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\backsim", OperatorInfo(L"\U0000223D", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\thicksim", OperatorInfo(L"\U0000223C", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\backsimeq", OperatorInfo(L"\U000022CD", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\thickapprox", OperatorInfo(L"\U00002248", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\subseteqq", OperatorInfo(L"\U00002AC5", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\supseteqq", OperatorInfo(L"\U00002AC6", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Subset", OperatorInfo(L"\U000022D0", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Supset", OperatorInfo(L"\U000022D1", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\preccurlyeq", OperatorInfo(L"\U0000227C", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\succcurlyeq", OperatorInfo(L"\U0000227D", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\curlyeqprec", OperatorInfo(L"\U000022DE", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\curlyeqsucc", OperatorInfo(L"\U000022DF", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\precsim", OperatorInfo(L"\U0000227E", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\succsim", OperatorInfo(L"\U0000227F", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\precapprox", OperatorInfo(L"\U00002AB7", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\succapprox", OperatorInfo(L"\U00002AB8", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Vvdash", OperatorInfo(L"\U000022AA", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\shortmid", OperatorInfo(L"\U00002223", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\shortparallel", OperatorInfo(L"\U00002225", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\bumpeq", OperatorInfo(L"\U0000224F", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\between", OperatorInfo(L"\U0000226C", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Bumpeq", OperatorInfo(L"\U0000224E", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\varpropto", OperatorInfo(L"\U0000221D", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\backepsilon", OperatorInfo(L"\U000003F6", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\blacktriangleleft", OperatorInfo(L"\U000025C0", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\blacktriangleright", OperatorInfo(L"\U000025B6", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\therefore", OperatorInfo(L"\U00002234", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\because", OperatorInfo(L"\U00002235", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ngtr", OperatorInfo(L"\U0000226F", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nleqslant", OperatorInfo(L"\U00002A7D\U00000338", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ngeqslant", OperatorInfo(L"\U00002A7E\U00000338", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nleqq", OperatorInfo(L"\U00002266\U00000338", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ngeqq", OperatorInfo(L"\U00002267\U00000338", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\lneqq", OperatorInfo(L"\U00002268", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\gneqq", OperatorInfo(L"\U00002269", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\lvertneqq", OperatorInfo(L"\U00002268\U0000FE00", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\gvertneqq", OperatorInfo(L"\U00002269\U0000FE00", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\lnsim", OperatorInfo(L"\U000022E6", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\gnsim", OperatorInfo(L"\U000022E7", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\lnapprox", OperatorInfo(L"\U00002A89", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\gnapprox", OperatorInfo(L"\U00002A8A", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nprec", OperatorInfo(L"\U00002280", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nsucc", OperatorInfo(L"\U00002281", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\npreceq", OperatorInfo(L"\U00002AAF\U00000338", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nsucceq", OperatorInfo(L"\U00002AB0\U00000338", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\precneqq", OperatorInfo(L"\U00002AB5", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\succneqq", OperatorInfo(L"\U00002AB6", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\precnsim", OperatorInfo(L"\U000022E8", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\succnsim", OperatorInfo(L"\U000022E9", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\precnapprox", OperatorInfo(L"\U00002AB9", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\succnapprox", OperatorInfo(L"\U00002ABA", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nsim", OperatorInfo(L"\U00002241", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ncong", OperatorInfo(L"\U00002247", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nshortmid", OperatorInfo(L"\U00002224", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nshortparallel", OperatorInfo(L"\U00002226", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nmid", OperatorInfo(L"\U00002224", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nparallel", OperatorInfo(L"\U00002226", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nvdash", OperatorInfo(L"\U000022AC", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nvDash", OperatorInfo(L"\U000022AD", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nVdash", OperatorInfo(L"\U000022AE", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nVDash", OperatorInfo(L"\U000022AF", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ntriangleleft", OperatorInfo(L"\U000022EA", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ntriangleright", OperatorInfo(L"\U000022EB", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ntrianglelefteq", OperatorInfo(L"\U000022EC", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\ntrianglerighteq", OperatorInfo(L"\U000022ED", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nsubseteq", OperatorInfo(L"\U00002288", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nsupseteq", OperatorInfo(L"\U00002289", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nsubseteqq", OperatorInfo(L"\U00002AC5\U00000338", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nsupseteqq", OperatorInfo(L"\U00002AC6\U00000338", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\subsetneq", OperatorInfo(L"\U0000228A", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\supsetneq", OperatorInfo(L"\U0000228B", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\varsubsetneq", OperatorInfo(L"\U0000228A\U0000FE00", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\varsupsetneq", OperatorInfo(L"\U0000228B\U0000FE00", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\subsetneqq", OperatorInfo(L"\U00002ACB", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\supsetneqq", OperatorInfo(L"\U00002ACC", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\varsubsetneqq", OperatorInfo(L"\U00002ACB\U0000FE00", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\varsupsetneqq", OperatorInfo(L"\U00002ACC\U0000FE00", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\leftleftarrows", OperatorInfo(L"\U000021C7", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\rightrightarrows", OperatorInfo(L"\U000021C9", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\leftrightarrows", OperatorInfo(L"\U000021C6", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\rightleftarrows", OperatorInfo(L"\U000021C4", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Lleftarrow", OperatorInfo(L"\U000021DA", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Rrightarrow", OperatorInfo(L"\U000021DB", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\twoheadleftarrow", OperatorInfo(L"\U0000219E", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\twoheadrightarrow", OperatorInfo(L"\U000021A0", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\leftarrowtail", OperatorInfo(L"\U000021A2", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\rightarrowtail", OperatorInfo(L"\U000021A3", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\looparrowleft", OperatorInfo(L"\U000021AB", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\looparrowright", OperatorInfo(L"\U000021AC", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\leftrightharpoons", OperatorInfo(L"\U000021CB", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\rightleftharpoons", OperatorInfo(L"\U000021CC", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\curvearrowleft", OperatorInfo(L"\U000021B6", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\curvearrowright", OperatorInfo(L"\U000021B7", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\circlearrowleft", OperatorInfo(L"\U000021BA", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\circlearrowright", OperatorInfo(L"\U000021BB", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Lsh", OperatorInfo(L"\U000021B0", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\Rsh", OperatorInfo(L"\U000021B1", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\upuparrows", OperatorInfo(L"\U000021C8", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\downdownarrows", OperatorInfo(L"\U000021CA", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\multimap", OperatorInfo(L"\U000022B8", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\rightsquigarrow", OperatorInfo(L"\U0000219D", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\leftrightsquigarrow", OperatorInfo(L"\U000021AD", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nLeftarrow", OperatorInfo(L"\U000021CD", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nRightarrow", OperatorInfo(L"\U000021CF", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nleftrightarrow", OperatorInfo(L"\U000021AE", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nLeftrightarrow", OperatorInfo(L"\U000021CE", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\pitchfork", OperatorInfo(L"\U000022D4", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\nexists", OperatorInfo(L"\U00002204", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\lhd", OperatorInfo(L"\U000022B2", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\rhd", OperatorInfo(L"\U000022B3", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\unlhd", OperatorInfo(L"\U000022B4", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\unrhd", OperatorInfo(L"\U000022B5", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\leadsto", OperatorInfo(L"\U000021DD", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\uplus", OperatorInfo(L"\U0000228E", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\diamond", OperatorInfo(L"\U000022C4", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\bigtriangleup", OperatorInfo(L"\U000025B3", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\bigtriangledown", OperatorInfo(L"\U000025BD", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\ominus", OperatorInfo(L"\U00002296", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\oslash", OperatorInfo(L"\U00002298", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\odot", OperatorInfo(L"\U00002299", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\bigcirc", OperatorInfo(L"\U000025EF", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\amalg", OperatorInfo(L"\U00002A3F", LayoutTree::Node::cFlavourBin)),
- make_pair(L"\\prec", OperatorInfo(L"\U0000227A", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\succ", OperatorInfo(L"\U0000227B", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\preceq", OperatorInfo(L"\U00002AAF", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\succeq", OperatorInfo(L"\U00002AB0", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\dashv", OperatorInfo(L"\U000022A3", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\asymp", OperatorInfo(L"\U00002248", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\doteq", OperatorInfo(L"\U00002250", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\parallel", OperatorInfo(L"\U00002225", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\bowtie", OperatorInfo(L"\U000022C8", LayoutTree::Node::cFlavourRel)),
- make_pair(L"\\surd", OperatorInfo(L"\U0000221A", LayoutTree::Node::cFlavourOrd)),
-
- make_pair(L"\\lim", OperatorInfo(L"lim", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\sup", OperatorInfo(L"sup", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\inf", OperatorInfo(L"inf", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\min", OperatorInfo(L"min", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\max", OperatorInfo(L"max", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\gcd", OperatorInfo(L"gcd", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\det", OperatorInfo(L"det", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\Pr", OperatorInfo(L"Pr", LayoutTree::Node::cFlavourOp)),
- // FIX: the space between the words in these operators is maybe a tiny bit too big.
- make_pair(L"\\limsup", OperatorInfo(L"lim sup", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\liminf", OperatorInfo(L"lim inf", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\injlim", OperatorInfo(L"inj lim", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\projlim", OperatorInfo(L"proj lim", LayoutTree::Node::cFlavourOp)),
-
- // The translation of \not is special: we record it as a SymbolOperator
- // in the layout tree, but it gets special handling later.
- make_pair(L"\\not", OperatorInfo(L"NOT", LayoutTree::Node::cFlavourRel))
-};
-wishful_hash_map<wstring, OperatorInfo> operatorTable(
- operatorArray,
- END_ARRAY(operatorArray)
-);
-
-
-struct IdentifierInfo
-{
- bool mIsItalicDefault;
- wstring mText;
- LayoutTree::Node::Flavour mFlavour;
-
- IdentifierInfo(
- bool isItalicDefault,
- const wstring& text,
- LayoutTree::Node::Flavour flavour
- ) :
- mIsItalicDefault(isItalicDefault),
- mText(text),
- mFlavour(flavour)
- { }
-};
-
-// A list of all commands that get translated as identifiers,
-// their MathML translations, flavour, and whether they should be
-// rendered in italic font.
-pair<wstring, IdentifierInfo> identifierArray[] =
-{
- make_pair(L"\\ker", IdentifierInfo(false, L"ker", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\deg", IdentifierInfo(false, L"deg", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\hom", IdentifierInfo(false, L"hom", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\dim", IdentifierInfo(false, L"dim", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\arg", IdentifierInfo(false, L"arg", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\sin", IdentifierInfo(false, L"sin", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\cos", IdentifierInfo(false, L"cos", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\sec", IdentifierInfo(false, L"sec", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\csc", IdentifierInfo(false, L"csc", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\tan", IdentifierInfo(false, L"tan", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\cot", IdentifierInfo(false, L"cot", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\arcsin", IdentifierInfo(false, L"arcsin", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\arccos", IdentifierInfo(false, L"arccos", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\arctan", IdentifierInfo(false, L"arctan", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\sinh", IdentifierInfo(false, L"sinh", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\cosh", IdentifierInfo(false, L"cosh", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\tanh", IdentifierInfo(false, L"tanh", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\coth", IdentifierInfo(false, L"coth", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\log", IdentifierInfo(false, L"log", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\lg", IdentifierInfo(false, L"lg", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\ln", IdentifierInfo(false, L"ln", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\exp", IdentifierInfo(false, L"exp", LayoutTree::Node::cFlavourOp)),
- make_pair(L"\\aleph", IdentifierInfo(false, L"\U00002135", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\beth", IdentifierInfo(false, L"\U00002136", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\gimel", IdentifierInfo(false, L"\U00002137", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\daleth", IdentifierInfo(false, L"\U00002138", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\wp", IdentifierInfo(true, L"\U00002118", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\ell", IdentifierInfo(true, L"\U00002113", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\P", IdentifierInfo(true, L"\U000000B6", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\imath", IdentifierInfo(true, L"\U00000131", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\Finv", IdentifierInfo(false, L"\U00002132", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\Game", IdentifierInfo(false, L"\U00002141", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\partial", IdentifierInfo(false, L"\U00002202", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\Re", IdentifierInfo(false, L"\U0000211C", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\Im", IdentifierInfo(false, L"\U00002111", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\infty", IdentifierInfo(false, L"\U0000221E", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\hbar", IdentifierInfo(false, L"\U00000127", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\emptyset", IdentifierInfo(false, L"\U00002205", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\varnothing", IdentifierInfo(false, L"\U000000D8", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\S", IdentifierInfo(false, L"\U000000A7", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\eth", IdentifierInfo(false, L"\U000000F0", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\hslash", IdentifierInfo(false, L"\U0000210F", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\mho", IdentifierInfo(false, L"\U00002127", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\circledR", IdentifierInfo(false, L"\U000000AE", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\yen", IdentifierInfo(false, L"\U000000A5", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\maltese", IdentifierInfo(false, L"\U00002720", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\circledS", IdentifierInfo(false, L"\U000024C8", LayoutTree::Node::cFlavourOrd)),
- // FIX: these two needs special testing since they're plane-1:
- // FIX: need to update mediawiki to recognise these entities
- make_pair(L"\\Bbbk", IdentifierInfo(false, L"\U0001D55C", LayoutTree::Node::cFlavourOrd)),
- make_pair(L"\\jmath", IdentifierInfo(true, L"\U0001D6A5", LayoutTree::Node::cFlavourOrd))
-};
-wishful_hash_map<wstring, IdentifierInfo> identifierTable(
- identifierArray,
- END_ARRAY(identifierArray)
-);
-
-
-namespace ParseTree
-{
-
-auto_ptr<LayoutTree::Node> MathSymbol::BuildLayoutTree(
- const TexProcessingState& state
-) const
-{
- // First check for certain easy-to-handle single character commands,
- // like letters or numerals.
- if (mCommand.size() == 1)
- {
- bool good = false;
- bool isNumber = false;
- // fancyFontsIllegal is set for characters which can't be
- // displayed in frak, cal or bb fonts.
- bool fancyFontsIllegal = false;
- TexMathFont::Family defaultFamily = TexMathFont::cFamilyIt;
- TexMathFont font = state.mMathFont;
-
- if (mCommand[0] >= L'A' && mCommand[0] <= L'Z')
- good = true;
-
- else if (mCommand[0] >= L'a' && mCommand[0] <= L'z')
- {
- fancyFontsIllegal = true;
- good = true;
- }
-
- else if (mCommand[0] >= L'0' && mCommand[0] <= L'9')
- {
- fancyFontsIllegal = true;
- defaultFamily = TexMathFont::cFamilyRm;
- good = isNumber = true;
- }
-
- if (good)
- {
- if (font.mFamily == TexMathFont::cFamilyDefault)
- font.mFamily = defaultFamily;
-
- if (fancyFontsIllegal &&
- font.mFamily == TexMathFont::cFamilyCal
- )
- throw Exception(
- L"UnavailableSymbolFontCombination", mCommand, L"cal"
- );
-
- if (fancyFontsIllegal &&
- font.mFamily == TexMathFont::cFamilyBb
- )
- throw Exception(
- L"UnavailableSymbolFontCombination", mCommand, L"bb"
- );
-
- if (isNumber)
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolNumber(
- mCommand,
- font.GetMathmlApproximation(),
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- else
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolIdentifier(
- mCommand,
- font.GetMathmlApproximation(),
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- }
-
- // Non-ascii characters
- if (mCommand[0] > 0x7F)
- throw logic_error(
- "Unexpected non-ASCII character "
- "in MathSymbol::BuildLayoutTree"
- );
- }
-
- wishful_hash_map<wstring, wchar_t>::const_iterator
- lowercaseGreekLookup = lowercaseGreekTable.find(mCommand);
-
- if (lowercaseGreekLookup != lowercaseGreekTable.end())
- {
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolIdentifier(
- wstring(1, lowercaseGreekLookup->second),
- // lowercase greek is only affected by the boldsymbol
- // status, not the family.
- state.mMathFont.mIsBoldsymbol
- ? cMathmlFontBoldItalic : cMathmlFontItalic,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- }
-
- wishful_hash_map<wstring, wchar_t>::const_iterator
- uppercaseGreekLookup = uppercaseGreekTable.find(mCommand);
-
- if (uppercaseGreekLookup != uppercaseGreekTable.end())
- {
- TexMathFont font = state.mMathFont;
- if (font.mFamily == TexMathFont::cFamilyCal)
- throw Exception(
- L"UnavailableSymbolFontCombination", mCommand, L"cal"
- );
-
- if (font.mFamily == TexMathFont::cFamilyBb)
- throw Exception(
- L"UnavailableSymbolFontCombination", mCommand, L"bb"
- );
-
- if (font.mFamily == TexMathFont::cFamilyFrak)
- throw Exception(
- L"UnavailableSymbolFontCombination", mCommand, L"frak"
- );
-
- if (font.mFamily == TexMathFont::cFamilyDefault)
- font.mFamily = TexMathFont::cFamilyRm;
-
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolIdentifier(
- wstring(1, uppercaseGreekLookup->second),
- font.GetMathmlApproximation(),
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- }
-
- wishful_hash_map<wstring, int>::const_iterator
- spaceLookup = spaceTable.find(mCommand);
-
- if (spaceLookup != spaceTable.end())
- {
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::Space(
- spaceLookup->second,
- true // true = indicates a user-requested space
- )
- );
- }
-
- wishful_hash_map<wstring, OperatorInfo>::const_iterator
- operatorLookup = operatorTable.find(mCommand);
-
- if (operatorLookup != operatorTable.end())
- {
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolOperator(
- false, L"", // not stretchy
- false, // not an accent
- operatorLookup->second.mText,
- // operators are only affected by the boldsymbol status,
- // not the family.
- state.mMathFont.mIsBoldsymbol
- ? cMathmlFontBold : cMathmlFontNormal,
- state.mStyle,
- operatorLookup->second.mFlavour,
- operatorLookup->second.mLimits,
- state.mColour
- )
- );
- }
-
- wishful_hash_map<wstring, IdentifierInfo>::const_iterator
- identifierLookup = identifierTable.find(mCommand);
-
- if (identifierLookup != identifierTable.end())
- {
- TexMathFont font = state.mMathFont;
- font.mFamily =
- identifierLookup->second.mIsItalicDefault
- ? TexMathFont::cFamilyIt : TexMathFont::cFamilyRm;
-
- return auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolIdentifier(
- identifierLookup->second.mText,
- font.GetMathmlApproximation(),
- state.mStyle,
- identifierLookup->second.mFlavour,
- // For all the "\sin"-like functions:
- (
- identifierLookup->second.mFlavour ==
- LayoutTree::Node::cFlavourOp
- )
- ? LayoutTree::Node::cLimitsNoLimits
- : LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- }
-
- if (mCommand == L"\\And")
- {
- auto_ptr<LayoutTree::Row> row(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
- row->mFlavour = LayoutTree::Node::cFlavourRel;
- row->mChildren.push_back(new LayoutTree::Space(5, true));
- row->mChildren.push_back(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- false,
- L"&",
- state.mMathFont.mIsBoldsymbol
- ? cMathmlFontBold : cMathmlFontNormal,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- row->mChildren.push_back(new LayoutTree::Space(5, true));
- return static_cast<auto_ptr<LayoutTree::Node> >(row);
- }
-
- if (mCommand == L"\\iff")
- {
- auto_ptr<LayoutTree::Row> row(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
- row->mFlavour = LayoutTree::Node::cFlavourRel;
- row->mChildren.push_back(new LayoutTree::Space(5, true));
- // FIX: I would like to make this stretchy and set a particular
- // size, but for some reason firefox doesn't stretch things
- // horizontally like this. It DOES do it if the element is in a
- // <mover> or <munder> etc, but not when it's just by itself.
- // Very strange. This is mozilla bug 320303.
- row->mChildren.push_back(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- false,
- L"\U000021D4",
- state.mMathFont.mIsBoldsymbol
- ? cMathmlFontBold : cMathmlFontNormal,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- row->mChildren.push_back(new LayoutTree::Space(5, true));
- return static_cast<auto_ptr<LayoutTree::Node> >(row);
- }
-
- if (mCommand == L"\\colon")
- {
- // FIX: this spacing stuff isn't quite right, but it will hopefully
- // do. The amsmath package does all kinds of interesting things with
- // \colon's spacing.
- auto_ptr<LayoutTree::Row> row(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
- row->mChildren.push_back(new LayoutTree::Space(2, true));
- row->mChildren.push_back(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- false,
- L":",
- state.mMathFont.mIsBoldsymbol
- ? cMathmlFontBold : cMathmlFontNormal,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- row->mChildren.push_back(new LayoutTree::Space(6, true));
- return static_cast<auto_ptr<LayoutTree::Node> >(row);
- }
-
- if (mCommand == L"\\bmod")
- {
- auto_ptr<LayoutTree::Row> row(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
- row->mFlavour = LayoutTree::Node::cFlavourBin;
- row->mChildren.push_back(new LayoutTree::Space(1, true));
- row->mChildren.push_back(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- false,
- L"mod",
- state.mMathFont.mIsBoldsymbol
- ? cMathmlFontBold : cMathmlFontNormal,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- row->mChildren.push_back(new LayoutTree::Space(1, true));
- return static_cast<auto_ptr<LayoutTree::Node> >(row);
- }
-
- if (mCommand == L"\\mod")
- {
- auto_ptr<LayoutTree::Row> row(
- new LayoutTree::Row(state.mStyle, state.mColour)
- );
- row->mChildren.push_back(new LayoutTree::Space(18, true));
- row->mChildren.push_back(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- false,
- L"mod",
- state.mMathFont.mIsBoldsymbol
- ? cMathmlFontBold : cMathmlFontNormal,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
- row->mChildren.push_back(new LayoutTree::Space(6, true));
- return static_cast<auto_ptr<LayoutTree::Node> >(row);
- }
-
- if (mCommand == L"\\varinjlim" || mCommand == L"\\varprojlim" ||
- mCommand == L"\\varlimsup" || mCommand == L"\\varliminf")
- {
- MathmlFont font =
- state.mMathFont.mIsBoldsymbol
- ? cMathmlFontBold : cMathmlFontNormal;
-
- auto_ptr<LayoutTree::Node> base(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- false,
- L"lim",
- font,
- state.mStyle,
- LayoutTree::Node::cFlavourOp,
- LayoutTree::Node::cLimitsLimits,
- state.mColour
- )
- );
-
- auto_ptr<LayoutTree::Scripts> node(
- new LayoutTree::Scripts(
- state.mStyle,
- LayoutTree::Node::cFlavourOp,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour,
- false,
- base,
- auto_ptr<LayoutTree::Node>(),
- auto_ptr<LayoutTree::Node>()
- )
- );
-
- if (mCommand == L"\\varinjlim")
- node->mLower = auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- true,
- L"\U00002192",
- font,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
-
- else if (mCommand == L"\\varprojlim")
- node->mLower = auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolOperator(
- false,
- L"",
- true,
- L"\U00002190",
- font,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
-
- else if (mCommand == L"\\varliminf")
- node->mLower = auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolOperator(
- true,
- L"",
- true,
- L"\U000000AF",
- font,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
-
- else if (mCommand == L"\\varlimsup")
- node->mUpper = auto_ptr<LayoutTree::Node>(
- new LayoutTree::SymbolOperator(
- true,
- L"",
- true,
- L"\U000000AF",
- font,
- state.mStyle,
- LayoutTree::Node::cFlavourOrd,
- LayoutTree::Node::cLimitsDisplayLimits,
- state.mColour
- )
- );
-
- return static_cast<auto_ptr<LayoutTree::Node> >(node);
- }
-
- throw logic_error("Unexpected command in MathSymbol::BuildLayoutTree");
-}
-
-}
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/ParseTree3.cpp b/blahtexml/source/BlahtexCore/ParseTree3.cpp
deleted file mode 100644
index 88812e0..0000000
--- a/blahtexml/source/BlahtexCore/ParseTree3.cpp
+++ /dev/null
@@ -1,1317 +0,0 @@
-// File "ParseTree3.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <stdexcept>
-#include <set>
-#include <iomanip>
-#include <sstream>
-#include "ParseTree.h"
-
-using namespace std;
-
-namespace blahtex
-{
-
-// List of colour names that we know about.
-pair<wstring, RGBColour> gColourArray[] =
-{
- make_pair(L"GreenYellow", 0xd8ff4f),
- make_pair(L"Yellow", 0xffff00),
- make_pair(L"yellow", 0xffff00),
- make_pair(L"Goldenrod", 0xffe528),
- make_pair(L"Dandelion", 0xffb528),
- make_pair(L"Apricot", 0xffad7a),
- make_pair(L"Peach", 0xff7f4c),
- make_pair(L"Melon", 0xff897f),
- make_pair(L"YellowOrange", 0xff9300),
- make_pair(L"Orange", 0xff6321),
- make_pair(L"BurntOrange", 0xff7c00),
- make_pair(L"Bittersweet", 0xc10200),
- make_pair(L"RedOrange", 0xff3a21),
- make_pair(L"Mahogany", 0xa50000),
- make_pair(L"Maroon", 0xad0000),
- make_pair(L"BrickRed", 0xb70000),
- make_pair(L"Red", 0xff0000),
- make_pair(L"red", 0xff0000),
- make_pair(L"OrangeRed", 0xff007f),
- make_pair(L"RubineRed", 0xff00dd),
- make_pair(L"WildStrawberry", 0xff0a9b),
- make_pair(L"Salmon", 0xff779e),
- make_pair(L"CarnationPink", 0xff5eff),
- make_pair(L"Magenta", 0xff00ff),
- make_pair(L"magenta", 0xff00ff),
- make_pair(L"VioletRed", 0xff30ff),
- make_pair(L"Rhodamine", 0xff2dff),
- make_pair(L"Mulberry", 0xa314f9),
- make_pair(L"RedViolet", 0x9600a8),
- make_pair(L"Fuchsia", 0x7202ea),
- make_pair(L"Lavender", 0xff84ff),
- make_pair(L"Thistle", 0xe068ff),
- make_pair(L"Orchid", 0xad5bff),
- make_pair(L"DarkOrchid", 0x9933cc),
- make_pair(L"Purple", 0x8c23ff),
- make_pair(L"Plum", 0x7f00ff),
- make_pair(L"Violet", 0x351eff),
- make_pair(L"RoyalPurple", 0x3f19ff),
- make_pair(L"BlueViolet", 0x190cf4),
- make_pair(L"Periwinkle", 0x6d72ff),
- make_pair(L"CadetBlue", 0x606dc4),
- make_pair(L"CornflowerBlue", 0x59ddff),
- make_pair(L"MidnightBlue", 0x007091),
- make_pair(L"NavyBlue", 0x0f75ff),
- make_pair(L"RoyalBlue", 0x007fff),
- make_pair(L"Blue", 0x0000ff),
- make_pair(L"blue", 0x0000ff),
- make_pair(L"Cerulean", 0x0fe2ff),
- make_pair(L"Cyan", 0x00ffff),
- make_pair(L"cyan", 0x00ffff),
- make_pair(L"ProcessBlue", 0x0affff),
- make_pair(L"SkyBlue", 0x60ffe0),
- make_pair(L"Turquoise", 0x26ffcc),
- make_pair(L"TealBlue", 0x1ef9a3),
- make_pair(L"Aquamarine", 0x2dffb2),
- make_pair(L"BlueGreen", 0x26ffaa),
- make_pair(L"Emerald", 0x00ff7f),
- make_pair(L"JungleGreen", 0x02ff7a),
- make_pair(L"SeaGreen", 0x4fff7f),
- make_pair(L"Green", 0x00ff00),
- make_pair(L"green", 0x00ff00),
- make_pair(L"ForestGreen", 0x00e000),
- make_pair(L"PineGreen", 0x00bf28),
- make_pair(L"LimeGreen", 0x7fff00),
- make_pair(L"YellowGreen", 0x8eff42),
- make_pair(L"SpringGreen", 0xbcff3d),
- make_pair(L"OliveGreen", 0x009900),
- make_pair(L"RawSienna", 0x8c0000),
- make_pair(L"Sepia", 0x4c0000),
- make_pair(L"Brown", 0x660000),
- make_pair(L"Tan", 0xdb9370),
- make_pair(L"Gray", 0x7f7f7f),
- make_pair(L"Black", 0x000000),
- make_pair(L"black", 0x000000),
- make_pair(L"White", 0xffffff),
- make_pair(L"white", 0xffffff)
-};
-
-wishful_hash_map<wstring, RGBColour> gColourTable(
- gColourArray,
- END_ARRAY(gColourArray)
-);
-
-
-MathmlFont TexMathFont::GetMathmlApproximation() const
-{
- if (mIsBoldsymbol)
- {
- switch (mFamily)
- {
- case cFamilyRm: return cMathmlFontBold;
- case cFamilyIt: return cMathmlFontBoldItalic;
- case cFamilyBf: return cMathmlFontBold;
- case cFamilyBb: return cMathmlFontDoubleStruck;
- case cFamilySf: return cMathmlFontBoldSansSerif;
- case cFamilyCal: return cMathmlFontBoldScript;
- case cFamilyTt: return cMathmlFontMonospace;
- case cFamilyFrak: return cMathmlFontBoldFraktur;
- }
- }
- else
- {
- switch (mFamily)
- {
- case cFamilyRm: return cMathmlFontNormal;
- case cFamilyIt: return cMathmlFontItalic;
- case cFamilyBf: return cMathmlFontBold;
- case cFamilyBb: return cMathmlFontDoubleStruck;
- case cFamilySf: return cMathmlFontSansSerif;
- case cFamilyCal: return cMathmlFontScript;
- case cFamilyTt: return cMathmlFontMonospace;
- case cFamilyFrak: return cMathmlFontFraktur;
- }
- }
-
- throw logic_error("Unexpected TexMathFont data");
-}
-
-MathmlFont TexTextFont::GetMathmlApproximation() const
-{
- switch (mFamily)
- {
- case cFamilyRm:
- return mIsBold
- ? (mIsItalic ? cMathmlFontBoldItalic : cMathmlFontBold)
- : (mIsItalic ? cMathmlFontItalic : cMathmlFontNormal);
-
- case cFamilySf:
- return mIsBold
- ? (
- mIsItalic
- ? cMathmlFontSansSerifBoldItalic
- : cMathmlFontBoldSansSerif
- )
- : (
- mIsItalic
- ? cMathmlFontSansSerifItalic
- : cMathmlFontSansSerif
- );
-
- case cFamilyTt: return cMathmlFontMonospace;
- }
-
- throw logic_error("Unexpected TexTextFont data");
-}
-
-
-namespace ParseTree
-{
-
-// A couple of destructors that implement ownership conventions.
-
-MathList::~MathList()
-{
- for (vector<MathNode*>::iterator
- p = mChildren.begin(); p != mChildren.end(); p++
- )
- delete *p;
-}
-
-MathTableRow::~MathTableRow()
-{
- for (vector<MathNode*>::iterator
- p = mEntries.begin(); p != mEntries.end(); p++
- )
- delete *p;
-}
-
-MathTable::~MathTable()
-{
- for (vector<MathTableRow*>::iterator
- p = mRows.begin(); p != mRows.end(); p++
- )
- delete *p;
-}
-
-TextList::~TextList()
-{
- for (vector<TextNode*>::iterator
- p = mChildren.begin(); p != mChildren.end(); p++
- )
- delete *p;
-}
-
-
-// =========================================================================
-// Implementations of ParseTree::MathStateChange/TextStateChange::Apply
-
-
-void MathStateChange::Apply(
- TexProcessingState& state
-) const
-{
- static pair<wstring, LayoutTree::Node::Style> styleCommandArray[] =
- {
- make_pair(L"\\displaystyle", LayoutTree::Node::cStyleDisplay),
- make_pair(L"\\textstyle", LayoutTree::Node::cStyleText),
- make_pair(L"\\scriptstyle", LayoutTree::Node::cStyleScript),
- make_pair(L"\\scriptscriptstyle", LayoutTree::Node::cStyleScriptScript)
- };
- static wishful_hash_map<wstring, LayoutTree::Node::Style>
- styleCommandTable(
- styleCommandArray,
- END_ARRAY(styleCommandArray)
- );
-
- wishful_hash_map<wstring, LayoutTree::Node::Style>::const_iterator
- styleCommand = styleCommandTable.find(mCommand);
-
- if (styleCommand != styleCommandTable.end())
- {
- state.mStyle = styleCommand->second;
- return;
- }
-
- static pair<wstring, TexMathFont::Family> fontCommandArray[] =
- {
- make_pair(L"\\rm", TexMathFont::cFamilyRm),
- make_pair(L"\\bf", TexMathFont::cFamilyBf),
- make_pair(L"\\it", TexMathFont::cFamilyIt),
- make_pair(L"\\cal", TexMathFont::cFamilyCal),
- make_pair(L"\\tt", TexMathFont::cFamilyTt),
- make_pair(L"\\sf", TexMathFont::cFamilySf)
- };
- static wishful_hash_map<wstring, TexMathFont::Family> fontCommandTable(
- fontCommandArray,
- END_ARRAY(fontCommandArray)
- );
-
- wishful_hash_map<wstring, TexMathFont::Family>::const_iterator
- fontCommand = fontCommandTable.find(mCommand);
-
- if (fontCommand != fontCommandTable.end())
- {
- state.mMathFont.mFamily = fontCommand->second;
- return;
- }
-
- throw logic_error(
- "Unexpected command in MathStateChange::Apply"
- );
-}
-
-
-void TextStateChange::Apply(
- TexProcessingState& state
-) const
-{
- static pair<wstring, TexTextFont> textCommandArray[] =
- { // bold? italic?
- make_pair(L"\\rm", TexTextFont(TexTextFont::cFamilyRm, false, false)),
- make_pair(L"\\it", TexTextFont(TexTextFont::cFamilyRm, false, true)),
- make_pair(L"\\bf", TexTextFont(TexTextFont::cFamilyRm, true, false)),
- make_pair(L"\\sf", TexTextFont(TexTextFont::cFamilySf, false, false)),
- make_pair(L"\\tt", TexTextFont(TexTextFont::cFamilyTt, false, false)),
- };
- static wishful_hash_map<wstring, TexTextFont> textCommandTable(
- textCommandArray,
- END_ARRAY(textCommandArray)
- );
-
- wishful_hash_map<wstring, TexTextFont>::iterator
- textCommand = textCommandTable.find(mCommand);
-
- if (textCommand == textCommandTable.end())
- throw logic_error(
- "Unexpected command in TextStateChange::Apply"
- );
-
- state.mTextFont = textCommand->second;
-}
-
-
-void MathColour::Apply(
- TexProcessingState& state
-) const
-{
- wishful_hash_map<wstring, RGBColour>::const_iterator
- colourLookup = gColourTable.find(mColourName);
-
- if (colourLookup == gColourTable.end())
- // This shouldn't happen because we checked the colour name during
- // parsing stage
- throw logic_error(
- "Cannot find colour name in MathColour::Apply"
- );
-
- state.mColour = colourLookup->second;
-}
-
-
-void TextColour::Apply(
- TexProcessingState& state
-) const
-{
- wishful_hash_map<wstring, RGBColour>::const_iterator
- colourLookup = gColourTable.find(mColourName);
-
- if (colourLookup == gColourTable.end())
- // This shouldn't happen because we checked the colour name during
- // parsing stage
- throw logic_error(
- "Cannot find colour name in TextColour::Apply"
- );
-
- state.mColour = colourLookup->second;
-}
-
-
-// =========================================================================
-// Implementations of ParseTree::Node::GetPurifiedTex()
-
-
-
-
-void MathSymbol::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.Update(mCommand);
- os << L" " << mCommand;
-}
-
-
-void MathCommand1Arg::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.Update(mCommand);
- os << mCommand << L"{";
- mChild->GetPurifiedTex(os, features, fontEncoding);
- os << L"}";
-}
-
-
-void MathStateChange::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.Update(mCommand);
- os << mCommand << L" ";
-}
-
-
-void MathColour::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.mNeedsColor = true;
- os << L"\\color{" << mColourName << L"}";
-}
-
-
-void MathCommand2Args::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.Update(mCommand);
- if (mIsInfix)
- {
- // e.g. "\over"
- os << L"{";
- mChild1->GetPurifiedTex(os, features, fontEncoding);
- os << L"}" << mCommand << L"{";
- mChild2->GetPurifiedTex(os, features, fontEncoding);
- os << L"}";
- }
- else
- {
- if (mCommand == L"\\rootReserved")
- {
- os << L"\\sqrt[{";
- mChild1->GetPurifiedTex(os, features, fontEncoding);
- os << L"}]{";
- mChild2->GetPurifiedTex(os, features, fontEncoding);
- os << L"}";
- }
- else
- {
- os << mCommand << L"{";
- mChild1->GetPurifiedTex(os, features, fontEncoding);
- os << L"}{";
- mChild2->GetPurifiedTex(os, features, fontEncoding);
- os << L"}";
- }
- }
-}
-
-
-void MathGroup::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- os << L"{";
- mChild->GetPurifiedTex(os, features, fontEncoding);
- os << L"}";
-}
-
-
-void MathList::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- for (vector<MathNode*>::const_iterator
- ptr = mChildren.begin();
- ptr != mChildren.end();
- ptr++
- )
- (*ptr)->GetPurifiedTex(os, features, fontEncoding);
-}
-
-
-void MathScripts::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- if (mBase.get())
- mBase->GetPurifiedTex(os, features, fontEncoding);
- if (mUpper.get())
- {
- os << L"^{";
- mUpper->GetPurifiedTex(os, features, fontEncoding);
- os << L"}";
- }
- if (mLower.get())
- {
- os << L"_{";
- mLower->GetPurifiedTex(os, features, fontEncoding);
- os << L"}";
- }
-}
-
-
-void MathLimits::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- mChild->GetPurifiedTex(os, features, fontEncoding);
- os << mCommand;
-}
-
-
-void MathDelimited::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.Update(mLeftDelimiter);
- features.Update(mRightDelimiter);
-
- os << L"\\left" << mLeftDelimiter;
- mChild->GetPurifiedTex(os, features, fontEncoding);
- os << L"\\right" << mRightDelimiter;
-}
-
-
-void MathBig::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.Update(mCommand);
- features.Update(mDelimiter);
-
- os << mCommand << mDelimiter;
-}
-
-
-void MathTableRow::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- for (vector<MathNode*>::const_iterator
- ptr = mEntries.begin();
- ptr != mEntries.end();
- ptr++
- )
- {
- if (ptr != mEntries.begin())
- os << L" &";
- (*ptr)->GetPurifiedTex(os, features, fontEncoding);
- }
-}
-
-
-void MathTable::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- for (vector<MathTableRow*>::const_iterator
- ptr = mRows.begin();
- ptr != mRows.end();
- ptr++
- )
- {
- if (ptr != mRows.begin())
- os << L" \\\\";
- (*ptr)->GetPurifiedTex(os, features, fontEncoding);
- }
-}
-
-
-void MathEnvironment::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- wstring beginCommand, endCommand;
- if (mIsShort)
- {
- beginCommand = L"\\" + mName;
- features.Update(beginCommand);
- beginCommand += L"{";
- endCommand = L"}";
- }
- else
- {
- beginCommand = L"\\begin{" + mName + L"}";
- features.Update(beginCommand);
- endCommand = L"\\end{" + mName + L"}";
- }
-
- os << beginCommand;
- mTable->GetPurifiedTex(os, features, fontEncoding);
- os << endCommand;
-}
-
-
-void TextList::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- for (vector<TextNode*>::const_iterator
- ptr = mChildren.begin();
- ptr != mChildren.end();
- ptr++
- )
- (*ptr)->GetPurifiedTex(os, features, fontEncoding);
-}
-
-
-void TextGroup::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- os << L"{";
- mChild->GetPurifiedTex(os, features, fontEncoding);
- os << L"}";
-}
-
-
-wstring FormatCodePoint(unsigned code)
-{
- wostringstream s;
- s << L"U+" << hex << setfill(L'0') << uppercase << setw(8) << code;
- return s.str();
-}
-
-wstring FontEncodingName[] =
-{
- L"default",
- L"cyrillic",
- L"japanese"
-};
-
-void TextSymbol::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- // These are all the non-ASCII unicode characters that we will translate
- // directly to \unichar without additional font encoding commands.
- static wchar_t gSimpleUnicodeArray[] =
- {
- 161, 163, 167, 169, 172, 174, 176, 181, 182, 191, 192, 193, 194,
- 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
- 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221,
- 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235,
- 236, 237, 238, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250,
- 251, 252, 253, 255, 256, 257, 258, 259, 262, 263, 264, 265, 266,
- 267, 268, 269, 270, 271, 274, 275, 276, 277, 278, 279, 282, 283,
- 284, 285, 286, 287, 288, 289, 290, 292, 293, 296, 297, 298, 299,
- 300, 301, 304, 305, 308, 309, 310, 311, 313, 314, 315, 316, 317,
- 318, 321, 322, 323, 324, 325, 326, 327, 328, 332, 333, 334, 335,
- 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348,
- 349, 350, 351, 352, 353, 354, 355, 356, 357, 360, 361, 362, 363,
- 364, 365, 366, 367, 368, 369, 372, 373, 374, 375, 376, 377, 378,
- 379, 380, 381, 382, 461, 462, 463, 464, 465, 466, 467, 468, 482,
- 483, 486, 487, 488, 489, 496, 500, 501, 504, 505, 508, 509, 510,
- 511, 536, 537, 538, 539, 542, 543, 550, 551, 552, 553, 558, 559,
- 562, 563
- };
-
- static set<wchar_t> gSimpleUnicodeTable(
- gSimpleUnicodeArray,
- END_ARRAY(gSimpleUnicodeArray)
- );
-
- if (mCommand.size() > 1 || mCommand[0] <= 0x7F)
- {
- // Plain ASCII character, or something like \textbackslash or \{.
- if (mCommand != L" " && fontEncoding != cFontEncodingDefault)
- throw Exception(
- L"WrongFontEncoding",
- mCommand,
- FontEncodingName[fontEncoding]
- );
-
- features.Update(mCommand);
- os << mCommand;
- }
- else
- {
- unsigned code = static_cast<unsigned>(mCommand[0]);
-
- if (gSimpleUnicodeTable.count(code))
- {
- if (fontEncoding != cFontEncodingDefault)
- throw Exception(
- L"WrongFontEncoding",
- FormatCodePoint(code),
- FontEncodingName[fontEncoding]
- );
-
- features.mNeedsUcs = true;
- os << L"\\unichar{" << code << L"}";
- }
- // Cyrillic:
- else if (code >= 0x400 && code <= 0x45F)
- {
- if (fontEncoding != cFontEncodingCyrillic)
- throw Exception(
- L"WrongFontEncodingWithHint",
- FormatCodePoint(code),
- FontEncodingName[fontEncoding],
- L"\\cyr"
- );
-
- features.mNeedsUcs = true;
- features.mNeedsX2 = true;
- os << L"\\unichar{" << code << L"}";
- }
- // Japanese:
- // FIX: we're making a very half-hearted attempt to filter out
- // non-Japanese characters here...
- else if (
- (code >= 0x3040 && code <= 0x30FF) // hiragana + katakana
- || (code >= 0x3400 && code <= 0x9FFF) // some kanji
- || (code >= 0xF900 && code <= 0xFAE0) // more kanji
- )
- {
- if (fontEncoding != cFontEncodingJapanese)
- throw Exception(
- L"WrongFontEncodingWithHint",
- FormatCodePoint(code),
- FontEncodingName[fontEncoding],
- L"\\jap"
- );
-
- features.mNeedsCJK = true;
- features.mNeedsJapaneseFont = true;
- // FIX: find out if CJK package lets us input via code point
- // instead of UTF-8
- os << mCommand[0];
- }
- else
- {
- throw Exception(
- L"PngIncompatibleCharacter",
- FormatCodePoint(code)
- );
- }
- }
-}
-
-
-void TextStateChange::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.Update(mCommand);
- os << mCommand << L"{}";
-}
-
-
-void TextColour::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.mNeedsColor = true;
- os << L"\\color{" << mColourName << L"}";
-}
-
-
-// Determines whether the supplied command is a font encoding command
-// (like "\cyr" or "\jap"), modifies fontEncoding accordingly, and throws
-// an exception if nested encodings occur.
-void HandleFontEncodingCommand(
- const wstring& command,
- FontEncoding& fontEncoding
-)
-{
- FontEncoding newEncoding = cFontEncodingDefault;
-
- if (command == L"\\cyr")
- newEncoding = cFontEncodingCyrillic;
- else if (command == L"\\jap")
- newEncoding = cFontEncodingJapanese;
-
- if (newEncoding != cFontEncodingDefault)
- {
- if (fontEncoding != cFontEncodingDefault)
- throw Exception(L"IllegalNestedFontEncodings");
-
- fontEncoding = newEncoding;
- }
-}
-
-void TextCommand1Arg::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.Update(mCommand);
- HandleFontEncodingCommand(mCommand, fontEncoding);
-
- os << mCommand << L"{";
- mChild->GetPurifiedTex(os, features, fontEncoding);
- os << L"}";
-}
-
-
-void EnterTextMode::GetPurifiedTex(
- wostream& os,
- LatexFeatures& features,
- FontEncoding fontEncoding
-) const
-{
- features.Update(mCommand);
- HandleFontEncodingCommand(mCommand, fontEncoding);
-
- os << mCommand << L"{";
- mChild->GetPurifiedTex(os, features, fontEncoding);
- os << L"}";
-}
-
-// =========================================================================
-// Now all the ParseTree debugging code.
-
-// This function generates the indents used by various debugging Print()
-// functions.
-wstring indent(int depth)
-{
- return wstring(2 * depth, L' ');
-}
-
-void MathSymbol::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathSymbol \"" << mCommand << L"\"" << endl;
-}
-
-void MathCommand1Arg::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathCommand1Arg \""
- << mCommand << L"\"" << endl;
- mChild->Print(os, depth+1);
-}
-
-void MathCommand2Args::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathCommand2Args \""
- << mCommand << L"\"" << endl;
- mChild1->Print(os, depth+1);
- mChild2->Print(os, depth+1);
-}
-
-void MathGroup::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathGroup" << endl;
- mChild->Print(os, depth+1);
-}
-
-void MathList::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathList" << endl;
- for (vector<MathNode*>::const_iterator
- ptr = mChildren.begin(); ptr != mChildren.end(); ptr++
- )
- (*ptr)->Print(os, depth+1);
-}
-
-void MathScripts::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathScripts" << endl;
- if (mBase.get())
- {
- os << indent(depth+1) << L"base" << endl;
- mBase->Print(os, depth+2);
- }
- if (mUpper.get())
- {
- os << indent(depth+1) << L"upper" << endl;
- mUpper->Print(os, depth+2);
- }
- if (mLower.get())
- {
- os << indent(depth+1) << L"lower" << endl;
- mLower->Print(os, depth+2);
- }
-}
-
-void MathLimits::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathLimits \"" << mCommand << L"\"" << endl;
- mChild->Print(os, depth+1);
-}
-
-void MathStateChange::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathStateChange \""
- << mCommand << L"\"" << endl;
-}
-
-void MathColour::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathColour \""
- << mColourName << L"\"" << endl;
-}
-
-void MathDelimited::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathDelimited \"" << mLeftDelimiter
- << L"\" \"" << mRightDelimiter << L"\"" << endl;
- mChild->Print(os, depth+1);
-}
-
-void MathBig::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathBig \"" << mCommand << L"\" \""
- << mDelimiter << L"\"" << endl;
-}
-
-void MathTableRow::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathTableRow" << endl;
- for (vector<MathNode*>::const_iterator
- ptr = mEntries.begin(); ptr != mEntries.end(); ptr++
- )
- (*ptr)->Print(os, depth+1);
-}
-
-void MathTable::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathTable" << endl;
- for (vector<MathTableRow*>::const_iterator
- ptr = mRows.begin(); ptr != mRows.end(); ptr++
- )
- (*ptr)->Print(os, depth+1);
-}
-
-void MathEnvironment::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"MathEnvironment \"" << mName << L"\"";
- if (mIsShort)
- os << " (short)";
- os << endl;
- mTable->Print(os, depth+1);
-}
-
-void EnterTextMode::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"EnterTextMode \"" << mCommand << L"\"" << endl;
- mChild->Print(os, depth+1);
-}
-
-void TextList::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"TextList" << endl;
- for (vector<TextNode*>::const_iterator
- ptr = mChildren.begin(); ptr != mChildren.end(); ptr++
- )
- (*ptr)->Print(os, depth+1);
-}
-
-void TextSymbol::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"TextSymbol \"" << mCommand << L"\"" << endl;
-}
-
-void TextCommand1Arg::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"TextCommand1Arg \""
- << mCommand << L"\"" << endl;
- mChild->Print(os, depth+1);
-}
-
-void TextStateChange::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"TextStateChange \""
- << mCommand << L"\"" << endl;
-}
-
-void TextColour::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"TextColour \""
- << mColourName << L"\"" << endl;
-}
-
-void TextGroup::Print(wostream& os, int depth) const
-{
- os << indent(depth) << L"TextGroup" << endl;
- mChild->Print(os, depth+1);
-}
-
-}
-
-void LatexFeatures::Update(const wstring& command)
-{
- static wstring gNeedsAmsmathArray[] =
- {
- L"\\text",
- L"\\binom",
- L"\\cfrac",
- L"\\begin{matrix}",
- L"\\begin{pmatrix}",
- L"\\begin{bmatrix}",
- L"\\begin{Bmatrix}",
- L"\\begin{vmatrix}",
- L"\\begin{Vmatrix}",
- L"\\begin{cases}",
- L"\\begin{aligned}",
- L"\\begin{smallmatrix}",
- L"\\overleftrightarrow",
- L"\\boldsymbol",
- L"\\And",
- L"\\iint",
- L"\\iiint",
- L"\\iiiint",
- L"\\varlimsup",
- L"\\varliminf",
- L"\\varinjlim",
- L"\\varprojlim",
- L"\\injlim",
- L"\\projlim",
- L"\\dotsb",
- L"\\operatorname",
- L"\\operatornamewithlimits",
- L"\\lvert",
- L"\\rvert",
- L"\\lVert",
- L"\\rVert",
- L"\\substack",
- L"\\overset",
- L"\\underset",
- L"\\mod",
-
- // The following commands are all defined in regular latex, but
- // amsmath redefines them to have slightly different properties:
- //
- // * The text commands are modified so that the font size does not
- // change if they are used inside a formula.
- // * The "\dots" command adjusts the height of the dots depending
- // on the surrounding symbols.
- // * The "\colon" command gets some spacing adjustments.
- //
- // Therefore for consistency we include amsmath when these commands
- // appear.
- //
- // (FIX: there are probably others that need to be here that I
- // haven't put here yet.)
- L"\\emph",
- L"\\textit",
- L"\\textbf",
- L"\\textrm",
- L"\\texttt",
- L"\\textsf",
- L"\\dots",
- L"\\dotsb",
- L"\\colon"
- };
-
- static wishful_hash_set<wstring> gNeedsAmsmathTable(
- gNeedsAmsmathArray,
- END_ARRAY(gNeedsAmsmathArray)
- );
-
-
- static wstring gNeedsAmssymbArray[] =
- {
- L"\\varkappa",
- L"\\digamma",
- L"\\beth",
- L"\\gimel",
- L"\\daleth",
- L"\\Finv",
- L"\\Game",
- L"\\upharpoonright",
- L"\\upharpoonleft",
- L"\\downharpoonright",
- L"\\downharpoonleft",
- L"\\nleftarrow",
- L"\\nrightarrow",
- L"\\sqsupset",
- L"\\sqsubset",
- L"\\supsetneq",
- L"\\subsetneq",
- L"\\Vdash",
- L"\\vDash",
- L"\\lesssim",
- L"\\nless",
- L"\\ngeq",
- L"\\nleq",
- L"\\smallsmile",
- L"\\smallfrown",
- L"\\smallsetminus",
- L"\\varnothing",
- L"\\nmid",
- L"\\square",
- L"\\Box",
- L"\\checkmark",
- L"\\complement",
- L"\\eth",
- L"\\hslash",
- L"\\mho",
- L"\\circledR",
- L"\\yen",
- L"\\maltese",
- L"\\ulcorner",
- L"\\urcorner",
- L"\\llcorner",
- L"\\lrcorner",
- L"\\dashrightarrow",
- L"\\dasharrow",
- L"\\dashleftarrow",
- L"\\backprime",
- L"\\vartriangle",
- L"\\blacktriangle",
- L"\\triangledown",
- L"\\blacktriangledown",
- L"\\blacksquare",
- L"\\lozenge",
- L"\\blacklozenge",
- L"\\circledS",
- L"\\bigstar",
- L"\\sphericalangle",
- L"\\measuredangle",
- L"\\diagup",
- L"\\diagdown",
- L"\\Bbbk",
- L"\\dotplus",
- L"\\ltimes",
- L"\\rtimes",
- L"\\Cap",
- L"\\leftthreetimes",
- L"\\rightthreetimes",
- L"\\Cup",
- L"\\barwedge",
- L"\\curlywedge",
- L"\\veebar",
- L"\\curlyvee",
- L"\\doublebarwedge",
- L"\\boxminus",
- L"\\circleddash",
- L"\\boxtimes",
- L"\\circledast",
- L"\\boxdot",
- L"\\circledcirc",
- L"\\boxplus",
- L"\\centerdot",
- L"\\divideontimes",
- L"\\intercal",
- L"\\leqq",
- L"\\geqq",
- L"\\leqslant",
- L"\\geqslant",
- L"\\eqslantless",
- L"\\eqslantgtr",
- L"\\gtrsim",
- L"\\lessapprox",
- L"\\gtrapprox",
- L"\\approxeq",
- L"\\eqsim",
- L"\\lessdot",
- L"\\gtrdot",
- L"\\lll",
- L"\\ggg",
- L"\\lessgtr",
- L"\\gtrless",
- L"\\lesseqgtr",
- L"\\gtreqless",
- L"\\lesseqqgtr",
- L"\\gtreqqless",
- L"\\doteqdot",
- L"\\eqcirc",
- L"\\risingdotseq",
- L"\\circeq",
- L"\\fallingdotseq",
- L"\\triangleq",
- L"\\backsim",
- L"\\thicksim",
- L"\\backsimeq",
- L"\\thickapprox",
- L"\\subseteqq",
- L"\\supseteqq",
- L"\\Subset",
- L"\\Supset",
- L"\\preccurlyeq",
- L"\\succcurlyeq",
- L"\\curlyeqprec",
- L"\\curlyeqsucc",
- L"\\precsim",
- L"\\succsim",
- L"\\precapprox",
- L"\\succapprox",
- L"\\vartriangleleft",
- L"\\vartriangleright",
- L"\\Vvdash",
- L"\\shortmid",
- L"\\shortparallel",
- L"\\bumpeq",
- L"\\between",
- L"\\Bumpeq",
- L"\\varpropto",
- L"\\backepsilon",
- L"\\blacktriangleleft",
- L"\\blacktriangleright",
- L"\\therefore",
- L"\\because",
- L"\\ngtr",
- L"\\nleqslant",
- L"\\ngeqslant",
- L"\\nleqq",
- L"\\ngeqq",
- L"\\lneqq",
- L"\\gneqq",
- L"\\lvertneqq",
- L"\\gvertneqq",
- L"\\lnsim",
- L"\\gnsim",
- L"\\lnapprox",
- L"\\gnapprox",
- L"\\nprec",
- L"\\nsucc",
- L"\\npreceq",
- L"\\nsucceq",
- L"\\precneqq",
- L"\\succneqq",
- L"\\precnsim",
- L"\\succnsim",
- L"\\precnapprox",
- L"\\succnapprox",
- L"\\nsim",
- L"\\ncong",
- L"\\nshortmid",
- L"\\nshortparallel",
- L"\\nmid",
- L"\\nparallel",
- L"\\nvdash",
- L"\\nvDash",
- L"\\nVdash",
- L"\\nVDash",
- L"\\ntriangleleft",
- L"\\ntriangleright",
- L"\\ntrianglelefteq",
- L"\\ntrianglerighteq",
- L"\\nsubseteq",
- L"\\nsupseteq",
- L"\\nsubseteqq",
- L"\\nsupseteqq",
- L"\\subsetneq",
- L"\\supsetneq",
- L"\\varsubsetneq",
- L"\\varsupsetneq",
- L"\\subsetneqq",
- L"\\supsetneqq",
- L"\\varsubsetneqq",
- L"\\varsupsetneqq",
- L"\\leftleftarrows",
- L"\\rightrightarrows",
- L"\\leftrightarrows",
- L"\\rightleftarrows",
- L"\\Lleftarrow",
- L"\\Rrightarrow",
- L"\\twoheadleftarrow",
- L"\\twoheadrightarrow",
- L"\\leftarrowtail",
- L"\\rightarrowtail",
- L"\\looparrowleft",
- L"\\looparrowright",
- L"\\leftrightharpoons",
- L"\\rightleftharpoons",
- L"\\curvearrowleft",
- L"\\curvearrowright",
- L"\\circlearrowleft",
- L"\\circlearrowright",
- L"\\Lsh",
- L"\\Rsh",
- L"\\upuparrows",
- L"\\downdownarrows",
- L"\\multimap",
- L"\\rightsquigarrow",
- L"\\leftrightsquigarrow",
- L"\\nLeftarrow",
- L"\\nRightarrow",
- L"\\nleftrightarrow",
- L"\\nLeftrightarrow",
- L"\\pitchfork",
- L"\\nexists",
- L"\\lhd",
- L"\\rhd",
- L"\\unlhd",
- L"\\unrhd",
- L"\\Join",
- L"\\leadsto"
- };
-
- static wishful_hash_set<wstring> gNeedsAmssymbTable(
- gNeedsAmssymbArray,
- END_ARRAY(gNeedsAmssymbArray)
- );
-
- // Note: there might be other commands which imply loading packages
- // which are handled elsewhere (e.g. \color)
-
- if (command[0] == L'\\')
- {
- if (command == L"\\cyr")
- mNeedsX2 = mNeedsUcs = true;
- if (command == L"\\jap")
- mNeedsCJK = mNeedsJapaneseFont = true;
-
- if (!mNeedsAmsfonts &&
- (command == L"\\mathbb" || command == L"\\mathfrak")
- )
- mNeedsAmsfonts = true;
-
- if (!mNeedsAmsmath && gNeedsAmsmathTable.count(command))
- mNeedsAmsmath = true;
-
- if (!mNeedsAmssymb && gNeedsAmssymbTable.count(command))
- mNeedsAmssymb = true;
- }
-}
-
-
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/Parser.cpp b/blahtexml/source/BlahtexCore/Parser.cpp
deleted file mode 100644
index 0458235..0000000
--- a/blahtexml/source/BlahtexCore/Parser.cpp
+++ /dev/null
@@ -1,1643 +0,0 @@
-// File "Parser.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <stdexcept>
-#include "InputSymbolTranslation.h"
-#include "Parser.h"
-
-using namespace std;
-
-namespace blahtex {
-
-// Imported from ParseTree1.cpp:
-extern wishful_hash_map<wstring, wstring> gDelimiterTable;
-extern wishful_hash_map<wstring, RGBColour> gColourTable;
-
-// These tables contain all the commands that blahtex recognises in math
-// mode (respectively text mode). They provide the token codes for the
-// parser to do its job.
-
-pair<wstring, Parser::TokenCode> gMathTokenArray[] =
-{
- make_pair(L"", Parser::cEndOfInput),
- make_pair(L" ", Parser::cWhitespace),
- make_pair(L"\\newcommand", Parser::cNewcommand),
-
- make_pair(L"$", Parser::cIllegal),
- make_pair(L"%", Parser::cIllegal),
- make_pair(L"#", Parser::cIllegal),
- make_pair(L"`", Parser::cIllegal),
- make_pair(L"\"", Parser::cIllegal),
-
- make_pair(L"{", Parser::cBeginGroup),
- make_pair(L"}", Parser::cEndGroup),
-
- make_pair(L"&", Parser::cNextCell),
- make_pair(L"\\\\", Parser::cNextRow),
-
- make_pair(L"^", Parser::cSuperscript),
- make_pair(L"_", Parser::cSubscript),
- make_pair(L"'", Parser::cPrime),
-
- make_pair(L"\\hbox", Parser::cEnterTextMode),
- make_pair(L"\\mbox", Parser::cEnterTextMode),
- make_pair(L"\\emph", Parser::cEnterTextMode),
- make_pair(L"\\text", Parser::cEnterTextMode),
- make_pair(L"\\textit", Parser::cEnterTextMode),
- make_pair(L"\\textbf", Parser::cEnterTextMode),
- make_pair(L"\\textrm", Parser::cEnterTextMode),
- make_pair(L"\\texttt", Parser::cEnterTextMode),
- make_pair(L"\\textsf", Parser::cEnterTextMode),
-
- make_pair(L"\\cyr", Parser::cEnterTextMode),
- make_pair(L"\\jap", Parser::cEnterTextMode),
-
- make_pair(L"\\sqrt", Parser::cCommand1Arg),
- make_pair(L"\\pmod", Parser::cCommand1Arg),
- make_pair(L"\\operatorname", Parser::cCommand1Arg),
- make_pair(L"\\operatornamewithlimits", Parser::cCommand1Arg),
-
- // "\rootReserved" is the *only* "Reserved" command the parser
- // has to worry about.
- make_pair(L"\\rootReserved", Parser::cCommand2Args),
-
- make_pair(L"\\binom", Parser::cCommand2Args),
- make_pair(L"\\frac", Parser::cCommand2Args),
- make_pair(L"\\cfrac", Parser::cCommand2Args),
- make_pair(L"\\overset", Parser::cCommand2Args),
- make_pair(L"\\underset", Parser::cCommand2Args),
-
- make_pair(L"\\over", Parser::cCommandInfix),
- make_pair(L"\\choose", Parser::cCommandInfix),
- make_pair(L"\\atop", Parser::cCommandInfix),
-
- make_pair(L"\\left", Parser::cLeft),
- make_pair(L"\\right", Parser::cRight),
-
- make_pair(L"\\big", Parser::cBig),
- make_pair(L"\\bigl", Parser::cBig),
- make_pair(L"\\bigr", Parser::cBig),
- make_pair(L"\\Big", Parser::cBig),
- make_pair(L"\\Bigl", Parser::cBig),
- make_pair(L"\\Bigr", Parser::cBig),
- make_pair(L"\\bigg", Parser::cBig),
- make_pair(L"\\biggl", Parser::cBig),
- make_pair(L"\\biggr", Parser::cBig),
- make_pair(L"\\Bigg", Parser::cBig),
- make_pair(L"\\Biggl", Parser::cBig),
- make_pair(L"\\Biggr", Parser::cBig),
-
- make_pair(L"\\mathop", Parser::cCommand1Arg),
- make_pair(L"\\mathrel", Parser::cCommand1Arg),
- make_pair(L"\\mathord", Parser::cCommand1Arg),
- make_pair(L"\\mathbin", Parser::cCommand1Arg),
- make_pair(L"\\mathopen", Parser::cCommand1Arg),
- make_pair(L"\\mathclose", Parser::cCommand1Arg),
- make_pair(L"\\mathpunct", Parser::cCommand1Arg),
- make_pair(L"\\mathinner", Parser::cCommand1Arg),
-
- make_pair(L"\\limits", Parser::cLimits),
- make_pair(L"\\nolimits", Parser::cLimits),
- make_pair(L"\\displaylimits", Parser::cLimits),
-
- make_pair(L"\\_", Parser::cSymbol),
- make_pair(L"\\&", Parser::cSymbol),
- make_pair(L"\\$", Parser::cSymbol),
- make_pair(L"\\#", Parser::cSymbol),
- make_pair(L"\\%", Parser::cSymbol),
- make_pair(L"\\{", Parser::cSymbol),
- make_pair(L"\\}", Parser::cSymbol),
-
- make_pair(L"\\mod", Parser::cSymbolUnsafe),
- make_pair(L"\\bmod", Parser::cSymbolUnsafe),
-
- make_pair(L"\\substack", Parser::cShortEnvironment),
-
- make_pair(L"\\begin{matrix}", Parser::cBeginEnvironment),
- make_pair(L"\\begin{pmatrix}", Parser::cBeginEnvironment),
- make_pair(L"\\begin{bmatrix}", Parser::cBeginEnvironment),
- make_pair(L"\\begin{Bmatrix}", Parser::cBeginEnvironment),
- make_pair(L"\\begin{vmatrix}", Parser::cBeginEnvironment),
- make_pair(L"\\begin{Vmatrix}", Parser::cBeginEnvironment),
- make_pair(L"\\begin{cases}", Parser::cBeginEnvironment),
- make_pair(L"\\begin{aligned}", Parser::cBeginEnvironment),
- make_pair(L"\\begin{smallmatrix}", Parser::cBeginEnvironment),
-
- make_pair(L"\\end{matrix}", Parser::cEndEnvironment),
- make_pair(L"\\end{pmatrix}", Parser::cEndEnvironment),
- make_pair(L"\\end{bmatrix}", Parser::cEndEnvironment),
- make_pair(L"\\end{Bmatrix}", Parser::cEndEnvironment),
- make_pair(L"\\end{vmatrix}", Parser::cEndEnvironment),
- make_pair(L"\\end{Vmatrix}", Parser::cEndEnvironment),
- make_pair(L"\\end{cases}", Parser::cEndEnvironment),
- make_pair(L"\\end{aligned}", Parser::cEndEnvironment),
- make_pair(L"\\end{smallmatrix}", Parser::cEndEnvironment),
-
- make_pair(L"~", Parser::cSymbolUnsafe),
- make_pair(L"\\,", Parser::cSymbolUnsafe),
- make_pair(L"\\!", Parser::cSymbolUnsafe),
- make_pair(L"\\ ", Parser::cSymbolUnsafe),
- make_pair(L"\\;", Parser::cSymbolUnsafe),
- make_pair(L"\\>", Parser::cSymbolUnsafe),
- make_pair(L"\\quad", Parser::cSymbolUnsafe),
- make_pair(L"\\qquad", Parser::cSymbolUnsafe),
-
- make_pair(L"\\not", Parser::cSymbol),
-
- make_pair(L"(", Parser::cSymbol),
- make_pair(L")", Parser::cSymbol),
- make_pair(L"[", Parser::cSymbol),
- make_pair(L"]", Parser::cSymbol),
- make_pair(L"<", Parser::cSymbol),
- make_pair(L">", Parser::cSymbol),
- make_pair(L"+", Parser::cSymbol),
- make_pair(L"-", Parser::cSymbol),
- make_pair(L"=", Parser::cSymbol),
- make_pair(L"|", Parser::cSymbol),
- make_pair(L";", Parser::cSymbol),
- make_pair(L":", Parser::cSymbol),
- make_pair(L",", Parser::cSymbol),
- make_pair(L".", Parser::cSymbol),
- make_pair(L"/", Parser::cSymbol),
- make_pair(L"?", Parser::cSymbol),
- make_pair(L"!", Parser::cSymbol),
- make_pair(L"@", Parser::cSymbol),
- make_pair(L"*", Parser::cSymbol),
-
- make_pair(L"\\vert", Parser::cSymbol),
- make_pair(L"\\lvert", Parser::cSymbol),
- make_pair(L"\\rvert", Parser::cSymbol),
- make_pair(L"\\Vert", Parser::cSymbol),
- make_pair(L"\\lVert", Parser::cSymbol),
- make_pair(L"\\rVert", Parser::cSymbol),
- make_pair(L"\\lfloor", Parser::cSymbol),
- make_pair(L"\\rfloor", Parser::cSymbol),
- make_pair(L"\\lceil", Parser::cSymbol),
- make_pair(L"\\rceil", Parser::cSymbol),
- make_pair(L"\\lbrace", Parser::cSymbol),
- make_pair(L"\\rbrace", Parser::cSymbol),
- make_pair(L"\\langle", Parser::cSymbol),
- make_pair(L"\\rangle", Parser::cSymbol),
- make_pair(L"\\lbrack", Parser::cSymbol),
- make_pair(L"\\rbrack", Parser::cSymbol),
-
- make_pair(L"\\hat", Parser::cCommand1Arg),
- make_pair(L"\\widehat", Parser::cCommand1Arg),
- make_pair(L"\\dot", Parser::cCommand1Arg),
- make_pair(L"\\ddot", Parser::cCommand1Arg),
- make_pair(L"\\bar", Parser::cCommand1Arg),
- make_pair(L"\\overline", Parser::cCommand1Arg),
- make_pair(L"\\underline", Parser::cCommand1Arg),
- make_pair(L"\\overbrace", Parser::cCommand1Arg),
- make_pair(L"\\underbrace", Parser::cCommand1Arg),
- make_pair(L"\\overleftarrow", Parser::cCommand1Arg),
- make_pair(L"\\overrightarrow", Parser::cCommand1Arg),
- make_pair(L"\\overleftrightarrow", Parser::cCommand1Arg),
- make_pair(L"\\check", Parser::cCommand1Arg),
- make_pair(L"\\acute", Parser::cCommand1Arg),
- make_pair(L"\\grave", Parser::cCommand1Arg),
- make_pair(L"\\vec", Parser::cCommand1Arg),
- make_pair(L"\\breve", Parser::cCommand1Arg),
- make_pair(L"\\tilde", Parser::cCommand1Arg),
- make_pair(L"\\widetilde", Parser::cCommand1Arg),
-
- make_pair(L"\\mathbf", Parser::cCommand1Arg),
- make_pair(L"\\mathbb", Parser::cCommand1Arg),
- make_pair(L"\\mathrm", Parser::cCommand1Arg),
- make_pair(L"\\mathit", Parser::cCommand1Arg),
- make_pair(L"\\mathcal", Parser::cCommand1Arg),
- make_pair(L"\\mathfrak", Parser::cCommand1Arg),
- make_pair(L"\\mathsf", Parser::cCommand1Arg),
- make_pair(L"\\mathtt", Parser::cCommand1Arg),
- make_pair(L"\\boldsymbol", Parser::cCommand1Arg),
-
- make_pair(L"\\rm", Parser::cStateChange),
- make_pair(L"\\bf", Parser::cStateChange),
- make_pair(L"\\it", Parser::cStateChange),
- make_pair(L"\\cal", Parser::cStateChange),
- make_pair(L"\\tt", Parser::cStateChange),
- make_pair(L"\\sf", Parser::cStateChange),
-
- make_pair(L"\\displaystyle", Parser::cStateChange),
- make_pair(L"\\textstyle", Parser::cStateChange),
- make_pair(L"\\scriptstyle", Parser::cStateChange),
- make_pair(L"\\scriptscriptstyle", Parser::cStateChange),
-
- make_pair(L"\\color", Parser::cStateChange),
-
- make_pair(L"\\varlimsup", Parser::cSymbolUnsafe),
- make_pair(L"\\varliminf", Parser::cSymbolUnsafe),
- make_pair(L"\\lim", Parser::cSymbolUnsafe),
- make_pair(L"\\sup", Parser::cSymbolUnsafe),
- make_pair(L"\\inf", Parser::cSymbolUnsafe),
- make_pair(L"\\limsup", Parser::cSymbolUnsafe),
- make_pair(L"\\liminf", Parser::cSymbolUnsafe),
- make_pair(L"\\injlim", Parser::cSymbolUnsafe),
- make_pair(L"\\projlim", Parser::cSymbolUnsafe),
- make_pair(L"\\min", Parser::cSymbolUnsafe),
- make_pair(L"\\max", Parser::cSymbolUnsafe),
- make_pair(L"\\gcd", Parser::cSymbolUnsafe),
- make_pair(L"\\det", Parser::cSymbolUnsafe),
- make_pair(L"\\Pr", Parser::cSymbolUnsafe),
-
- make_pair(L"\\ker", Parser::cSymbolUnsafe),
- make_pair(L"\\hom", Parser::cSymbolUnsafe),
- make_pair(L"\\dim", Parser::cSymbolUnsafe),
- make_pair(L"\\arg", Parser::cSymbolUnsafe),
- make_pair(L"\\sin", Parser::cSymbolUnsafe),
- make_pair(L"\\cos", Parser::cSymbolUnsafe),
- make_pair(L"\\sec", Parser::cSymbolUnsafe),
- make_pair(L"\\csc", Parser::cSymbolUnsafe),
- make_pair(L"\\tan", Parser::cSymbolUnsafe),
- make_pair(L"\\cot", Parser::cSymbolUnsafe),
- make_pair(L"\\arcsin", Parser::cSymbolUnsafe),
- make_pair(L"\\arccos", Parser::cSymbolUnsafe),
- make_pair(L"\\arctan", Parser::cSymbolUnsafe),
- make_pair(L"\\sinh", Parser::cSymbolUnsafe),
- make_pair(L"\\cosh", Parser::cSymbolUnsafe),
- make_pair(L"\\tanh", Parser::cSymbolUnsafe),
- make_pair(L"\\coth", Parser::cSymbolUnsafe),
- make_pair(L"\\log", Parser::cSymbolUnsafe),
- make_pair(L"\\lg", Parser::cSymbolUnsafe),
- make_pair(L"\\ln", Parser::cSymbolUnsafe),
- make_pair(L"\\exp", Parser::cSymbolUnsafe),
- make_pair(L"\\deg", Parser::cSymbolUnsafe),
-
- make_pair(L"\\alpha", Parser::cSymbol),
- make_pair(L"\\beta", Parser::cSymbol),
- make_pair(L"\\gamma", Parser::cSymbol),
- make_pair(L"\\delta", Parser::cSymbol),
- make_pair(L"\\epsilon", Parser::cSymbol),
- make_pair(L"\\varepsilon", Parser::cSymbol),
- make_pair(L"\\zeta", Parser::cSymbol),
- make_pair(L"\\eta", Parser::cSymbol),
- make_pair(L"\\theta", Parser::cSymbol),
- make_pair(L"\\vartheta", Parser::cSymbol),
- make_pair(L"\\iota", Parser::cSymbol),
- make_pair(L"\\kappa", Parser::cSymbol),
- make_pair(L"\\varkappa", Parser::cSymbol),
- make_pair(L"\\lambda", Parser::cSymbol),
- make_pair(L"\\mu", Parser::cSymbol),
- make_pair(L"\\nu", Parser::cSymbol),
- make_pair(L"\\pi", Parser::cSymbol),
- make_pair(L"\\varpi", Parser::cSymbol),
- make_pair(L"\\rho", Parser::cSymbol),
- make_pair(L"\\varrho", Parser::cSymbol),
- make_pair(L"\\sigma", Parser::cSymbol),
- make_pair(L"\\varsigma", Parser::cSymbol),
- make_pair(L"\\tau", Parser::cSymbol),
- make_pair(L"\\upsilon", Parser::cSymbol),
- make_pair(L"\\phi", Parser::cSymbol),
- make_pair(L"\\varphi", Parser::cSymbol),
- make_pair(L"\\chi", Parser::cSymbol),
- make_pair(L"\\psi", Parser::cSymbol),
- make_pair(L"\\omega", Parser::cSymbol),
- make_pair(L"\\xi", Parser::cSymbol),
- make_pair(L"\\digamma", Parser::cSymbol),
-
- make_pair(L"\\Gamma", Parser::cSymbol),
- make_pair(L"\\Delta", Parser::cSymbol),
- make_pair(L"\\Theta", Parser::cSymbol),
- make_pair(L"\\Lambda", Parser::cSymbol),
- make_pair(L"\\Pi", Parser::cSymbol),
- make_pair(L"\\Sigma", Parser::cSymbol),
- make_pair(L"\\Upsilon", Parser::cSymbol),
- make_pair(L"\\Phi", Parser::cSymbol),
- make_pair(L"\\Psi", Parser::cSymbol),
- make_pair(L"\\Omega", Parser::cSymbol),
- make_pair(L"\\Xi", Parser::cSymbol),
-
- make_pair(L"\\aleph", Parser::cSymbol),
- make_pair(L"\\beth", Parser::cSymbol),
- make_pair(L"\\gimel", Parser::cSymbol),
- make_pair(L"\\daleth", Parser::cSymbol),
-
- make_pair(L"\\wp", Parser::cSymbol),
- make_pair(L"\\ell", Parser::cSymbol),
- make_pair(L"\\P", Parser::cSymbol),
- make_pair(L"\\imath", Parser::cSymbol),
- make_pair(L"\\forall", Parser::cSymbol),
- make_pair(L"\\exists", Parser::cSymbol),
- make_pair(L"\\Finv", Parser::cSymbol),
- make_pair(L"\\Game", Parser::cSymbol),
- make_pair(L"\\partial", Parser::cSymbol),
- make_pair(L"\\Re", Parser::cSymbol),
- make_pair(L"\\Im", Parser::cSymbol),
-
- make_pair(L"\\leftarrow", Parser::cSymbol),
- make_pair(L"\\rightarrow", Parser::cSymbol),
- make_pair(L"\\longleftarrow", Parser::cSymbolUnsafe),
- make_pair(L"\\longrightarrow", Parser::cSymbolUnsafe),
- make_pair(L"\\Leftarrow", Parser::cSymbol),
- make_pair(L"\\Rightarrow", Parser::cSymbol),
- make_pair(L"\\Longleftarrow", Parser::cSymbolUnsafe),
- make_pair(L"\\Longrightarrow", Parser::cSymbolUnsafe),
- make_pair(L"\\mapsto", Parser::cSymbolUnsafe),
- make_pair(L"\\longmapsto", Parser::cSymbolUnsafe),
- make_pair(L"\\leftrightarrow", Parser::cSymbol),
- make_pair(L"\\Leftrightarrow", Parser::cSymbol),
- make_pair(L"\\longleftrightarrow", Parser::cSymbolUnsafe),
- make_pair(L"\\Longleftrightarrow", Parser::cSymbolUnsafe),
-
- make_pair(L"\\uparrow", Parser::cSymbol),
- make_pair(L"\\Uparrow", Parser::cSymbol),
- make_pair(L"\\downarrow", Parser::cSymbol),
- make_pair(L"\\Downarrow", Parser::cSymbol),
- make_pair(L"\\updownarrow", Parser::cSymbol),
- make_pair(L"\\Updownarrow", Parser::cSymbol),
-
- make_pair(L"\\searrow", Parser::cSymbol),
- make_pair(L"\\nearrow", Parser::cSymbol),
- make_pair(L"\\swarrow", Parser::cSymbol),
- make_pair(L"\\nwarrow", Parser::cSymbol),
-
- make_pair(L"\\hookrightarrow", Parser::cSymbolUnsafe),
- make_pair(L"\\hookleftarrow", Parser::cSymbolUnsafe),
- make_pair(L"\\upharpoonright", Parser::cSymbol),
- make_pair(L"\\upharpoonleft", Parser::cSymbol),
- make_pair(L"\\downharpoonright", Parser::cSymbol),
- make_pair(L"\\downharpoonleft", Parser::cSymbol),
- make_pair(L"\\rightharpoonup", Parser::cSymbol),
- make_pair(L"\\rightharpoondown", Parser::cSymbol),
- make_pair(L"\\leftharpoonup", Parser::cSymbol),
- make_pair(L"\\leftharpoondown", Parser::cSymbol),
-
- make_pair(L"\\nleftarrow", Parser::cSymbol),
- make_pair(L"\\nrightarrow", Parser::cSymbol),
-
- make_pair(L"\\supset", Parser::cSymbol),
- make_pair(L"\\subset", Parser::cSymbol),
- make_pair(L"\\supseteq", Parser::cSymbol),
- make_pair(L"\\subseteq", Parser::cSymbol),
- make_pair(L"\\sqsupset", Parser::cSymbol),
- make_pair(L"\\sqsubset", Parser::cSymbol),
- make_pair(L"\\sqsupseteq", Parser::cSymbol),
- make_pair(L"\\sqsubseteq", Parser::cSymbol),
- make_pair(L"\\supsetneq", Parser::cSymbol),
- make_pair(L"\\subsetneq", Parser::cSymbol),
-
- make_pair(L"\\in", Parser::cSymbol),
- make_pair(L"\\ni", Parser::cSymbol),
- make_pair(L"\\notin", Parser::cSymbolUnsafe),
-
- make_pair(L"\\iff", Parser::cSymbolUnsafe),
-
- make_pair(L"\\mid", Parser::cSymbol),
- make_pair(L"\\sim", Parser::cSymbol),
- make_pair(L"\\simeq", Parser::cSymbol),
- make_pair(L"\\approx", Parser::cSymbol),
- make_pair(L"\\propto", Parser::cSymbol),
- make_pair(L"\\equiv", Parser::cSymbol),
- make_pair(L"\\cong", Parser::cSymbolUnsafe),
- make_pair(L"\\neq", Parser::cSymbolUnsafe),
-
- make_pair(L"\\ll", Parser::cSymbol),
- make_pair(L"\\gg", Parser::cSymbol),
- make_pair(L"\\geq", Parser::cSymbol),
- make_pair(L"\\leq", Parser::cSymbol),
- make_pair(L"\\triangleleft", Parser::cSymbol),
- make_pair(L"\\triangleright", Parser::cSymbol),
-
- make_pair(L"\\models", Parser::cSymbolUnsafe),
- make_pair(L"\\vdash", Parser::cSymbol),
- make_pair(L"\\Vdash", Parser::cSymbol),
- make_pair(L"\\vDash", Parser::cSymbol),
-
- make_pair(L"\\lesssim", Parser::cSymbol),
- make_pair(L"\\nless", Parser::cSymbol),
- make_pair(L"\\ngeq", Parser::cSymbol),
- make_pair(L"\\nleq", Parser::cSymbol),
-
- make_pair(L"\\ast", Parser::cSymbol),
- make_pair(L"\\times", Parser::cSymbol),
- make_pair(L"\\div", Parser::cSymbol),
- make_pair(L"\\wedge", Parser::cSymbol),
- make_pair(L"\\vee", Parser::cSymbol),
- make_pair(L"\\oplus", Parser::cSymbol),
- make_pair(L"\\otimes", Parser::cSymbol),
- make_pair(L"\\cap", Parser::cSymbol),
- make_pair(L"\\cup", Parser::cSymbol),
- make_pair(L"\\sqcap", Parser::cSymbol),
- make_pair(L"\\sqcup", Parser::cSymbol),
- make_pair(L"\\smile", Parser::cSymbol),
- make_pair(L"\\frown", Parser::cSymbol),
- make_pair(L"\\smallsmile", Parser::cSymbol),
- make_pair(L"\\smallfrown", Parser::cSymbol),
-
- make_pair(L"\\setminus", Parser::cSymbol),
- make_pair(L"\\smallsetminus", Parser::cSymbol),
-
- make_pair(L"\\And", Parser::cSymbolUnsafe),
-
- // This next group of "large operators" are all "safe" in ordinary
- // TeX, but NOT when AMS-LaTeX is loaded, so we'll call them unsafe
- // (just to be safe :-)
-
- // FIX: we still don't size large operators correctly with style
- // changes. TeX only uses TWO sizes for its "large operators".
- // textstyle and below should all be the same size.
- // Although, amsmath does things differently: investigate that.
-
- make_pair(L"\\sum", Parser::cSymbolUnsafe),
- make_pair(L"\\prod", Parser::cSymbolUnsafe),
- make_pair(L"\\int", Parser::cSymbolUnsafe),
- make_pair(L"\\iint", Parser::cSymbolUnsafe),
- make_pair(L"\\iiint", Parser::cSymbolUnsafe),
- make_pair(L"\\iiiint", Parser::cSymbolUnsafe),
- make_pair(L"\\oint", Parser::cSymbolUnsafe),
- make_pair(L"\\bigcap", Parser::cSymbolUnsafe),
- make_pair(L"\\bigodot", Parser::cSymbolUnsafe),
- make_pair(L"\\bigcup", Parser::cSymbolUnsafe),
- make_pair(L"\\bigotimes", Parser::cSymbolUnsafe),
- make_pair(L"\\coprod", Parser::cSymbolUnsafe),
- make_pair(L"\\bigsqcup", Parser::cSymbolUnsafe),
- make_pair(L"\\bigoplus", Parser::cSymbolUnsafe),
- make_pair(L"\\bigvee", Parser::cSymbolUnsafe),
- make_pair(L"\\biguplus", Parser::cSymbolUnsafe),
- make_pair(L"\\bigwedge", Parser::cSymbolUnsafe),
-
- make_pair(L"\\star", Parser::cSymbol),
- make_pair(L"\\triangle", Parser::cSymbol),
- make_pair(L"\\wr", Parser::cSymbol),
- make_pair(L"\\infty", Parser::cSymbol),
- make_pair(L"\\circ", Parser::cSymbol),
- make_pair(L"\\hbar", Parser::cSymbol),
- make_pair(L"\\lnot", Parser::cSymbol),
- make_pair(L"\\nabla", Parser::cSymbol),
- make_pair(L"\\prime", Parser::cSymbol),
- make_pair(L"\\backslash", Parser::cSymbol),
- make_pair(L"\\pm", Parser::cSymbol),
- make_pair(L"\\mp", Parser::cSymbol),
- make_pair(L"\\emptyset", Parser::cSymbol),
- make_pair(L"\\varnothing", Parser::cSymbol),
- make_pair(L"\\S", Parser::cSymbol),
- make_pair(L"\\angle", Parser::cSymbol),
- make_pair(L"\\colon", Parser::cSymbolUnsafe),
- make_pair(L"\\nmid", Parser::cSymbol),
- make_pair(L"\\square", Parser::cSymbol),
- make_pair(L"\\Box", Parser::cSymbol),
- make_pair(L"\\checkmark", Parser::cSymbol),
- make_pair(L"\\complement", Parser::cSymbol),
- make_pair(L"\\eth", Parser::cSymbol),
- make_pair(L"\\hslash", Parser::cSymbol),
- make_pair(L"\\mho", Parser::cSymbol),
-
- make_pair(L"\\flat", Parser::cSymbol),
- make_pair(L"\\sharp", Parser::cSymbol),
- make_pair(L"\\natural", Parser::cSymbol),
- make_pair(L"\\bullet", Parser::cSymbol),
- make_pair(L"\\dagger", Parser::cSymbol),
- make_pair(L"\\ddagger", Parser::cSymbol),
-
- make_pair(L"\\clubsuit", Parser::cSymbol),
- make_pair(L"\\spadesuit", Parser::cSymbol),
- make_pair(L"\\heartsuit", Parser::cSymbol),
- make_pair(L"\\diamondsuit", Parser::cSymbol),
-
- make_pair(L"\\top", Parser::cSymbol),
- make_pair(L"\\bot", Parser::cSymbol),
- make_pair(L"\\perp", Parser::cSymbol),
-
- make_pair(L"\\ldots", Parser::cSymbolUnsafe),
- make_pair(L"\\cdot", Parser::cSymbol),
- make_pair(L"\\cdots", Parser::cSymbolUnsafe),
- make_pair(L"\\vdots", Parser::cSymbolUnsafe),
- make_pair(L"\\ddots", Parser::cSymbolUnsafe),
-
- // AMSLaTeX is pretty clever with "\dots" and "\dotsb"; it adjusts the
- // height of the dots based on the surrounding symbols. Blahtex
- // currently doesn't do this.
- make_pair(L"\\dots", Parser::cSymbolUnsafe),
- make_pair(L"\\dotsb", Parser::cSymbolUnsafe),
-
- make_pair(L"\\varinjlim", Parser::cSymbolUnsafe),
- make_pair(L"\\varprojlim", Parser::cSymbolUnsafe),
-
- make_pair(L"\\circledR", Parser::cSymbol),
- make_pair(L"\\yen", Parser::cSymbol),
- make_pair(L"\\maltese", Parser::cSymbol),
- make_pair(L"\\ulcorner", Parser::cSymbol),
- make_pair(L"\\urcorner", Parser::cSymbol),
- make_pair(L"\\llcorner", Parser::cSymbol),
- make_pair(L"\\lrcorner", Parser::cSymbol),
- make_pair(L"\\dashrightarrow", Parser::cSymbolUnsafe),
- make_pair(L"\\dashleftarrow", Parser::cSymbolUnsafe),
- make_pair(L"\\backprime", Parser::cSymbol),
- make_pair(L"\\vartriangle", Parser::cSymbol),
- make_pair(L"\\blacktriangle", Parser::cSymbol),
- make_pair(L"\\triangledown", Parser::cSymbol),
- make_pair(L"\\blacktriangledown", Parser::cSymbol),
- make_pair(L"\\blacksquare", Parser::cSymbol),
- make_pair(L"\\lozenge", Parser::cSymbol),
- make_pair(L"\\blacklozenge", Parser::cSymbol),
- make_pair(L"\\circledS", Parser::cSymbol),
- make_pair(L"\\bigstar", Parser::cSymbol),
- make_pair(L"\\sphericalangle", Parser::cSymbol),
- make_pair(L"\\measuredangle", Parser::cSymbol),
- make_pair(L"\\Bbbk", Parser::cSymbol),
- make_pair(L"\\dotplus", Parser::cSymbol),
- make_pair(L"\\ltimes", Parser::cSymbol),
- make_pair(L"\\rtimes", Parser::cSymbol),
- make_pair(L"\\Cap", Parser::cSymbol),
- make_pair(L"\\leftthreetimes", Parser::cSymbol),
- make_pair(L"\\rightthreetimes", Parser::cSymbol),
- make_pair(L"\\Cup", Parser::cSymbol),
- make_pair(L"\\barwedge", Parser::cSymbol),
- make_pair(L"\\curlywedge", Parser::cSymbol),
- make_pair(L"\\veebar", Parser::cSymbol),
- make_pair(L"\\curlyvee", Parser::cSymbol),
- make_pair(L"\\doublebarwedge", Parser::cSymbol),
- make_pair(L"\\boxminus", Parser::cSymbol),
- make_pair(L"\\circleddash", Parser::cSymbol),
- make_pair(L"\\boxtimes", Parser::cSymbol),
- make_pair(L"\\circledast", Parser::cSymbol),
- make_pair(L"\\boxdot", Parser::cSymbol),
- make_pair(L"\\circledcirc", Parser::cSymbol),
- make_pair(L"\\boxplus", Parser::cSymbol),
- make_pair(L"\\centerdot", Parser::cSymbol),
- make_pair(L"\\divideontimes", Parser::cSymbol),
- make_pair(L"\\intercal", Parser::cSymbol),
- make_pair(L"\\leqq", Parser::cSymbol),
- make_pair(L"\\geqq", Parser::cSymbol),
- make_pair(L"\\leqslant", Parser::cSymbol),
- make_pair(L"\\geqslant", Parser::cSymbol),
- make_pair(L"\\eqslantless", Parser::cSymbol),
- make_pair(L"\\eqslantgtr", Parser::cSymbol),
- make_pair(L"\\gtrsim", Parser::cSymbol),
- make_pair(L"\\lessapprox", Parser::cSymbol),
- make_pair(L"\\gtrapprox", Parser::cSymbol),
- make_pair(L"\\approxeq", Parser::cSymbol),
- make_pair(L"\\eqsim", Parser::cSymbol),
- make_pair(L"\\lessdot", Parser::cSymbol),
- make_pair(L"\\gtrdot", Parser::cSymbol),
- make_pair(L"\\lll", Parser::cSymbol),
- make_pair(L"\\ggg", Parser::cSymbol),
- make_pair(L"\\lessgtr", Parser::cSymbol),
- make_pair(L"\\gtrless", Parser::cSymbol),
- make_pair(L"\\lesseqgtr", Parser::cSymbol),
- make_pair(L"\\gtreqless", Parser::cSymbol),
- make_pair(L"\\lesseqqgtr", Parser::cSymbol),
- make_pair(L"\\gtreqqless", Parser::cSymbol),
- make_pair(L"\\doteqdot", Parser::cSymbol),
- make_pair(L"\\eqcirc", Parser::cSymbol),
- make_pair(L"\\risingdotseq", Parser::cSymbol),
- make_pair(L"\\circeq", Parser::cSymbol),
- make_pair(L"\\fallingdotseq", Parser::cSymbol),
- make_pair(L"\\triangleq", Parser::cSymbol),
- make_pair(L"\\backsim", Parser::cSymbol),
- make_pair(L"\\thicksim", Parser::cSymbol),
- make_pair(L"\\backsimeq", Parser::cSymbol),
- make_pair(L"\\thickapprox", Parser::cSymbol),
- make_pair(L"\\subseteqq", Parser::cSymbol),
- make_pair(L"\\supseteqq", Parser::cSymbol),
- make_pair(L"\\Subset", Parser::cSymbol),
- make_pair(L"\\Supset", Parser::cSymbol),
- make_pair(L"\\preccurlyeq", Parser::cSymbol),
- make_pair(L"\\succcurlyeq", Parser::cSymbol),
- make_pair(L"\\curlyeqprec", Parser::cSymbol),
- make_pair(L"\\curlyeqsucc", Parser::cSymbol),
- make_pair(L"\\precsim", Parser::cSymbol),
- make_pair(L"\\succsim", Parser::cSymbol),
- make_pair(L"\\precapprox", Parser::cSymbol),
- make_pair(L"\\succapprox", Parser::cSymbol),
- make_pair(L"\\Vvdash", Parser::cSymbol),
- make_pair(L"\\shortmid", Parser::cSymbol),
- make_pair(L"\\shortparallel", Parser::cSymbol),
- make_pair(L"\\bumpeq", Parser::cSymbol),
- make_pair(L"\\between", Parser::cSymbol),
- make_pair(L"\\Bumpeq", Parser::cSymbol),
- make_pair(L"\\varpropto", Parser::cSymbol),
- make_pair(L"\\backepsilon", Parser::cSymbol),
- make_pair(L"\\blacktriangleleft", Parser::cSymbol),
- make_pair(L"\\blacktriangleright", Parser::cSymbol),
- make_pair(L"\\therefore", Parser::cSymbol),
- make_pair(L"\\because", Parser::cSymbol),
- make_pair(L"\\ngtr", Parser::cSymbol),
- make_pair(L"\\nleqslant", Parser::cSymbol),
- make_pair(L"\\ngeqslant", Parser::cSymbol),
- make_pair(L"\\nleqq", Parser::cSymbol),
- make_pair(L"\\ngeqq", Parser::cSymbol),
- make_pair(L"\\lneqq", Parser::cSymbol),
- make_pair(L"\\gneqq", Parser::cSymbol),
- make_pair(L"\\lvertneqq", Parser::cSymbol),
- make_pair(L"\\gvertneqq", Parser::cSymbol),
- make_pair(L"\\lnsim", Parser::cSymbol),
- make_pair(L"\\gnsim", Parser::cSymbol),
- make_pair(L"\\lnapprox", Parser::cSymbol),
- make_pair(L"\\gnapprox", Parser::cSymbol),
- make_pair(L"\\nprec", Parser::cSymbol),
- make_pair(L"\\nsucc", Parser::cSymbol),
- make_pair(L"\\npreceq", Parser::cSymbol),
- make_pair(L"\\nsucceq", Parser::cSymbol),
- make_pair(L"\\precneqq", Parser::cSymbol),
- make_pair(L"\\succneqq", Parser::cSymbol),
- make_pair(L"\\precnsim", Parser::cSymbol),
- make_pair(L"\\succnsim", Parser::cSymbol),
- make_pair(L"\\precnapprox", Parser::cSymbol),
- make_pair(L"\\succnapprox", Parser::cSymbol),
- make_pair(L"\\nsim", Parser::cSymbol),
- make_pair(L"\\ncong", Parser::cSymbol),
- make_pair(L"\\nshortmid", Parser::cSymbol),
- make_pair(L"\\nshortparallel", Parser::cSymbol),
- make_pair(L"\\nmid", Parser::cSymbol),
- make_pair(L"\\nparallel", Parser::cSymbol),
- make_pair(L"\\nvdash", Parser::cSymbol),
- make_pair(L"\\nvDash", Parser::cSymbol),
- make_pair(L"\\nVdash", Parser::cSymbol),
- make_pair(L"\\nVDash", Parser::cSymbol),
- make_pair(L"\\ntriangleleft", Parser::cSymbol),
- make_pair(L"\\ntriangleright", Parser::cSymbol),
- make_pair(L"\\ntrianglelefteq", Parser::cSymbol),
- make_pair(L"\\ntrianglerighteq", Parser::cSymbol),
- make_pair(L"\\nsubseteq", Parser::cSymbol),
- make_pair(L"\\nsupseteq", Parser::cSymbol),
- make_pair(L"\\nsubseteqq", Parser::cSymbol),
- make_pair(L"\\nsupseteqq", Parser::cSymbol),
- make_pair(L"\\subsetneq", Parser::cSymbol),
- make_pair(L"\\supsetneq", Parser::cSymbol),
- make_pair(L"\\varsubsetneq", Parser::cSymbol),
- make_pair(L"\\varsupsetneq", Parser::cSymbol),
- make_pair(L"\\subsetneqq", Parser::cSymbol),
- make_pair(L"\\supsetneqq", Parser::cSymbol),
- make_pair(L"\\varsubsetneqq", Parser::cSymbol),
- make_pair(L"\\varsupsetneqq", Parser::cSymbol),
- make_pair(L"\\leftleftarrows", Parser::cSymbol),
- make_pair(L"\\rightrightarrows", Parser::cSymbol),
- make_pair(L"\\leftrightarrows", Parser::cSymbol),
- make_pair(L"\\rightleftarrows", Parser::cSymbol),
- make_pair(L"\\Lleftarrow", Parser::cSymbol),
- make_pair(L"\\Rrightarrow", Parser::cSymbol),
- make_pair(L"\\twoheadleftarrow", Parser::cSymbol),
- make_pair(L"\\twoheadrightarrow", Parser::cSymbol),
- make_pair(L"\\leftarrowtail", Parser::cSymbol),
- make_pair(L"\\rightarrowtail", Parser::cSymbol),
- make_pair(L"\\looparrowleft", Parser::cSymbol),
- make_pair(L"\\looparrowright", Parser::cSymbol),
- make_pair(L"\\leftrightharpoons", Parser::cSymbol),
- make_pair(L"\\rightleftharpoons", Parser::cSymbol),
- make_pair(L"\\curvearrowleft", Parser::cSymbol),
- make_pair(L"\\curvearrowright", Parser::cSymbol),
- make_pair(L"\\circlearrowleft", Parser::cSymbol),
- make_pair(L"\\circlearrowright", Parser::cSymbol),
- make_pair(L"\\Lsh", Parser::cSymbol),
- make_pair(L"\\Rsh", Parser::cSymbol),
- make_pair(L"\\upuparrows", Parser::cSymbol),
- make_pair(L"\\downdownarrows", Parser::cSymbol),
- make_pair(L"\\multimap", Parser::cSymbol),
- make_pair(L"\\rightsquigarrow", Parser::cSymbol),
- make_pair(L"\\leftrightsquigarrow", Parser::cSymbol),
- make_pair(L"\\nLeftarrow", Parser::cSymbol),
- make_pair(L"\\nRightarrow", Parser::cSymbol),
- make_pair(L"\\nleftrightarrow", Parser::cSymbol),
- make_pair(L"\\nLeftrightarrow", Parser::cSymbol),
- make_pair(L"\\pitchfork", Parser::cSymbol),
- make_pair(L"\\nexists", Parser::cSymbol),
- make_pair(L"\\lhd", Parser::cSymbol),
- make_pair(L"\\rhd", Parser::cSymbol),
- make_pair(L"\\unlhd", Parser::cSymbol),
- make_pair(L"\\unrhd", Parser::cSymbol),
- make_pair(L"\\leadsto", Parser::cSymbol),
- make_pair(L"\\uplus", Parser::cSymbol),
- make_pair(L"\\diamond", Parser::cSymbol),
- make_pair(L"\\bigtriangleup", Parser::cSymbol),
- make_pair(L"\\bigtriangledown", Parser::cSymbol),
- make_pair(L"\\ominus", Parser::cSymbol),
- make_pair(L"\\oslash", Parser::cSymbol),
- make_pair(L"\\odot", Parser::cSymbol),
- make_pair(L"\\bigcirc", Parser::cSymbol),
- make_pair(L"\\amalg", Parser::cSymbol),
- make_pair(L"\\prec", Parser::cSymbol),
- make_pair(L"\\succ", Parser::cSymbol),
- make_pair(L"\\preceq", Parser::cSymbol),
- make_pair(L"\\succeq", Parser::cSymbol),
- make_pair(L"\\dashv", Parser::cSymbol),
- make_pair(L"\\asymp", Parser::cSymbol),
- make_pair(L"\\doteq", Parser::cSymbolUnsafe),
- make_pair(L"\\parallel", Parser::cSymbol),
- make_pair(L"\\bowtie", Parser::cSymbolUnsafe),
- make_pair(L"\\jmath", Parser::cSymbol),
- make_pair(L"\\surd", Parser::cSymbol)
-};
-
-wishful_hash_map<wstring, Parser::TokenCode> gMathTokenTable(
- gMathTokenArray,
- END_ARRAY(gMathTokenArray)
-);
-
-pair<wstring, Parser::TokenCode> gTextTokenArray[] =
-{
- make_pair(L"", Parser::cEndOfInput),
- make_pair(L" ", Parser::cWhitespace),
- make_pair(L"\\newcommand", Parser::cNewcommand),
-
- make_pair(L"{", Parser::cBeginGroup),
- make_pair(L"}", Parser::cEndGroup),
-
- make_pair(L"$", Parser::cIllegal),
- make_pair(L"%", Parser::cIllegal),
- make_pair(L"#", Parser::cIllegal),
- make_pair(L"&", Parser::cIllegal),
- make_pair(L"\\\\", Parser::cIllegal),
- make_pair(L"^", Parser::cIllegal),
- make_pair(L"_", Parser::cIllegal),
-
- make_pair(L"\\&", Parser::cSymbol),
- make_pair(L"\\_", Parser::cSymbol),
- make_pair(L"\\$", Parser::cSymbol),
- make_pair(L"\\#", Parser::cSymbol),
- make_pair(L"\\%", Parser::cSymbol),
- make_pair(L"\\{", Parser::cSymbol),
- make_pair(L"\\}", Parser::cSymbol),
- make_pair(L"\\textbackslash", Parser::cSymbol),
- make_pair(L"\\textvisiblespace", Parser::cSymbol),
- make_pair(L"\\textasciicircum", Parser::cSymbol),
- make_pair(L"\\textasciitilde", Parser::cSymbol),
- make_pair(L"\\O", Parser::cSymbol),
- make_pair(L"\\S", Parser::cSymbol),
-
- make_pair(L"!", Parser::cSymbol),
- make_pair(L"@", Parser::cSymbol),
- make_pair(L"*", Parser::cSymbol),
- make_pair(L"(", Parser::cSymbol),
- make_pair(L")", Parser::cSymbol),
- make_pair(L"-", Parser::cSymbol),
- make_pair(L"=", Parser::cSymbol),
- make_pair(L"+", Parser::cSymbol),
- make_pair(L"[", Parser::cSymbol),
- make_pair(L"]", Parser::cSymbol),
- make_pair(L"|", Parser::cSymbol),
- make_pair(L";", Parser::cSymbol),
- make_pair(L":", Parser::cSymbol),
- make_pair(L"<", Parser::cSymbol),
- make_pair(L">", Parser::cSymbol),
- make_pair(L",", Parser::cSymbol),
- make_pair(L".", Parser::cSymbol),
- make_pair(L"/", Parser::cSymbol),
- make_pair(L"?", Parser::cSymbol),
- make_pair(L"\"", Parser::cSymbol),
- make_pair(L"\'", Parser::cSymbol),
-
- make_pair(L"~", Parser::cSymbolUnsafe),
- make_pair(L"\\,", Parser::cSymbolUnsafe),
- make_pair(L"\\!", Parser::cSymbolUnsafe),
- make_pair(L"\\ ", Parser::cSymbolUnsafe),
- make_pair(L"\\;", Parser::cSymbolUnsafe),
- make_pair(L"\\quad", Parser::cSymbolUnsafe),
- make_pair(L"\\qquad", Parser::cSymbolUnsafe),
-
- make_pair(L"\\hbox", Parser::cCommand1Arg),
- make_pair(L"\\mbox", Parser::cCommand1Arg),
- make_pair(L"\\emph", Parser::cCommand1Arg),
- make_pair(L"\\text", Parser::cCommand1Arg),
- make_pair(L"\\textit", Parser::cCommand1Arg),
- make_pair(L"\\textbf", Parser::cCommand1Arg),
- make_pair(L"\\textrm", Parser::cCommand1Arg),
- make_pair(L"\\texttt", Parser::cCommand1Arg),
- make_pair(L"\\textsf", Parser::cCommand1Arg),
-
- make_pair(L"\\cyr", Parser::cCommand1Arg),
- make_pair(L"\\jap", Parser::cCommand1Arg),
-
- make_pair(L"\\rm", Parser::cStateChange),
- make_pair(L"\\it", Parser::cStateChange),
- make_pair(L"\\bf", Parser::cStateChange),
- make_pair(L"\\tt", Parser::cStateChange),
- make_pair(L"\\sf", Parser::cStateChange),
-
- make_pair(L"\\color", Parser::cStateChange)
-};
-
-wishful_hash_map<wstring, Parser::TokenCode> gTextTokenTable(
- gTextTokenArray,
- END_ARRAY(gTextTokenArray)
-);
-
-// Tests whether the supplied token is in either the math or text token
-// tables.
-bool IsInTokenTables(const wstring& token)
-{
- return
- (gMathTokenTable.count(token) > 0) ||
- (gTextTokenTable.count(token) > 0);
-}
-
-Parser::TokenCode Parser::GetMathTokenCode(const wstring& token) const
-{
- wstring translatedToken = translateToken(token);
- wishful_hash_map<wstring, TokenCode>::const_iterator
- output = gMathTokenTable.find(translatedToken);
-
- if (output != gMathTokenTable.end())
- {
- if (output->second != cIllegal)
- return output->second;
-
- // Give the user some helpful hints if they try to use certain
- // illegal commands (e.g. "% is illegal, try \% instead").
- if (translatedToken == L"%" || translatedToken == L"#" || translatedToken == L"$")
- throw Exception(
- L"IllegalCommandInMathModeWithHint",
- token, L"\\" + translatedToken
- );
-
- else if (translatedToken == L"`" || translatedToken == L"\"")
- throw Exception(L"IllegalCommandInMathMode", token);
-
- throw logic_error(
- "Unexpected illegal character in Parser::GetMathTokenCode"
- );
- }
-
- if (translatedToken[0] == L'\\')
- {
- if (gTextTokenTable.count(translatedToken))
- throw Exception(L"IllegalCommandInMathMode", token);
- else
- throw Exception(L"UnrecognisedCommand", token);
- }
-
- if (translatedToken[0] > 0x7F)
- throw Exception(L"NonAsciiInMathMode");
-
- if (
- (translatedToken[0] >= L'a' && translatedToken[0] <= L'z') ||
- (translatedToken[0] >= L'A' && translatedToken[0] <= L'Z') ||
- (translatedToken[0] >= L'0' && translatedToken[0] <= L'9')
- )
- return cSymbol;
-
- throw Exception(L"UnrecognisedCommand", token);
-}
-
-Parser::TokenCode Parser::GetTextTokenCode(const wstring& token) const
-{
- wishful_hash_map<wstring, TokenCode>::const_iterator
- output = gTextTokenTable.find(token);
-
- if (output != gTextTokenTable.end())
- {
- if (output->second != cIllegal)
- return output->second;
-
- // Give the user some helpful hints if they try to use certain
- // illegal commands.
- if (token == L"&" || token == L"_" || token == L"%"
- || token == L"#" || token == L"$")
-
- throw Exception(
- L"IllegalCommandInTextModeWithHint",
- token, L"\\" + token
- );
-
- else if (token == L"\\\\")
- throw Exception(
- L"IllegalCommandInTextModeWithHint",
- L"\\\\", L"\\textbackslash"
- );
-
- else if (token == L"^")
- throw Exception(
- L"IllegalCommandInTextModeWithHint",
- L"^", L"\\textasciicircum"
- );
-
- else
- throw Exception(L"IllegalCommandInTextMode", token);
- }
-
- if (token[0] == L'\\')
- {
- if (gMathTokenTable.count(token))
- throw Exception(L"IllegalCommandInTextMode", token);
- else
- throw Exception(L"UnrecognisedCommand", token);
- }
-
- if (
- (token[0] >= L'a' && token[0] <= L'z') ||
- (token[0] >= L'A' && token[0] <= L'Z') ||
- (token[0] >= L'0' && token[0] <= L'9') ||
- (token[0] > 0x7F)
- )
- return cSymbol;
-
- throw Exception(L"UnrecognisedCommand", token);
-}
-
-auto_ptr<ParseTree::MathNode> Parser::DoParse(const vector<wstring>& input)
-{
- mTokenSource.reset(new MacroProcessor(input));
-
- // Parse until we hit a closing token of some kind...
- auto_ptr<ParseTree::MathNode> output = ParseMathList();
-
- // ... and check that the closing token is actually the end of input.
- switch (GetMathTokenCode(mTokenSource->Peek()))
- {
- case cEndOfInput: return output;
- case cEndGroup: throw Exception(L"UnmatchedCloseBrace");
- case cRight: throw Exception(L"UnmatchedRight");
- case cNextCell: throw Exception(L"UnexpectedNextCell");
- case cNextRow: throw Exception(L"UnexpectedNextRow");
- case cEndEnvironment: throw Exception(L"UnmatchedEnd");
- }
-
- throw logic_error("Unexpected token code in Parser::DoParse");
-}
-
-auto_ptr<ParseTree::MathNode> Parser::ParseMathField()
-{
- mTokenSource->SkipWhitespace();
- wstring command = translateToken(mTokenSource->Get());
-
- switch (GetMathTokenCode(command))
- {
- case cSymbol:
- return auto_ptr<ParseTree::MathNode>(
- new ParseTree::MathSymbol(command)
- );
-
- case cBeginGroup:
- {
- // Grab the argument surrounded by braces
- auto_ptr<ParseTree::MathNode> field = ParseMathList();
-
- // Gobble closing brace
- if (mTokenSource->Get() != L"}")
- throw Exception(L"UnmatchedOpenBrace");
-
- return field;
- }
-
- case cEndOfInput:
- throw Exception(L"MissingOpenBraceAtEnd");
- }
-
- throw Exception(L"MissingOpenBraceBefore", command);
-}
-
-auto_ptr<ParseTree::MathTable> Parser::ParseMathTable()
-{
- auto_ptr<ParseTree::MathTable> table(new ParseTree::MathTable);
- // "row" holds the current, incomplete row being parsed
- auto_ptr<ParseTree::MathTableRow> row(new ParseTree::MathTableRow);
-
- while (true)
- {
- auto_ptr<ParseTree::MathNode> entry = ParseMathList();
-
- switch (GetMathTokenCode(mTokenSource->Peek()))
- {
- case cNextCell:
- {
- mTokenSource->Advance();
- row->mEntries.push_back(entry.release());
- break;
- }
-
- case cNextRow:
- {
- mTokenSource->Advance();
- row->mEntries.push_back(entry.release());
- table->mRows.push_back(row.release());
- row.reset(new ParseTree::MathTableRow);
- break;
- }
-
- case cEndGroup:
- case cRight:
- case cEndOfInput:
- case cEndEnvironment:
- {
- // We only include the last row if it isn't blank,
- // e.g. "\begin{matrix} a \\ \end{matrix}" should only
- // result in a single row.
-
- ParseTree::MathList* check =
- dynamic_cast<ParseTree::MathList*>(entry.get());
-
- if (!check ||
- !check->mChildren.empty() || !row->mEntries.empty()
- )
- {
- row->mEntries.push_back(entry.release());
- table->mRows.push_back(row.release());
- }
-
- return table;
- }
-
- default:
- throw logic_error(
- "Unexpected token code in Parser::ParseMathTable"
- );
- }
- }
-
- // Hmmm... gcc seems to think the control flow can reach here...
- throw logic_error("Unexpected control flow in Parser::ParseMathTable");
-}
-
-ParseTree::MathScripts* Parser::PrepareScripts(ParseTree::MathList* output)
-{
- ParseTree::MathScripts* target;
-
- if (output->mChildren.empty())
- {
- // If there are no nodes yet, make a new scripts node with an
- // empty base
- target = new ParseTree::MathScripts;
- output->mChildren.push_back(target);
- }
- else
- {
- target = dynamic_cast<ParseTree::MathScripts*>(
- output->mChildren.back()
- );
-
- if (!target)
- {
- // If the last node exists but is not a scripts node,
- // shove it into the base of a new scripts node.
- target = new ParseTree::MathScripts;
- target->mBase.reset(output->mChildren.back());
- output->mChildren.back() = target;
- }
- }
-
- return target;
-}
-
-
-wstring Parser::ParseColourName()
-{
- mTokenSource->SkipWhitespace();
- if (mTokenSource->Get() != L"{")
- throw Exception(L"MissingOpenBraceAfter", L"\\color");
-
- wstring colourName;
- while (true)
- {
- wstring c = mTokenSource->Get();
- if (c == L"}")
- {
- // check colour name is valid
- if (gColourTable.find(colourName) == gColourTable.end())
- throw Exception(L"InvalidColour", colourName);
- return colourName;
- }
- if (c == L"")
- throw Exception(L"UnmatchedOpenBrace");
- colourName += c;
- if (c.size() != 1 ||
- !(
- (c[0] >= 'A' && c[0] <= 'Z') ||
- (c[0] >= 'a' && c[0] <= 'z')
- )
- )
- throw Exception(
- L"InvalidColour",
- colourName + L"..."
- );
- }
-}
-
-
-auto_ptr<ParseTree::MathNode> Parser::ParseMathList()
-{
- auto_ptr<ParseTree::MathList> output(new ParseTree::MathList);
-
- // infixNumerator temporarily holds the numerator of an infix command
- // (like "\over"), while we are waiting for the denominator to be
- // fully built up...
- auto_ptr<ParseTree::MathList> infixNumerator;
- // and the infix command itself is stored here:
- wstring infixCommand;
-
- while (true)
- {
- switch (GetMathTokenCode(mTokenSource->Peek()))
- {
- case cEndGroup:
- case cRight:
- case cNextCell:
- case cNextRow:
- case cEndEnvironment:
- case cEndOfInput:
- {
- // It's a little strange that the following static_casts
- // should be needed, but gcc 3.3 seems to require them.
- // Don't know about later versions.
- if (!infixCommand.empty())
- return auto_ptr<ParseTree::MathNode>(
- new ParseTree::MathCommand2Args(
- infixCommand,
- static_cast<auto_ptr<ParseTree::MathNode> >
- (infixNumerator),
- static_cast<auto_ptr<ParseTree::MathNode> >
- (output),
- true // true = this is an infix command rather
- // than a two-argument command
- )
- );
- else
- {
- if (output->mChildren.size() == 1)
- {
- // If there's only node in the list, return just
- // that single node. (We need to actually remove
- // it from output->mChildren to respect ownership
- // rules; otherwise output's destructor will delete
- // it *again*).
- auto_ptr<ParseTree::MathNode> temp(
- output->mChildren.back()
- );
- output->mChildren.clear();
- return temp;
- }
- else
- return static_cast<auto_ptr<ParseTree::MathNode> >
- (output);
- }
- }
-
- case cNewcommand:
- {
- // Pass back the macro definition to be handled by the
- // attached MacroProcessor.
- mTokenSource->HandleNewcommand();
- break;
- }
-
- case cWhitespace:
- {
- // Skip whitespace.
- mTokenSource->Advance();
- break;
- }
-
- case cSymbol:
- case cSymbolUnsafe:
- {
- output->mChildren.push_back(
- new ParseTree::MathSymbol(translateToken(mTokenSource->Get()))
- );
- break;
- }
-
- case cBeginGroup:
- {
- mTokenSource->Advance();
-
- // Grab stuff inside braces:
- output->mChildren.push_back(
- new ParseTree::MathGroup(ParseMathList())
- );
-
- // Gobble closing brace.
- if (mTokenSource->Get() != L"}")
- throw Exception(L"UnmatchedOpenBrace");
- break;
- }
-
- case cBeginEnvironment:
- {
- // extract e.g. "matrix" from "\begin{matrix}"
- wstring beginCommand = mTokenSource->Get();
- wstring name
- = beginCommand.substr(7, beginCommand.size() - 8);
-
- auto_ptr<ParseTree::MathTable> table = ParseMathTable();
-
- wstring endCommand = mTokenSource->Get();
- if (GetMathTokenCode(endCommand) != cEndEnvironment)
- throw Exception(L"UnmatchedBegin", beginCommand);
-
- if (name != endCommand.substr(5, endCommand.size() - 6))
- throw Exception(
- L"MismatchedBeginAndEnd", beginCommand, endCommand
- );
-
- if (name == L"cases")
- {
- // check none of the rows have more than two entries
- for (vector<ParseTree::MathTableRow*>::iterator
- row = table->mRows.begin();
- row != table->mRows.end();
- row++
- )
- {
- if ((*row)->mEntries.size() > 2)
- throw Exception(L"CasesRowTooBig");
- }
- }
-
- output->mChildren.push_back(
- new ParseTree::MathEnvironment(name, table, false)
- );
- break;
- }
-
- case cShortEnvironment:
- {
- wstring command = translateToken(mTokenSource->Get());
-
- // Strip initial backslash (e.g. "\substack" => "substack")
- wstring name = command.substr(1, command.size() - 1);
-
- // Gobble opening "{"
- mTokenSource->SkipWhitespace();
- if (mTokenSource->Get() != L"{")
- throw Exception(L"MissingOpenBraceAfter", command);
-
- auto_ptr<ParseTree::MathTable> table = ParseMathTable();
-
- if (name == L"substack")
- {
- // check none of the rows have more than one entry
- for (vector<ParseTree::MathTableRow*>::iterator
- row = table->mRows.begin();
- row != table->mRows.end();
- row++
- )
- {
- if ((*row)->mEntries.size() > 1)
- throw Exception(L"SubstackRowTooBig");
- }
- }
-
- // Gobble closing "}"
- if (mTokenSource->Get() != L"}")
- throw Exception(L"UnmatchedOpenBrace");
-
- output->mChildren.push_back(
- new ParseTree::MathEnvironment(name, table, true)
- );
- break;
- }
-
- case cEnterTextMode:
- {
- wstring command = mTokenSource->Get();
-
- mTokenSource->SkipWhitespace();
- if (mTokenSource->Peek() != L"{")
- throw Exception(L"MissingOpenBraceAfter", command);
-
- output->mChildren.push_back(
- // Here is the only place in this function that we
- // switch to text mode parsing:
- new ParseTree::EnterTextMode(command, ParseTextField())
- );
- break;
- }
-
- case cLeft:
- {
- mTokenSource->Advance();
- mTokenSource->SkipWhitespace();
- wstring left = translateToken(mTokenSource->Get());
- if (left.empty())
- throw Exception(L"MissingDelimiter", L"\\left");
- else if (!gDelimiterTable.count(left))
- throw Exception(L"IllegalDelimiter", L"\\left");
-
- auto_ptr<ParseTree::MathNode> child = ParseMathList();
-
- if (mTokenSource->Peek() != L"\\right")
- throw Exception(L"UnmatchedLeft");
-
- mTokenSource->Advance();
- mTokenSource->SkipWhitespace();
- wstring right = translateToken(mTokenSource->Get());
- if (right.empty())
- throw Exception(L"MissingDelimiter", L"\\right");
- else if (!gDelimiterTable.count(right))
- throw Exception(L"IllegalDelimiter", L"\\right");
-
- output->mChildren.push_back(
- new ParseTree::MathDelimited(child, left, right)
- );
- break;
- }
-
- case cBig:
- {
- wstring command = translateToken(mTokenSource->Get());
- mTokenSource->SkipWhitespace();
- wstring delimiter = translateToken(mTokenSource->Get());
- if (delimiter.empty())
- throw Exception(L"MissingDelimiter", command);
- else if (!gDelimiterTable.count(delimiter))
- throw Exception(L"IllegalDelimiter", command);
-
- output->mChildren.push_back(
- new ParseTree::MathBig(command, delimiter)
- );
- break;
- }
-
- case cSuperscript:
- {
- mTokenSource->Advance();
- ParseTree::MathScripts* target
- = PrepareScripts(output.get());
- if (target->mUpper.get())
- throw Exception(L"DoubleSuperscript");
- target->mUpper = ParseMathField();
- break;
- }
-
- case cSubscript:
- {
- mTokenSource->Advance();
- ParseTree::MathScripts* target
- = PrepareScripts(output.get());
- if (target->mLower.get())
- throw Exception(L"DoubleSubscript");
- target->mLower = ParseMathField();
- break;
- }
-
- case cPrime:
- {
- // The idea here is to fill in "superscript" with
- // an appropriate number of "\prime" commands and
- // possibly a regular superscript indicated by "^".
- //
- // It (hopefully) has the same effect as the macro
- // that TeX uses for the prime symbol.
-
- auto_ptr<ParseTree::MathList> superscript(
- new ParseTree::MathList
- );
-
- while (mTokenSource->Peek() == L"'")
- {
- superscript->mChildren.push_back(
- new ParseTree::MathSymbol(L"\\prime")
- );
- mTokenSource->Advance();
- }
-
- ParseTree::MathScripts* target
- = PrepareScripts(output.get());
- if (target->mUpper.get())
- throw Exception(L"DoubleSuperscript");
-
- if (mTokenSource->Peek() == L"^")
- {
- mTokenSource->Advance();
- superscript->mChildren.push_back(
- ParseMathField().release()
- );
- }
-
- target->mUpper.reset(
- new ParseTree::MathGroup(
- static_cast<auto_ptr<ParseTree::MathNode> >
- (superscript)
- )
- );
- break;
- }
-
- case cLimits:
- {
- wstring command = mTokenSource->Get();
- if (output->mChildren.empty())
- throw Exception(L"MisplacedLimits", command);
-
- // We need to arrange things so that the child of the
- // new MathLimits node is the base of a (possibly new)
- // MathScripts node.
-
- ParseTree::MathScripts* scripts =
- dynamic_cast<ParseTree::MathScripts*>(
- output->mChildren.back()
- );
-
- if (scripts)
- scripts->mBase.reset(
- new ParseTree::MathLimits(command, scripts->mBase)
- );
- else
- output->mChildren.back() = new ParseTree::MathLimits(
- command,
- auto_ptr<ParseTree::MathNode>(
- output->mChildren.back()
- )
- );
-
- break;
- }
-
- case cStateChange:
- {
- wstring command = mTokenSource->Get();
- if (command == L"\\color")
- output->mChildren.push_back(
- new ParseTree::MathColour(ParseColourName())
- );
- else
- output->mChildren.push_back(
- new ParseTree::MathStateChange(command)
- );
- break;
- }
-
- case cCommand1Arg:
- {
- wstring command = translateToken(mTokenSource->Get());
- output->mChildren.push_back(
- new ParseTree::MathCommand1Arg(
- command, ParseMathField()
- )
- );
- break;
- }
-
- case cCommand2Args:
- {
- wstring command = translateToken(mTokenSource->Get());
- auto_ptr<ParseTree::MathNode> child1 = ParseMathField();
- auto_ptr<ParseTree::MathNode> child2 = ParseMathField();
- output->mChildren.push_back(
- new ParseTree::MathCommand2Args(
- command, child1, child2, false
- )
- );
- break;
- }
-
- case cCommandInfix:
- {
- if (!infixCommand.empty())
- throw Exception(
- L"AmbiguousInfix", mTokenSource->Peek()
- );
-
- // When we see an infix command (e.g. "\over"), we do the
- // same thing TeX does: clear out the entire math list
- // being processed and dump it temporarily in
- // "infixNumerator", and start processing the "denominator".
-
- infixNumerator = output;
- infixCommand = translateToken(mTokenSource->Get());
- output.reset(new ParseTree::MathList);
- break;
- }
-
- default:
- throw logic_error(
- "Unexpected token code in Parser::ParseMathList"
- );
- }
- }
-
- // Hmmm... gcc seems to think the control flow can reach here...
- throw logic_error("Unexpected control flow in Parser::ParseMathList");
-}
-
-auto_ptr<ParseTree::TextNode> Parser::ParseTextField()
-{
- mTokenSource->SkipWhitespace();
- wstring command = mTokenSource->Get();
-
- switch (GetTextTokenCode(command))
- {
- case cSymbol:
- return auto_ptr<ParseTree::TextNode>(
- new ParseTree::TextSymbol(command)
- );
-
- case cBeginGroup:
- {
- auto_ptr<ParseTree::TextNode> field(
- new ParseTree::TextGroup(ParseTextList())
- );
- if (mTokenSource->Peek() != L"}")
- throw Exception(L"UnmatchedOpenBrace");
- mTokenSource->Advance();
- return field;
- }
-
- case cEndOfInput:
- throw Exception(L"MissingOpenBraceAtEnd");
- }
-
- throw Exception(L"MissingOpenBraceBefore", command);
-}
-
-auto_ptr<ParseTree::TextNode> Parser::ParseTextList()
-{
- auto_ptr<ParseTree::TextList> output(new ParseTree::TextList);
-
- while (true)
- {
- switch (GetTextTokenCode(mTokenSource->Peek()))
- {
- case cEndGroup:
- case cEndOfInput:
- {
- if (output->mChildren.size() == 1)
- {
- // If there's only node in the list, return just that
- // single node.
- ParseTree::TextNode* temp = output->mChildren.back();
- output->mChildren.pop_back();
- return auto_ptr<ParseTree::TextNode>(temp);
- }
- else
- return static_cast<auto_ptr<ParseTree::TextNode> >(
- output
- );
- }
-
- case cNewcommand:
- {
- mTokenSource->HandleNewcommand();
- break;
- }
-
- case cBeginGroup:
- {
- mTokenSource->Advance();
- output->mChildren.push_back(
- new ParseTree::TextGroup(ParseTextList())
- );
- if (mTokenSource->Peek() != L"}")
- throw Exception(L"UnmatchedOpenBrace");
- mTokenSource->Advance();
- break;
- }
-
- case cWhitespace:
- case cSymbol:
- case cSymbolUnsafe:
- {
- output->mChildren.push_back(
- new ParseTree::TextSymbol(mTokenSource->Get())
- );
- break;
- }
-
- case cCommand1Arg:
- {
- wstring command = mTokenSource->Get();
- output->mChildren.push_back(
- new ParseTree::TextCommand1Arg(
- command, ParseTextField()
- )
- );
- break;
- }
-
- case cStateChange:
- {
- wstring command = mTokenSource->Get();
- if (command == L"\\color")
- output->mChildren.push_back(
- new ParseTree::TextColour(ParseColourName())
- );
- else
- output->mChildren.push_back(
- new ParseTree::TextStateChange(command)
- );
- break;
- }
-
- default:
- throw logic_error(
- "Unexpected token code in Parser::ParseTextList"
- );
- }
- }
-
- // Hmmm... gcc seems to think the control flow can reach here...
- throw logic_error("Unexpected control flow in Parser::ParseTextField");
-}
-
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/Parser.h b/blahtexml/source/BlahtexCore/Parser.h
deleted file mode 100644
index 2e69b4f..0000000
--- a/blahtexml/source/BlahtexCore/Parser.h
+++ /dev/null
@@ -1,142 +0,0 @@
-// File "Parser.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_PARSER_H
-#define BLAHTEX_PARSER_H
-
-#include "MacroProcessor.h"
-#include "ParseTree.h"
-
-namespace blahtex
-{
-
-// The Parser class actually does the parsing work. It runs the supplied
-// input tokens through a MacroProcessor, and builds a parse tree from the
-// resulting expanded token stream.
-class Parser
-{
-
-public:
- // Main function that the caller should use to do a parsing job.
- // Input is a TeX string, output is the root of a parse tree.
- std::auto_ptr<ParseTree::MathNode> DoParse(
- const std::vector<std::wstring>& input
- );
-
- // The parser uses GetMathTokenCode (in math mode) or GetTextTokenCode
- // (in text mode) to translate each incoming token into one of the
- // following values:
- enum TokenCode
- {
- cEndOfInput,
- cWhitespace,
- cNewcommand, // The "\newcommand" command.
- cIllegal, // Single character commands that are illegal in
- // the current mode (like "$", "%").
- cBeginGroup, // Opening and closing braces ("{" and "}").
- cEndGroup,
- cNextCell, // The commands "&" and "\\".
- cNextRow,
- cSuperscript, // The commands "^" and "_".
- cSubscript,
- cPrime, // The prime symbol "'".
- cCommand1Arg, // TeX commands accepting one argument.
- cCommand2Args, // TeX commands accepting two arguments.
- cCommandInfix, // Infix commands like "\over".
- cLeft, // The "\left" and "\right" commands.
- cRight,
- cBig, // "\big" style commands.
- cLimits, // "\limits", "\nolimits", or "\displaylimits".
- cBeginEnvironment, // Like "\begin{matrix}", "\end{matrix}"
- cEndEnvironment,
- cShortEnvironment, // Like "\substack{...}". Inside the braces it
- // behaves like an environment, but it doesn't
- // use "\begin" or "\end".
- cEnterTextMode, // Command that switch from math mode to text
- // mode (e.g. "\text").
- cStateChange, // State changes, e.g. "\rm", "\scriptstyle",
- // "\color".
- cSymbol, // Pretty much every other command: e.g.
- // "a", "1", "\alpha", "+", "\rightarrow", etc.
-
- // cSymbolUnsafe covers some commands that one might expect to get
- // translated as cSymbol.
- //
- // The issue is that TeX/LaTeX/AMS-LaTeX expands certain commands as
- // macros, and they subsequently become unsafe for use as a single
- // symbol. For example, "x^\cong" is illegal in TeX, because "\cong"
- // gets expanded as a macro, so we assign the code cSymbolUnsafe to
- // "\cong". This is a bit of a nasty hack, but the only real
- // alternative is to simulate a much larger portion of
- // TeX/LaTeX/AMS-LaTeX, which at this stage is unpalatable :-)
- cSymbolUnsafe
- };
-
-private:
- // Tokens are first filtered through this MacroProcessor object, so that
- // the parser doesn't have to be aware of macros at all.
- std::auto_ptr<MacroProcessor> mTokenSource;
-
- // ParseMathList starts parsing a math list, until it reaches a command
- // indicating the end of the list, like "}" or "\right" or "\end{...}".
- std::auto_ptr<ParseTree::MathNode> ParseMathList();
-
- // ParseMathField parses a TeX "math field", which is either a single
- // symbol or an expression grouped with braces.
- std::auto_ptr<ParseTree::MathNode> ParseMathField();
-
- // Handle a table enclosed in something like "\begin{matrix} ...
- // \end{matrix}"; i.e. it breaks input up into entries and rows based on
- // "\\" and "&" commands.
- std::auto_ptr<ParseTree::MathTable> ParseMathTable();
-
- // PrepareScripts is called when we encounter "^" or "_". It ensures
- // that the last element of output->mChildren is a MathScripts node
- // whose base is the base of the "^" or "_" command.
- //
- // (The caller does not get ownership of the MathScripts node;
- // PrepareScripts assigns this ownership to *output if necessary).
- ParseTree::MathScripts* PrepareScripts(ParseTree::MathList* output);
-
- // ParseTextList starts parsing a text list, until it reaches "}" or
- // end of input.
- std::auto_ptr<ParseTree::TextNode> ParseTextList();
-
- // ParseTextField parses an argument to a command in text mode, which
- // is either a single symbol or an expression grouped with braces.
- std::auto_ptr<ParseTree::TextNode> ParseTextField();
-
- // These functions determine the appropriate token code for the supplied
- // token. Things like "1", "a", "+" are handled appropriately, as are
- // backslash-prefixed commands listed in gMathTokenTable or
- // gTextTokenTable.
- TokenCode GetMathTokenCode(const std::wstring& token) const;
- TokenCode GetTextTokenCode(const std::wstring& token) const;
-
- // Parses stuff that occurs after "\color", e.g. " {red}", and checks
- // that the colour is legal. Returns the colour name, e.g. "red".
- std::wstring ParseColourName();
-};
-
-}
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/XmlEncode.cpp b/blahtexml/source/BlahtexCore/XmlEncode.cpp
deleted file mode 100644
index f875c21..0000000
--- a/blahtexml/source/BlahtexCore/XmlEncode.cpp
+++ /dev/null
@@ -1,694 +0,0 @@
-// File "XmlEncode.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <iomanip>
-#include <sstream>
-#include <map>
-#include "XmlEncode.h"
-
-using namespace std;
-
-namespace blahtex
-{
-
-struct UnicodeNameInfo
-{
- wstring mShortName;
- wstring mLongName;
-
- UnicodeNameInfo()
- { }
-
- UnicodeNameInfo(
- const wstring& shortName
- ) :
- mShortName(shortName)
- { }
-
- UnicodeNameInfo(
- const wstring& shortName,
- const wstring& longName
- ) :
- mShortName(shortName),
- mLongName(longName)
- { }
-};
-
-// This table lists all the non-ASCII characters that blahtex can give
-// names to. For each one it possibly lists a short and long MathML name.
-pair<wchar_t, UnicodeNameInfo> gUnicodeNameArray[] =
-{
- make_pair(L'\U00000060', UnicodeNameInfo(L"grave", L"DiacriticalGrave")),
- make_pair(L'\U000000A0', UnicodeNameInfo(L"nbsp", L"NonBreakingSpace")),
- make_pair(L'\U000000A5', UnicodeNameInfo(L"yen")),
- make_pair(L'\U000000A7', UnicodeNameInfo(L"sect")),
- make_pair(L'\U000000AC', UnicodeNameInfo(L"not")),
- make_pair(L'\U000000AE', UnicodeNameInfo(L"reg", L"circledR")),
- make_pair(L'\U000000AF', UnicodeNameInfo(L"macr", L"OverBar")),
- make_pair(L'\U000000B1', UnicodeNameInfo(L"pm", L"PlusMinus")),
- make_pair(L'\U000000B4', UnicodeNameInfo(L"acute", L"DiacriticalAcute")),
- make_pair(L'\U000000B6', UnicodeNameInfo(L"para")),
- make_pair(L'\U000000B7', UnicodeNameInfo(L"middot", L"CenterDot")),
- make_pair(L'\U000000D7', UnicodeNameInfo(L"times")),
- make_pair(L'\U000000D8', UnicodeNameInfo(L"Oslash")),
- make_pair(L'\U000000F0', UnicodeNameInfo(L"eth")),
- make_pair(L'\U000000F7', UnicodeNameInfo(L"div", L"divide")),
- make_pair(L'\U00000127', UnicodeNameInfo(L"hstrok")),
- make_pair(L'\U00000131', UnicodeNameInfo(L"imath")),
- make_pair(L'\U000002C7', UnicodeNameInfo(L"caron", L"Hacek")),
- make_pair(L'\U000002D8', UnicodeNameInfo(L"breve", L"Breve")),
- make_pair(L'\U000002DC', UnicodeNameInfo(L"tilde", L"DiacriticalTilde")),
- make_pair(L'\U00000338', UnicodeNameInfo()), // FIX: combining character that needs some thought
- make_pair(L'\U00000393', UnicodeNameInfo(L"Gamma")),
- make_pair(L'\U00000394', UnicodeNameInfo(L"Delta")),
- make_pair(L'\U00000398', UnicodeNameInfo(L"Theta")),
- make_pair(L'\U0000039B', UnicodeNameInfo(L"Lambda")),
- make_pair(L'\U0000039E', UnicodeNameInfo(L"Xi")),
- make_pair(L'\U000003A0', UnicodeNameInfo(L"Pi")),
- make_pair(L'\U000003A3', UnicodeNameInfo(L"Sigma")),
- make_pair(L'\U000003A5', UnicodeNameInfo(L"Upsilon")),
- make_pair(L'\U000003A6', UnicodeNameInfo(L"Phi")),
- make_pair(L'\U000003A8', UnicodeNameInfo(L"Psi")),
- make_pair(L'\U000003A9', UnicodeNameInfo(L"Omega")),
- make_pair(L'\U000003B1', UnicodeNameInfo(L"alpha")),
- make_pair(L'\U000003B2', UnicodeNameInfo(L"beta")),
- make_pair(L'\U000003B3', UnicodeNameInfo(L"gamma")),
- make_pair(L'\U000003B4', UnicodeNameInfo(L"delta")),
- make_pair(L'\U000003B5', UnicodeNameInfo(L"epsiv", L"varepsilon")),
- make_pair(L'\U000003B6', UnicodeNameInfo(L"zeta")),
- make_pair(L'\U000003B7', UnicodeNameInfo(L"eta")),
- make_pair(L'\U000003B8', UnicodeNameInfo(L"theta")),
- make_pair(L'\U000003B9', UnicodeNameInfo(L"iota")),
- make_pair(L'\U000003BA', UnicodeNameInfo(L"kappa")),
- make_pair(L'\U000003BB', UnicodeNameInfo(L"lambda")),
- make_pair(L'\U000003BC', UnicodeNameInfo(L"mu")),
- make_pair(L'\U000003BD', UnicodeNameInfo(L"nu")),
- make_pair(L'\U000003BE', UnicodeNameInfo(L"xi")),
- make_pair(L'\U000003C0', UnicodeNameInfo(L"pi")),
- make_pair(L'\U000003C1', UnicodeNameInfo(L"rho")),
- make_pair(L'\U000003C2', UnicodeNameInfo(L"sigmav", L"varsigma")),
- make_pair(L'\U000003C3', UnicodeNameInfo(L"sigma")),
- make_pair(L'\U000003C4', UnicodeNameInfo(L"tau")),
- make_pair(L'\U000003C5', UnicodeNameInfo(L"upsi", L"upsilon")),
-#if 0
- // FIX: note Firefox 1.5 has &phi; and &varphi; around the wrong
- // way, so better to stick with numeric codes for 0x3C6 and 0x3D5.
- // See mozilla bug 321438.
- make_pair(L'\U000003C6', UnicodeNameInfo(L"phiv", L"varphi")),
- make_pair(L'\U000003D5', UnicodeNameInfo(L"phi", L"straightphi")),
-#endif
- make_pair(L'\U000003C7', UnicodeNameInfo(L"chi")),
- make_pair(L'\U000003C8', UnicodeNameInfo(L"psi")),
- make_pair(L'\U000003C9', UnicodeNameInfo(L"omega")),
- make_pair(L'\U000003D1', UnicodeNameInfo(L"thetav", L"vartheta")),
- make_pair(L'\U000003D6', UnicodeNameInfo(L"piv", L"varpi")),
- make_pair(L'\U000003DD', UnicodeNameInfo(L"gammad", L"digamma")),
- make_pair(L'\U000003F0', UnicodeNameInfo(L"kappav", L"varkappa")),
- make_pair(L'\U000003F1', UnicodeNameInfo(L"rhov", L"varrho")),
- make_pair(L'\U000003F5', UnicodeNameInfo(L"epsi", L"straightepsilon")),
- make_pair(L'\U000003F6', UnicodeNameInfo(L"bepsi", L"backepsilon")),
- make_pair(L'\U00002020', UnicodeNameInfo(L"dagger")),
- make_pair(L'\U00002021', UnicodeNameInfo(L"Dagger", L"ddagger")),
- make_pair(L'\U00002022', UnicodeNameInfo(L"bull", L"bullet")),
- make_pair(L'\U00002026', UnicodeNameInfo(L"hellip")),
- make_pair(L'\U00002032', UnicodeNameInfo(L"prime")),
- make_pair(L'\U00002035', UnicodeNameInfo(L"bprime", L"backprime")),
- make_pair(L'\U00002102', UnicodeNameInfo(L"Copf", L"complexes")),
- make_pair(L'\U0000210B', UnicodeNameInfo(L"Hscr", L"HilbertSpace")),
- make_pair(L'\U0000210C', UnicodeNameInfo(L"Hfr", L"Poincareplane")),
- make_pair(L'\U0000210D', UnicodeNameInfo(L"Hopf", L"quaternions")),
- make_pair(L'\U0000210F', UnicodeNameInfo(L"hbar", L"planck")),
- make_pair(L'\U00002110', UnicodeNameInfo(L"Iscr", L"imagline")),
- make_pair(L'\U00002111', UnicodeNameInfo(L"Im", L"imagpart")),
- make_pair(L'\U00002112', UnicodeNameInfo(L"Lscr", L"Laplacetrf")),
- make_pair(L'\U00002113', UnicodeNameInfo(L"ell")),
- make_pair(L'\U00002118', UnicodeNameInfo(L"wp", L"weierp")),
- make_pair(L'\U00002119', UnicodeNameInfo(L"Popf", L"primes")),
- make_pair(L'\U0000211A', UnicodeNameInfo(L"Qopf", L"rationals")),
- make_pair(L'\U0000211B', UnicodeNameInfo(L"Rscr", L"realine")),
- make_pair(L'\U0000211C', UnicodeNameInfo(L"Re", L"realpart")),
- make_pair(L'\U0000211D', UnicodeNameInfo(L"Ropf", L"reals")),
- make_pair(L'\U00002124', UnicodeNameInfo(L"Zopf", L"integers")),
- make_pair(L'\U00002127', UnicodeNameInfo(L"mho")),
- make_pair(L'\U00002128', UnicodeNameInfo(L"Zfr", L"zeetrf")),
- make_pair(L'\U0000212C', UnicodeNameInfo(L"Bscr", L"Bernoullis")),
- make_pair(L'\U0000212D', UnicodeNameInfo(L"Cfr", L"Cayleys")),
- make_pair(L'\U00002130', UnicodeNameInfo(L"Escr", L"expectation")),
- make_pair(L'\U00002131', UnicodeNameInfo(L"Fscr", L"Fouriertrf")),
- make_pair(L'\U00002133', UnicodeNameInfo(L"Mscr", L"Mellintrf")),
- make_pair(L'\U00002135', UnicodeNameInfo(L"aleph")),
- make_pair(L'\U00002136', UnicodeNameInfo(L"beth")),
- make_pair(L'\U00002137', UnicodeNameInfo(L"gimel")),
- make_pair(L'\U00002138', UnicodeNameInfo(L"daleth")),
- make_pair(L'\U00002190', UnicodeNameInfo(L"larr", L"LeftArrow")),
- make_pair(L'\U00002191', UnicodeNameInfo(L"uarr", L"UpArrow")),
- make_pair(L'\U00002192', UnicodeNameInfo(L"rarr", L"RightArrow")),
- make_pair(L'\U00002193', UnicodeNameInfo(L"darr", L"DownArrow")),
- make_pair(L'\U00002194', UnicodeNameInfo(L"harr", L"LeftRightArrow")),
- make_pair(L'\U00002195', UnicodeNameInfo(L"varr", L"UpDownArrow")),
- make_pair(L'\U00002196', UnicodeNameInfo(L"nwarr", L"UpperLeftArrow")),
- make_pair(L'\U00002197', UnicodeNameInfo(L"nearr", L"UpperRightArrow")),
- make_pair(L'\U00002198', UnicodeNameInfo(L"searr", L"LowerRightArrow")),
- make_pair(L'\U00002199', UnicodeNameInfo(L"swarr", L"LowerLeftArrow")),
- make_pair(L'\U0000219A', UnicodeNameInfo(L"nlarr", L"nleftarrow")),
- make_pair(L'\U0000219B', UnicodeNameInfo(L"nrarr", L"nrightarrow")),
- make_pair(L'\U0000219D', UnicodeNameInfo(L"rarrw", L"rightsquigarrow")),
- make_pair(L'\U0000219E', UnicodeNameInfo(L"Larr", L"twoheadleftarrow")),
- make_pair(L'\U000021A0', UnicodeNameInfo(L"Rarr", L"twoheadrightarrow")),
- make_pair(L'\U000021A2', UnicodeNameInfo(L"larrtl", L"leftarrowtail")),
- make_pair(L'\U000021A3', UnicodeNameInfo(L"rarrtl", L"rightarrowtail")),
- make_pair(L'\U000021A6', UnicodeNameInfo(L"map", L"RightTeeArrow")),
- make_pair(L'\U000021A9', UnicodeNameInfo(L"larrhk", L"hookleftarrow")),
- make_pair(L'\U000021AA', UnicodeNameInfo(L"rarrhk", L"hookrightarrow")),
- make_pair(L'\U000021AB', UnicodeNameInfo(L"larrlp", L"looparrowleft")),
- make_pair(L'\U000021AC', UnicodeNameInfo(L"rarrlp", L"looparrowright")),
- make_pair(L'\U000021AD', UnicodeNameInfo(L"harrw", L"leftrightsquigarrow")),
- make_pair(L'\U000021AE', UnicodeNameInfo(L"nharr", L"nleftrightarrow")),
- make_pair(L'\U000021B0', UnicodeNameInfo(L"lsh", L"Lsh")),
- make_pair(L'\U000021B1', UnicodeNameInfo(L"rsh", L"Rsh")),
- make_pair(L'\U000021B6', UnicodeNameInfo(L"cularr", L"curvearrowleft")),
- make_pair(L'\U000021B7', UnicodeNameInfo(L"curarr", L"curvearrowright")),
- make_pair(L'\U000021BA', UnicodeNameInfo(L"olarr", L"circlearrowleft")),
- make_pair(L'\U000021BB', UnicodeNameInfo(L"orarr", L"circlearrowright")),
- make_pair(L'\U000021BC', UnicodeNameInfo(L"lharu", L"leftharpoonup")),
- make_pair(L'\U000021BD', UnicodeNameInfo(L"lhard", L"leftharpoondown")),
- make_pair(L'\U000021BE', UnicodeNameInfo(L"uharr", L"upharpoonright")),
- make_pair(L'\U000021BF', UnicodeNameInfo(L"uharl", L"upharpoonleft")),
- make_pair(L'\U000021C0', UnicodeNameInfo(L"rharu", L"rightharpoonup")),
- make_pair(L'\U000021C1', UnicodeNameInfo(L"rhard", L"rightharpoondown")),
- make_pair(L'\U000021C2', UnicodeNameInfo(L"dharr", L"downharpoonright")),
- make_pair(L'\U000021C3', UnicodeNameInfo(L"dharl", L"downharpoonleft")),
- make_pair(L'\U000021C4', UnicodeNameInfo(L"rlarr", L"RightArrowLeftArrow")),
- make_pair(L'\U000021C6', UnicodeNameInfo(L"lrarr", L"LeftArrowRightArrow")),
- make_pair(L'\U000021C7', UnicodeNameInfo(L"llarr", L"leftleftarrows")),
- make_pair(L'\U000021C8', UnicodeNameInfo(L"uuarr", L"upuparrows")),
- make_pair(L'\U000021C9', UnicodeNameInfo(L"rrarr", L"rightrightarrows")),
- make_pair(L'\U000021CA', UnicodeNameInfo(L"ddarr", L"downdownarrows")),
- make_pair(L'\U000021CB', UnicodeNameInfo(L"lrhar", L"ReverseEquilibrium")),
- make_pair(L'\U000021CC', UnicodeNameInfo(L"rlhar", L"Equilibrium")),
- make_pair(L'\U000021CD', UnicodeNameInfo(L"nlArr", L"nLeftarrow")),
- make_pair(L'\U000021CE', UnicodeNameInfo(L"nhArr", L"nLeftrightarrow")),
- make_pair(L'\U000021CF', UnicodeNameInfo(L"nrArr", L"nRightarrow")),
- make_pair(L'\U000021D0', UnicodeNameInfo(L"lArr", L"DoubleLeftArrow")),
- make_pair(L'\U000021D1', UnicodeNameInfo(L"uArr", L"DoubleUpArrow")),
- make_pair(L'\U000021D2', UnicodeNameInfo(L"rArr", L"DoubleRightArrow")),
- make_pair(L'\U000021D3', UnicodeNameInfo(L"dArr", L"DoubleDownArrow")),
- make_pair(L'\U000021D4', UnicodeNameInfo(L"hArr", L"DoubleLeftRightArrow")),
- make_pair(L'\U000021D5', UnicodeNameInfo(L"vArr", L"DoubleUpDownArrow")),
- make_pair(L'\U000021DA', UnicodeNameInfo(L"lAarr", L"Lleftarrow")),
- make_pair(L'\U000021DB', UnicodeNameInfo(L"rAarr", L"Rrightarrow")),
- make_pair(L'\U000021DD', UnicodeNameInfo(L"zigrarr")),
- make_pair(L'\U00002200', UnicodeNameInfo(L"forall", L"ForAll")),
- make_pair(L'\U00002201', UnicodeNameInfo(L"comp", L"complement")),
- make_pair(L'\U00002202', UnicodeNameInfo(L"part", L"PartialD")),
- make_pair(L'\U00002203', UnicodeNameInfo(L"exist", L"Exists")),
- make_pair(L'\U00002204', UnicodeNameInfo(L"nexist", L"NotExists")),
- make_pair(L'\U00002205', UnicodeNameInfo(L"empty", L"emptyset")),
- make_pair(L'\U00002207', UnicodeNameInfo(L"nabla", L"Del")),
- make_pair(L'\U00002208', UnicodeNameInfo(L"in", L"Element")),
- make_pair(L'\U00002209', UnicodeNameInfo(L"notin", L"NotElement")),
- make_pair(L'\U0000220B', UnicodeNameInfo(L"ni", L"ReverseElement")),
- make_pair(L'\U0000220C', UnicodeNameInfo(L"notni", L"NotReverseElement")),
- make_pair(L'\U0000220F', UnicodeNameInfo(L"prod", L"Product")),
- make_pair(L'\U00002210', UnicodeNameInfo(L"coprod", L"Coproduct")),
- make_pair(L'\U00002211', UnicodeNameInfo(L"sum", L"Sum")),
- make_pair(L'\U00002213', UnicodeNameInfo(L"mp", L"MinusPlus")),
- make_pair(L'\U00002214', UnicodeNameInfo(L"dotplus")),
- make_pair(L'\U00002216', UnicodeNameInfo(L"setmn", L"Backslash")),
- make_pair(L'\U00002218', UnicodeNameInfo(L"compfn", L"SmallCircle")),
- make_pair(L'\U0000221A', UnicodeNameInfo(L"radic", L"Sqrt")),
- make_pair(L'\U0000221D', UnicodeNameInfo(L"prop", L"Proportional")),
- make_pair(L'\U0000221E', UnicodeNameInfo(L"infin")),
- make_pair(L'\U00002220', UnicodeNameInfo(L"ang", L"angle")),
- make_pair(L'\U00002221', UnicodeNameInfo(L"angmsd", L"measuredangle")),
- make_pair(L'\U00002222', UnicodeNameInfo(L"angsph")),
- make_pair(L'\U00002223', UnicodeNameInfo(L"mid", L"VerticalBar")),
- make_pair(L'\U00002224', UnicodeNameInfo(L"nmid", L"NotVerticalBar")),
- make_pair(L'\U00002225', UnicodeNameInfo(L"par", L"DoubleVerticalBar")),
- make_pair(L'\U00002226', UnicodeNameInfo(L"npar", L"NotDoubleVerticalBar")),
- make_pair(L'\U00002227', UnicodeNameInfo(L"and", L"wedge")),
- make_pair(L'\U00002228', UnicodeNameInfo(L"or", L"vee")),
- make_pair(L'\U00002229', UnicodeNameInfo(L"cap")),
- make_pair(L'\U0000222A', UnicodeNameInfo(L"cup")),
- make_pair(L'\U0000222B', UnicodeNameInfo(L"int", L"Integral")),
- make_pair(L'\U0000222C', UnicodeNameInfo(L"Int")),
- make_pair(L'\U0000222D', UnicodeNameInfo(L"tint", L"iiint")),
- make_pair(L'\U0000222E', UnicodeNameInfo(L"conint", L"ContourIntegral")),
- make_pair(L'\U00002234', UnicodeNameInfo(L"there4", L"Therefore")),
- make_pair(L'\U00002235', UnicodeNameInfo(L"becaus", L"Because")),
- make_pair(L'\U0000223C', UnicodeNameInfo(L"sim", L"Tilde")),
- make_pair(L'\U0000223D', UnicodeNameInfo(L"bsim", L"backsim")),
- make_pair(L'\U00002240', UnicodeNameInfo(L"wr", L"VerticalTilde")),
- make_pair(L'\U00002241', UnicodeNameInfo(L"nsim", L"NotTilde")),
- make_pair(L'\U00002242', UnicodeNameInfo(L"esim", L"EqualTilde")),
- make_pair(L'\U00002243', UnicodeNameInfo(L"sime", L"TildeEqual")),
- make_pair(L'\U00002244', UnicodeNameInfo(L"nsime", L"NotTildeEqual")),
- make_pair(L'\U00002245', UnicodeNameInfo(L"cong", L"TildeFullEqual")),
- make_pair(L'\U00002247', UnicodeNameInfo(L"ncong", L"NotTildeFullEqual")),
- make_pair(L'\U00002248', UnicodeNameInfo(L"ap", L"TildeTilde")),
- make_pair(L'\U00002249', UnicodeNameInfo(L"nap", L"NotTildeTilde")),
- make_pair(L'\U0000224A', UnicodeNameInfo(L"ape", L"approxeq")),
- make_pair(L'\U0000224E', UnicodeNameInfo(L"bump", L"HumpDownHump")),
- make_pair(L'\U0000224F', UnicodeNameInfo(L"nbump", L"NotHumpDownHump")),
- make_pair(L'\U00002250', UnicodeNameInfo(L"esdot", L"DotEqual")),
- make_pair(L'\U00002251', UnicodeNameInfo(L"eDot", L"doteqdot")),
- make_pair(L'\U00002252', UnicodeNameInfo(L"efDot", L"fallingdotseq")),
- make_pair(L'\U00002253', UnicodeNameInfo(L"erDot", L"risingdotseq")),
- make_pair(L'\U00002256', UnicodeNameInfo(L"ecir", L"eqcirc")),
- make_pair(L'\U00002257', UnicodeNameInfo(L"cire", L"circeq")),
- make_pair(L'\U0000225C', UnicodeNameInfo(L"trie", L"triangleq")),
- make_pair(L'\U00002260', UnicodeNameInfo(L"ne", L"NotEqual")),
- make_pair(L'\U00002261', UnicodeNameInfo(L"equiv", L"Congruent")),
- make_pair(L'\U00002262', UnicodeNameInfo(L"nequiv", L"NotCongruent")),
- make_pair(L'\U00002264', UnicodeNameInfo(L"le", L"leq")),
- make_pair(L'\U00002265', UnicodeNameInfo(L"ge", L"GreaterEqual")),
- make_pair(L'\U00002266', UnicodeNameInfo(L"lE", L"LessFullEqual")),
- make_pair(L'\U00002267', UnicodeNameInfo(L"gE", L"GreaterFullEqual")),
- make_pair(L'\U00002268', UnicodeNameInfo(L"lnE", L"lneqq")),
- make_pair(L'\U00002269', UnicodeNameInfo(L"gnE", L"gneqq")),
- make_pair(L'\U0000226A', UnicodeNameInfo(L"Lt", L"NestedLessLess")),
- make_pair(L'\U0000226B', UnicodeNameInfo(L"Gt", L"NestedGreaterGreater")),
- make_pair(L'\U0000226C', UnicodeNameInfo(L"twixt", L"between")),
- make_pair(L'\U0000226E', UnicodeNameInfo(L"nlt", L"NotLess")),
- make_pair(L'\U0000226F', UnicodeNameInfo(L"ngt", L"NotGreater")),
- make_pair(L'\U00002270', UnicodeNameInfo(L"nle", L"NotLessEqual")),
- make_pair(L'\U00002271', UnicodeNameInfo(L"nge", L"NotGreaterEqual")),
- make_pair(L'\U00002272', UnicodeNameInfo(L"lsim", L"LessTilde")),
- make_pair(L'\U00002273', UnicodeNameInfo(L"gsim", L"GreaterTilde")),
- make_pair(L'\U00002276', UnicodeNameInfo(L"lg", L"LessGreater")),
- make_pair(L'\U00002277', UnicodeNameInfo(L"gl", L"GreaterLess")),
- make_pair(L'\U0000227A', UnicodeNameInfo(L"pr", L"Precedes")),
- make_pair(L'\U0000227B', UnicodeNameInfo(L"sc", L"Succeeds")),
- make_pair(L'\U0000227C', UnicodeNameInfo(L"prcue", L"PrecedesSlantEqual")),
- make_pair(L'\U0000227D', UnicodeNameInfo(L"sccue", L"SucceedsSlantEqual")),
- make_pair(L'\U0000227E', UnicodeNameInfo(L"prsim", L"PrecedesTilde")),
- make_pair(L'\U0000227F', UnicodeNameInfo(L"scsim", L"SucceedsTilde")),
- make_pair(L'\U00002280', UnicodeNameInfo(L"npr", L"NotPrecedes")),
- make_pair(L'\U00002281', UnicodeNameInfo(L"nsc", L"NotSucceeds")),
- make_pair(L'\U00002282', UnicodeNameInfo(L"sub", L"subset")),
- make_pair(L'\U00002283', UnicodeNameInfo(L"sup", L"supset")),
- make_pair(L'\U00002284', UnicodeNameInfo(L"nsub")),
- make_pair(L'\U00002285', UnicodeNameInfo(L"nsup")),
- make_pair(L'\U00002286', UnicodeNameInfo(L"sube", L"SubsetEqual")),
- make_pair(L'\U00002287', UnicodeNameInfo(L"supe", L"SupersetEqual")),
- make_pair(L'\U00002288', UnicodeNameInfo(L"nsube", L"NotSubsetEqual")),
- make_pair(L'\U00002289', UnicodeNameInfo(L"nsupe", L"NotSupersetEqual")),
- make_pair(L'\U0000228A', UnicodeNameInfo(L"subne", L"subsetneq")),
- make_pair(L'\U0000228B', UnicodeNameInfo(L"supne", L"supsetneq")),
- make_pair(L'\U0000228E', UnicodeNameInfo(L"uplus", L"UnionPlus")),
- make_pair(L'\U0000228F', UnicodeNameInfo(L"sqsub", L"SquareSubset")),
- make_pair(L'\U00002290', UnicodeNameInfo(L"sqsup", L"SquareSuperset")),
- make_pair(L'\U00002291', UnicodeNameInfo(L"sqsube", L"SquareSubsetEqual")),
- make_pair(L'\U00002292', UnicodeNameInfo(L"sqsupe", L"SquareSupersetEqual")),
- make_pair(L'\U00002293', UnicodeNameInfo(L"sqcap", L"SquareIntersection")),
- make_pair(L'\U00002294', UnicodeNameInfo(L"sqcup", L"SquareUnion")),
- make_pair(L'\U00002295', UnicodeNameInfo(L"oplus", L"CirclePlus")),
- make_pair(L'\U00002296', UnicodeNameInfo(L"ominus", L"CircleMinus")),
- make_pair(L'\U00002297', UnicodeNameInfo(L"otimes", L"CircleTimes")),
- make_pair(L'\U00002298', UnicodeNameInfo(L"osol")),
- make_pair(L'\U00002299', UnicodeNameInfo(L"odot", L"CircleDot")),
- make_pair(L'\U0000229A', UnicodeNameInfo(L"ocir", L"circledcirc")),
- make_pair(L'\U0000229B', UnicodeNameInfo(L"oast", L"circledast")),
- make_pair(L'\U0000229D', UnicodeNameInfo(L"odash", L"circleddash")),
- make_pair(L'\U0000229E', UnicodeNameInfo(L"plusb", L"boxplus")),
- make_pair(L'\U0000229F', UnicodeNameInfo(L"minusb", L"boxminus")),
- make_pair(L'\U000022A0', UnicodeNameInfo(L"timesb", L"boxtimes")),
- make_pair(L'\U000022A1', UnicodeNameInfo(L"sdotb", L"dotsquare")),
- make_pair(L'\U000022A2', UnicodeNameInfo(L"vdash", L"RightTee")),
- make_pair(L'\U000022A3', UnicodeNameInfo(L"dashv", L"LeftTee")),
- make_pair(L'\U000022A4', UnicodeNameInfo(L"top", L"DownTee")),
- make_pair(L'\U000022A5', UnicodeNameInfo(L"bot", L"UpTee")),
- make_pair(L'\U000022A7', UnicodeNameInfo(L"models")),
- make_pair(L'\U000022A8', UnicodeNameInfo(L"vDash", L"DoubleRightTee")),
- make_pair(L'\U000022A9', UnicodeNameInfo(L"Vdash")),
- make_pair(L'\U000022AA', UnicodeNameInfo(L"Vvdash")),
- make_pair(L'\U000022AC', UnicodeNameInfo(L"nvdash")),
- make_pair(L'\U000022AD', UnicodeNameInfo(L"nvDash")),
- make_pair(L'\U000022AE', UnicodeNameInfo(L"nVdash")),
- make_pair(L'\U000022AF', UnicodeNameInfo(L"nVDash")),
- make_pair(L'\U000022B2', UnicodeNameInfo(L"vltri", L"LeftTriangle")),
- make_pair(L'\U000022B3', UnicodeNameInfo(L"vrtri", L"RightTriangle")),
- make_pair(L'\U000022B4', UnicodeNameInfo(L"ltrie", L"LeftTriangleEqual")),
- make_pair(L'\U000022B5', UnicodeNameInfo(L"rtrie", L"RightTriangleEqual")),
- make_pair(L'\U000022B8', UnicodeNameInfo(L"mumap", L"multimap")),
- make_pair(L'\U000022BA', UnicodeNameInfo(L"intcal", L"intercal")),
- make_pair(L'\U000022BB', UnicodeNameInfo(L"veebar")),
- make_pair(L'\U000022C0', UnicodeNameInfo(L"xwedge", L"Wedge")),
- make_pair(L'\U000022C1', UnicodeNameInfo(L"xvee", L"Vee")),
- make_pair(L'\U000022C2', UnicodeNameInfo(L"xcap", L"Intersection")),
- make_pair(L'\U000022C3', UnicodeNameInfo(L"xcup", L"Union")),
- make_pair(L'\U000022C4', UnicodeNameInfo(L"diam", L"Diamond")),
- make_pair(L'\U000022C5', UnicodeNameInfo(L"sdot")),
- make_pair(L'\U000022C6', UnicodeNameInfo(L"Star")),
- make_pair(L'\U000022C7', UnicodeNameInfo(L"divonx", L"divideontimes")),
- make_pair(L'\U000022C8', UnicodeNameInfo(L"bowtie")),
- make_pair(L'\U000022C9', UnicodeNameInfo(L"ltimes")),
- make_pair(L'\U000022CA', UnicodeNameInfo(L"rtimes")),
- make_pair(L'\U000022CB', UnicodeNameInfo(L"lthree", L"leftthreetimes")),
- make_pair(L'\U000022CC', UnicodeNameInfo(L"rthree", L"rightthreetimes")),
- make_pair(L'\U000022CD', UnicodeNameInfo(L"bsime", L"backsimeq")),
- make_pair(L'\U000022CE', UnicodeNameInfo(L"cuvee", L"curlyvee")),
- make_pair(L'\U000022CF', UnicodeNameInfo(L"cuwed", L"curlywedge")),
- make_pair(L'\U000022D0', UnicodeNameInfo(L"Sub", L"Subset")),
- make_pair(L'\U000022D1', UnicodeNameInfo(L"Sup", L"Supset")),
- make_pair(L'\U000022D2', UnicodeNameInfo(L"Cap")),
- make_pair(L'\U000022D3', UnicodeNameInfo(L"Cup")),
- make_pair(L'\U000022D4', UnicodeNameInfo(L"fork", L"pitchfork")),
- make_pair(L'\U000022D6', UnicodeNameInfo(L"ltdot", L"lessdot")),
- make_pair(L'\U000022D7', UnicodeNameInfo(L"gtdot", L"gtrdot")),
- make_pair(L'\U000022D8', UnicodeNameInfo(L"Ll")),
- make_pair(L'\U000022D9', UnicodeNameInfo(L"Gg")),
- make_pair(L'\U000022DA', UnicodeNameInfo(L"leg", L"LessEqualGreater")),
- make_pair(L'\U000022DB', UnicodeNameInfo(L"gel", L"GreaterEqualLess")),
- make_pair(L'\U000022DE', UnicodeNameInfo(L"cuepr", L"curlyeqprec")),
- make_pair(L'\U000022DF', UnicodeNameInfo(L"cuesc", L"curlyeqsucc")),
- make_pair(L'\U000022E2', UnicodeNameInfo(L"nsqsube", L"NotSquareSubsetEqual")),
- make_pair(L'\U000022E3', UnicodeNameInfo(L"nsqsupe", L"NotSquareSupersetEqual")),
- make_pair(L'\U000022E6', UnicodeNameInfo(L"lnsim")),
- make_pair(L'\U000022E7', UnicodeNameInfo(L"gnsim")),
- make_pair(L'\U000022E8', UnicodeNameInfo(L"prnsim", L"precnsim")),
- make_pair(L'\U000022E9', UnicodeNameInfo(L"scnsim", L"succnsim")),
- make_pair(L'\U000022EA', UnicodeNameInfo(L"nltri", L"NotLeftTriangle")),
- make_pair(L'\U000022EB', UnicodeNameInfo(L"nrtri", L"NotRightTriangle")),
- make_pair(L'\U000022EC', UnicodeNameInfo(L"nltrie", L"NotLeftTriangleEqual")),
- make_pair(L'\U000022ED', UnicodeNameInfo(L"nrtrie", L"NotRightTriangleEqual")),
- make_pair(L'\U000022EE', UnicodeNameInfo(L"vellip")),
- make_pair(L'\U000022EF', UnicodeNameInfo(L"ctdot")),
- make_pair(L'\U000022F1', UnicodeNameInfo(L"dtdot")),
- make_pair(L'\U00002305', UnicodeNameInfo(L"barwed", L"barwedge")),
- make_pair(L'\U00002306', UnicodeNameInfo(L"Barwed", L"doublebarwedge")),
- make_pair(L'\U00002308', UnicodeNameInfo(L"lceil", L"LeftCeiling")),
- make_pair(L'\U00002309', UnicodeNameInfo(L"rceil", L"RightCeiling")),
- make_pair(L'\U0000230A', UnicodeNameInfo(L"lfloor", L"LeftFloor")),
- make_pair(L'\U0000230B', UnicodeNameInfo(L"rfloor", L"RightFloor")),
- make_pair(L'\U0000231C', UnicodeNameInfo(L"ulcorn", L"ulcorner")),
- make_pair(L'\U0000231D', UnicodeNameInfo(L"urcorn", L"urcorner")),
- make_pair(L'\U0000231E', UnicodeNameInfo(L"dlcorn", L"llcorner")),
- make_pair(L'\U0000231F', UnicodeNameInfo(L"drcorn", L"lrcorner")),
- make_pair(L'\U00002322', UnicodeNameInfo(L"frown", L"sfrown")),
- make_pair(L'\U00002323', UnicodeNameInfo(L"smile", L"ssmile")),
- make_pair(L'\U000027E8', UnicodeNameInfo(L"lang", L"LeftAngleBracket")),
- make_pair(L'\U000027E9', UnicodeNameInfo(L"rang", L"RightAngleBracket")),
- make_pair(L'\U000023B5', UnicodeNameInfo(L"bbrk", L"UnderBracket")),
- make_pair(L'\U000024C8', UnicodeNameInfo(L"oS", L"circledS")),
- make_pair(L'\U000025A1', UnicodeNameInfo(L"squ", L"Square")),
- make_pair(L'\U000025B3', UnicodeNameInfo(L"xutri", L"bigtriangleup")),
- make_pair(L'\U000025B4', UnicodeNameInfo(L"utrif", L"blacktriangle")),
- make_pair(L'\U000025B5', UnicodeNameInfo(L"utri", L"triangle")),
- make_pair(L'\U000025B6', UnicodeNameInfo()),
- make_pair(L'\U000025B9', UnicodeNameInfo(L"rtri", L"triangleright")),
- make_pair(L'\U000025BD', UnicodeNameInfo(L"xdtri", L"bigtriangledown")),
- make_pair(L'\U000025BE', UnicodeNameInfo(L"dtrif", L"blacktriangledown")),
- make_pair(L'\U000025BF', UnicodeNameInfo(L"dtri", L"triangledown")),
- make_pair(L'\U000025C0', UnicodeNameInfo()),
- make_pair(L'\U000025C3', UnicodeNameInfo(L"ltri", L"triangleleft")),
- make_pair(L'\U000025CA', UnicodeNameInfo(L"loz", L"lozenge")),
- make_pair(L'\U000025EF', UnicodeNameInfo(L"xcirc", L"bigcirc")),
- make_pair(L'\U000025FC', UnicodeNameInfo(L"FilledSmallSquare")),
- make_pair(L'\U00002605', UnicodeNameInfo(L"starf", L"bigstar")),
- make_pair(L'\U00002660', UnicodeNameInfo(L"spades", L"spadesuit")),
- make_pair(L'\U00002663', UnicodeNameInfo(L"clubs", L"clubsuit")),
- make_pair(L'\U00002665', UnicodeNameInfo(L"hearts", L"heartsuit")),
- make_pair(L'\U00002666', UnicodeNameInfo(L"diams", L"diamondsuit")),
- make_pair(L'\U0000266D', UnicodeNameInfo(L"flat")),
- make_pair(L'\U0000266E', UnicodeNameInfo(L"natur", L"natural")),
- make_pair(L'\U0000266F', UnicodeNameInfo(L"sharp")),
- make_pair(L'\U00002713', UnicodeNameInfo(L"check", L"checkmark")),
- make_pair(L'\U00002720', UnicodeNameInfo(L"malt", L"maltese")),
- make_pair(L'\U000027F5', UnicodeNameInfo(L"xlarr", L"LongLeftArrow")),
- make_pair(L'\U000027F6', UnicodeNameInfo(L"xrarr", L"LongRightArrow")),
- make_pair(L'\U000027F7', UnicodeNameInfo(L"xharr", L"LongLeftRightArrow")),
- make_pair(L'\U000027F8', UnicodeNameInfo(L"xlArr", L"DoubleLongLeftArrow")),
- make_pair(L'\U000027F9', UnicodeNameInfo(L"xrArr", L"DoubleLongRightArrow")),
- make_pair(L'\U000027FA', UnicodeNameInfo(L"xhArr", L"DoubleLongLeftRightArrow")),
- make_pair(L'\U000027FC', UnicodeNameInfo(L"xmap", L"longMapsto")),
- make_pair(L'\U0000290E', UnicodeNameInfo(L"lBarr")),
- make_pair(L'\U0000290F', UnicodeNameInfo(L"rBarr", L"dbkarow")),
- make_pair(L'\U000029EB', UnicodeNameInfo(L"lozf", L"blacklozenge")),
- make_pair(L'\U00002A00', UnicodeNameInfo(L"xodot", L"bigodot")),
- make_pair(L'\U00002A01', UnicodeNameInfo(L"xoplus", L"bigoplus")),
- make_pair(L'\U00002A02', UnicodeNameInfo(L"xotime", L"bigotimes")),
- make_pair(L'\U00002A04', UnicodeNameInfo(L"xuplus", L"biguplus")),
- make_pair(L'\U00002A06', UnicodeNameInfo(L"xsqcup", L"bigsqcup")),
- make_pair(L'\U00002A0C', UnicodeNameInfo(L"qint", L"iiiint")),
- make_pair(L'\U00002A2F', UnicodeNameInfo(L"Cross")),
- make_pair(L'\U00002A3F', UnicodeNameInfo(L"amalg")),
- make_pair(L'\U00002A7D', UnicodeNameInfo(L"les", L"LessSlantEqual")),
- make_pair(L'\U00002A7E', UnicodeNameInfo(L"ges", L"GreaterSlantEqual")),
- make_pair(L'\U00002A85', UnicodeNameInfo(L"lap", L"lessapprox")),
- make_pair(L'\U00002A86', UnicodeNameInfo(L"gap", L"gtrapprox")),
- make_pair(L'\U00002A89', UnicodeNameInfo(L"lnap", L"lnapprox")),
- make_pair(L'\U00002A8A', UnicodeNameInfo(L"gnap", L"gnapprox")),
- make_pair(L'\U00002A8B', UnicodeNameInfo(L"lEg", L"lesseqqgtr")),
- make_pair(L'\U00002A8C', UnicodeNameInfo(L"gEl", L"gtreqqless")),
- make_pair(L'\U00002A95', UnicodeNameInfo(L"els", L"eqslantless")),
- make_pair(L'\U00002A96', UnicodeNameInfo(L"egs", L"eqslantgtr")),
- make_pair(L'\U00002AAF', UnicodeNameInfo(L"pre", L"PrecedesEqual")),
- make_pair(L'\U00002AB0', UnicodeNameInfo(L"sce", L"SucceedsEqual")),
- make_pair(L'\U00002AB5', UnicodeNameInfo(L"prnE", L"precneqq")),
- make_pair(L'\U00002AB6', UnicodeNameInfo(L"scnE", L"succneqq")),
- make_pair(L'\U00002AB7', UnicodeNameInfo(L"prap", L"precapprox")),
- make_pair(L'\U00002AB8', UnicodeNameInfo(L"scap", L"succapprox")),
- make_pair(L'\U00002AB9', UnicodeNameInfo(L"prnap", L"precnapprox")),
- make_pair(L'\U00002ABA', UnicodeNameInfo(L"scnap", L"succnapprox")),
- make_pair(L'\U00002AC5', UnicodeNameInfo(L"subE", L"subseteqq")),
- make_pair(L'\U00002AC6', UnicodeNameInfo(L"supE", L"supseteqq")),
- make_pair(L'\U00002ACB', UnicodeNameInfo(L"subnE", L"subsetneqq")),
- make_pair(L'\U00002ACC', UnicodeNameInfo(L"supnE", L"supsetneqq")),
- make_pair(L'\U0000FE00', UnicodeNameInfo()), // FIX: think about this combining character...
- make_pair(L'\U0000FE37', UnicodeNameInfo(L"OverBrace")),
- make_pair(L'\U0000FE38', UnicodeNameInfo(L"UnderBrace")),
- make_pair(L'\U0001D49C', UnicodeNameInfo(L"Ascr")),
- make_pair(L'\U0001D49E', UnicodeNameInfo(L"Cscr")),
- make_pair(L'\U0001D49F', UnicodeNameInfo(L"Dscr")),
- make_pair(L'\U0001D4A2', UnicodeNameInfo(L"Gscr")),
- make_pair(L'\U0001D4A5', UnicodeNameInfo(L"Jscr")),
- make_pair(L'\U0001D4A6', UnicodeNameInfo(L"Kscr")),
- make_pair(L'\U0001D4A9', UnicodeNameInfo(L"Nscr")),
- make_pair(L'\U0001D4AA', UnicodeNameInfo(L"Oscr")),
- make_pair(L'\U0001D4AB', UnicodeNameInfo(L"Pscr")),
- make_pair(L'\U0001D4AC', UnicodeNameInfo(L"Qscr")),
- make_pair(L'\U0001D4AE', UnicodeNameInfo(L"Sscr")),
- make_pair(L'\U0001D4AF', UnicodeNameInfo(L"Tscr")),
- make_pair(L'\U0001D4B0', UnicodeNameInfo(L"Uscr")),
- make_pair(L'\U0001D4B1', UnicodeNameInfo(L"Vscr")),
- make_pair(L'\U0001D4B2', UnicodeNameInfo(L"Wscr")),
- make_pair(L'\U0001D4B3', UnicodeNameInfo(L"Xscr")),
- make_pair(L'\U0001D4B4', UnicodeNameInfo(L"Yscr")),
- make_pair(L'\U0001D4B5', UnicodeNameInfo(L"Zscr")),
- make_pair(L'\U0001D4D0', UnicodeNameInfo()), // mathematical bold script capitals
- make_pair(L'\U0001D4D1', UnicodeNameInfo()),
- make_pair(L'\U0001D4D2', UnicodeNameInfo()),
- make_pair(L'\U0001D4D3', UnicodeNameInfo()),
- make_pair(L'\U0001D4D4', UnicodeNameInfo()),
- make_pair(L'\U0001D4D5', UnicodeNameInfo()),
- make_pair(L'\U0001D4D6', UnicodeNameInfo()),
- make_pair(L'\U0001D4D7', UnicodeNameInfo()),
- make_pair(L'\U0001D4D8', UnicodeNameInfo()),
- make_pair(L'\U0001D4D9', UnicodeNameInfo()),
- make_pair(L'\U0001D4DA', UnicodeNameInfo()),
- make_pair(L'\U0001D4DB', UnicodeNameInfo()),
- make_pair(L'\U0001D4DC', UnicodeNameInfo()),
- make_pair(L'\U0001D4DD', UnicodeNameInfo()),
- make_pair(L'\U0001D4DE', UnicodeNameInfo()),
- make_pair(L'\U0001D4DF', UnicodeNameInfo()),
- make_pair(L'\U0001D4E0', UnicodeNameInfo()),
- make_pair(L'\U0001D4E1', UnicodeNameInfo()),
- make_pair(L'\U0001D4E2', UnicodeNameInfo()),
- make_pair(L'\U0001D4E3', UnicodeNameInfo()),
- make_pair(L'\U0001D4E4', UnicodeNameInfo()),
- make_pair(L'\U0001D4E5', UnicodeNameInfo()),
- make_pair(L'\U0001D4E6', UnicodeNameInfo()),
- make_pair(L'\U0001D4E7', UnicodeNameInfo()),
- make_pair(L'\U0001D4E8', UnicodeNameInfo()),
- make_pair(L'\U0001D4E9', UnicodeNameInfo()),
- make_pair(L'\U0001D504', UnicodeNameInfo(L"Afr")),
- make_pair(L'\U0001D505', UnicodeNameInfo(L"Bfr")),
- make_pair(L'\U0001D507', UnicodeNameInfo(L"Dfr")),
- make_pair(L'\U0001D508', UnicodeNameInfo(L"Efr")),
- make_pair(L'\U0001D509', UnicodeNameInfo(L"Ffr")),
- make_pair(L'\U0001D50A', UnicodeNameInfo(L"Gfr")),
- make_pair(L'\U0001D50D', UnicodeNameInfo(L"Jfr")),
- make_pair(L'\U0001D50E', UnicodeNameInfo(L"Kfr")),
- make_pair(L'\U0001D50F', UnicodeNameInfo(L"Lfr")),
- make_pair(L'\U0001D510', UnicodeNameInfo(L"Mfr")),
- make_pair(L'\U0001D511', UnicodeNameInfo(L"Nfr")),
- make_pair(L'\U0001D512', UnicodeNameInfo(L"Ofr")),
- make_pair(L'\U0001D513', UnicodeNameInfo(L"Pfr")),
- make_pair(L'\U0001D514', UnicodeNameInfo(L"Qfr")),
- make_pair(L'\U0001D516', UnicodeNameInfo(L"Sfr")),
- make_pair(L'\U0001D517', UnicodeNameInfo(L"Tfr")),
- make_pair(L'\U0001D518', UnicodeNameInfo(L"Ufr")),
- make_pair(L'\U0001D519', UnicodeNameInfo(L"Vfr")),
- make_pair(L'\U0001D51A', UnicodeNameInfo(L"Wfr")),
- make_pair(L'\U0001D51B', UnicodeNameInfo(L"Xfr")),
- make_pair(L'\U0001D51C', UnicodeNameInfo(L"Yfr")),
- make_pair(L'\U0001D51E', UnicodeNameInfo(L"afr")),
- make_pair(L'\U0001D51F', UnicodeNameInfo(L"bfr")),
- make_pair(L'\U0001D520', UnicodeNameInfo(L"cfr")),
- make_pair(L'\U0001D521', UnicodeNameInfo(L"dfr")),
- make_pair(L'\U0001D522', UnicodeNameInfo(L"efr")),
- make_pair(L'\U0001D523', UnicodeNameInfo(L"ffr")),
- make_pair(L'\U0001D524', UnicodeNameInfo(L"gfr")),
- make_pair(L'\U0001D525', UnicodeNameInfo(L"hfr")),
- make_pair(L'\U0001D526', UnicodeNameInfo(L"ifr")),
- make_pair(L'\U0001D527', UnicodeNameInfo(L"jfr")),
- make_pair(L'\U0001D528', UnicodeNameInfo(L"kfr")),
- make_pair(L'\U0001D529', UnicodeNameInfo(L"lfr")),
- make_pair(L'\U0001D52A', UnicodeNameInfo(L"mfr")),
- make_pair(L'\U0001D52B', UnicodeNameInfo(L"nfr")),
- make_pair(L'\U0001D52C', UnicodeNameInfo(L"ofr")),
- make_pair(L'\U0001D52D', UnicodeNameInfo(L"pfr")),
- make_pair(L'\U0001D52E', UnicodeNameInfo(L"qfr")),
- make_pair(L'\U0001D52F', UnicodeNameInfo(L"rfr")),
- make_pair(L'\U0001D530', UnicodeNameInfo(L"sfr")),
- make_pair(L'\U0001D531', UnicodeNameInfo(L"tfr")),
- make_pair(L'\U0001D532', UnicodeNameInfo(L"ufr")),
- make_pair(L'\U0001D533', UnicodeNameInfo(L"vfr")),
- make_pair(L'\U0001D534', UnicodeNameInfo(L"wfr")),
- make_pair(L'\U0001D535', UnicodeNameInfo(L"xfr")),
- make_pair(L'\U0001D536', UnicodeNameInfo(L"yfr")),
- make_pair(L'\U0001D537', UnicodeNameInfo(L"zfr")),
- make_pair(L'\U0001D538', UnicodeNameInfo(L"Aopf")),
- make_pair(L'\U0001D539', UnicodeNameInfo(L"Bopf")),
- make_pair(L'\U0001D53B', UnicodeNameInfo(L"Dopf")),
- make_pair(L'\U0001D53C', UnicodeNameInfo(L"Eopf")),
- make_pair(L'\U0001D53D', UnicodeNameInfo(L"Fopf")),
- make_pair(L'\U0001D53E', UnicodeNameInfo(L"Gopf")),
- make_pair(L'\U0001D540', UnicodeNameInfo(L"Iopf")),
- make_pair(L'\U0001D541', UnicodeNameInfo(L"Jopf")),
- make_pair(L'\U0001D542', UnicodeNameInfo(L"Kopf")),
- make_pair(L'\U0001D543', UnicodeNameInfo(L"Lopf")),
- make_pair(L'\U0001D544', UnicodeNameInfo(L"Mopf")),
- make_pair(L'\U0001D546', UnicodeNameInfo(L"Oopf")),
- make_pair(L'\U0001D54A', UnicodeNameInfo(L"Sopf")),
- make_pair(L'\U0001D54B', UnicodeNameInfo(L"Topf")),
- make_pair(L'\U0001D54C', UnicodeNameInfo(L"Uopf")),
- make_pair(L'\U0001D54D', UnicodeNameInfo(L"Vopf")),
- make_pair(L'\U0001D54E', UnicodeNameInfo(L"Wopf")),
- make_pair(L'\U0001D54F', UnicodeNameInfo(L"Xopf")),
- make_pair(L'\U0001D550', UnicodeNameInfo(L"Yopf")),
- make_pair(L'\U0001D55C', UnicodeNameInfo(L"kopf")),
- make_pair(L'\U0001D6A5', UnicodeNameInfo())
-};
-
-wishful_hash_map<wchar_t, UnicodeNameInfo> gUnicodeNameTable(
- gUnicodeNameArray,
- END_ARRAY(gUnicodeNameArray)
-);
-
-
-// FIX:
-// Need to read about and think about combining characters.
-// In particular, does the current strategy work for *named* entities
-// and combining characters? I'm not sure.
-
-
-// XmlEncode() handles conversion of non-ASCII characters to entities.
-// It uses the "options" parameter and gUnicodeNameTable to decide how to
-// translate each character.
-wstring XmlEncode(
- const wstring& input,
- const EncodingOptions& options
-)
-{
- wostringstream os;
- for (wstring::const_iterator
- ptr = input.begin(); ptr != input.end(); ptr++
- )
- {
- if (*ptr == L'&')
- os << L"&amp;";
- else if (*ptr == L'<')
- os << L"&lt;";
- else if (*ptr == L'>')
- os << L"&gt;";
- else if (*ptr <= 0x7F)
- os << *ptr;
- else
- {
- wishful_hash_map<wchar_t, UnicodeNameInfo>::const_iterator
- search = gUnicodeNameTable.find(*ptr);
-
- if (search == gUnicodeNameTable.end())
- {
- if (options.mOtherEncodingRaw)
- os << *ptr;
- else
- os << L"&#x" << hex
- << static_cast<unsigned>(*ptr) << L";";
- }
- else
- {
- EncodingOptions::MathmlEncoding encoding
- = options.mMathmlEncoding;
-
- // Deal with plane-1 characters.
- if (!options.mAllowPlane1 &&
- static_cast<unsigned>(*ptr) >= 0x10000 &&
- (
- encoding == EncodingOptions::cMathmlEncodingNumeric
- ||
- encoding == EncodingOptions::cMathmlEncodingRaw
- )
- )
- {
- encoding = EncodingOptions::cMathmlEncodingShort;
- }
-
- // Notice the missing "break"s in this switch statement.
- // We are falling back on other encoding methods if certain
- // ones aren't available.
- switch (encoding)
- {
- case EncodingOptions::cMathmlEncodingLong:
- if (!search->second.mLongName.empty())
- {
- os << L"&" << search->second.mLongName << L";";
- break;
- }
-
- case EncodingOptions::cMathmlEncodingShort:
- if (!search->second.mShortName.empty())
- {
- os << L"&" << search->second.mShortName << L";";
- break;
- }
-
- case EncodingOptions::cMathmlEncodingNumeric:
- os << L"&#x" << hex << static_cast<unsigned>(*ptr)
- << L";";
- break;
-
- case EncodingOptions::cMathmlEncodingRaw:
- os << *ptr;
- break;
- }
-
- }
- }
- }
-
- return os.str();
-}
-
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexCore/XmlEncode.h b/blahtexml/source/BlahtexCore/XmlEncode.h
deleted file mode 100644
index fd376be..0000000
--- a/blahtexml/source/BlahtexCore/XmlEncode.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// File "XmlEncode.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_XMLENCODE_H
-#define BLAHTEX_XMLENCODE_H
-
-#include <string>
-#include "Misc.h"
-
-namespace blahtex
-{
-
-// Encodes the given string as XML using the supplied options.
-// (See Misc.h for explanation of EncodingOptions.)
-extern std::wstring XmlEncode(
- const std::wstring& input,
- const EncodingOptions& options
-);
-
-
-}
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/BlahtexXMLin/AttributesImpl.cpp b/blahtexml/source/BlahtexXMLin/AttributesImpl.cpp
deleted file mode 100644
index 26876ab..0000000
--- a/blahtexml/source/BlahtexXMLin/AttributesImpl.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-// File "AttributesImpl.cpp"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include "AttributesImpl.h"
-
-AttributesImpl::AttributesImpl()
-{
-}
-
-AttributesImpl::AttributesImpl(const Attributes& attributes)
-{
- for(unsigned int i=0; i<attributes.getLength(); ++i) {
- Attribute attribute;
- attribute.qName = XercesString(attributes.getQName(i));
- attribute.uri = XercesString(attributes.getURI(i));
- attribute.localPart = XercesString(attributes.getLocalName(i));
- attribute.value = XercesString(attributes.getValue(i));
- attribute.type = XercesString(attributes.getType(i));
- theAttributes.push_back(attribute);
- }
-}
-
-unsigned int AttributesImpl::getLength() const
-{
- return theAttributes.size();
-}
-
-const XMLCh* AttributesImpl::getURI(const unsigned int index) const
-{
- return theAttributes[index].uri.c_str();
-}
-
-const XMLCh* AttributesImpl::getLocalName(const unsigned int index) const
-{
- return theAttributes[index].localPart.c_str();
-}
-
-const XMLCh* AttributesImpl::getQName(const unsigned int index) const
-{
- return theAttributes[index].qName.c_str();
-}
-
-const XMLCh* AttributesImpl::getType(const unsigned int index) const
-{
- return theAttributes[index].type.c_str();
-}
-
-const XMLCh* AttributesImpl::getValue(const unsigned int index) const
-{
- return theAttributes[index].value.c_str();
-}
-
-int AttributesImpl::getIndex(const XMLCh* const uri, const XMLCh* const localPart) const
-{
- for(unsigned int i=0;i<theAttributes.size();i++)
- if(XMLString::equals(getURI(i), uri) && XMLString::equals(getLocalName(i), localPart))
- return i;
- return -1;
-}
-
-int AttributesImpl::getIndex(const XMLCh* const qName ) const
-{
- for(unsigned int i=0;i<theAttributes.size();i++)
- if(XMLString::equals(getQName(i), qName))
- return i;
- return -1;
-}
-
-const XMLCh* AttributesImpl::getType(const XMLCh* const uri, const XMLCh* const localPart ) const
-{
- for(unsigned int i=0;i<theAttributes.size();i++)
- if(XMLString::equals(getURI(i), uri) && XMLString::equals(getLocalName(i), localPart))
- return getType(i);
- return NULL;
-}
-
-const XMLCh* AttributesImpl::getType(const XMLCh* const qName) const
-{
- for(unsigned int i=0;i<theAttributes.size();i++)
- if(XMLString::equals(getQName(i), qName))
- return getType(i);
- return NULL;
-}
-
-const XMLCh* AttributesImpl::getValue(const XMLCh* const uri, const XMLCh* const localPart ) const
-{
- for(unsigned int i=0;i<theAttributes.size();i++)
- if(XMLString::equals(getURI(i), uri) && XMLString::equals(getLocalName(i), localPart))
- return getValue(i);
- return NULL;
-}
-
-const XMLCh* AttributesImpl::getValue(const XMLCh* const qName) const
-{
- for(unsigned int i=0;i<theAttributes.size();i++)
- if(XMLString::equals(getQName(i), qName))
- return getValue(i);
- return NULL;
-}
-
-void AttributesImpl::removeAttribute(const unsigned int index)
-{
- theAttributes.erase(theAttributes.begin()+index);
-}
-
-void AttributesImpl::addAttribute(const XercesString& qName, const XercesString& uri, const XercesString& localPart, const XercesString& value, const XercesString& type)
-{
- Attribute attribute;
- attribute.qName = qName;
- attribute.uri = uri;
- attribute.localPart = localPart;
- attribute.value = value;
- attribute.type = type;
- theAttributes.push_back(attribute);
-}
diff --git a/blahtexml/source/BlahtexXMLin/AttributesImpl.h b/blahtexml/source/BlahtexXMLin/AttributesImpl.h
deleted file mode 100644
index 9ee3afd..0000000
--- a/blahtexml/source/BlahtexXMLin/AttributesImpl.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// File "AttributesImpl.h"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef ATTRIBUTESIMPL_H
-#define ATTRIBUTESIMPL_H
-
-#include <string>
-#include <vector>
-#include <xercesc/sax2/Attributes.hpp>
-#include <xercesc/util/XMLString.hpp>
-#include "XercesString.h"
-
-XERCES_CPP_NAMESPACE_USE
-using namespace std;
-
-struct Attribute {
- XercesString qName;
- XercesString uri;
- XercesString localPart;
- XercesString value;
- XercesString type;
-};
-
-class AttributesImpl : public Attributes
-{
-private:
- vector<Attribute> theAttributes;
-public:
- AttributesImpl();
- AttributesImpl(const Attributes& attributes);
- virtual unsigned int getLength() const;
- virtual const XMLCh* getURI(const unsigned int index) const;
- virtual const XMLCh* getLocalName(const unsigned int index) const;
- virtual const XMLCh* getQName(const unsigned int index) const;
- virtual const XMLCh* getType(const unsigned int index) const;
- virtual const XMLCh* getValue(const unsigned int index) const;
- virtual int getIndex(const XMLCh* const uri, const XMLCh* const localPart ) const;
- virtual int getIndex(const XMLCh* const qName ) const;
- virtual const XMLCh* getType(const XMLCh* const uri, const XMLCh* const localPart ) const;
- virtual const XMLCh* getType(const XMLCh* const qName) const;
- virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh* const localPart ) const;
- virtual const XMLCh* getValue(const XMLCh* const qName) const;
- void removeAttribute(const unsigned int index);
- void addAttribute(const XercesString& qName, const XercesString& uri, const XercesString& localPart, const XercesString& value, const XercesString& type);
-};
-
-#endif
diff --git a/blahtexml/source/BlahtexXMLin/BlahtexFilter.cpp b/blahtexml/source/BlahtexXMLin/BlahtexFilter.cpp
deleted file mode 100644
index 87f095d..0000000
--- a/blahtexml/source/BlahtexXMLin/BlahtexFilter.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-// File "BlahtexFilter.cpp"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include "AttributesImpl.h"
-#include "BlahtexFilter.h"
-#include "XercesString.h"
-#include <iostream>
-#include <xercesc/framework/StdInInputSource.hpp>
-#include <xercesc/framework/XMLFormatter.hpp>
-#include <xercesc/parsers/SAX2XMLFilterImpl.hpp>
-#include <xercesc/sax2/Attributes.hpp>
-#include <xercesc/sax2/SAX2XMLReader.hpp>
-#include <xercesc/sax2/XMLReaderFactory.hpp>
-#include <xercesc/util/OutOfMemoryException.hpp>
-#include <xercesc/util/PlatformUtils.hpp>
-#include <xercesc/util/TransService.hpp>
-#include <xercesc/util/XMLString.hpp>
-#include <xercesc/util/XMLUniDefs.hpp>
-
-using namespace std;
-
-extern wstring GetErrorMessage(const blahtex::Exception& e);
-
-BlahtexFilter::BlahtexFilter(SAX2XMLReader* parent, blahtex::Interface& anInterface)
- : SAX2XMLFilterImpl(parent), interface(anInterface), numberOfErrors(0)
-{
-}
-
-BlahtexFilter::~BlahtexFilter()
-{
-}
-
-void BlahtexFilter::startElement(const XMLCh* const uri, const XMLCh* const localname,
- const XMLCh* const qname, const Attributes& attributes)
-{
- static AttributesImpl emptyAttributes;
- static XercesString empty;
- static XercesString blahtexmlNamespace("http://gva.noekeon.org/blahtexml");
- static XercesString m("m");
- static XercesString inlin("inline");
- static XercesString block("block");
- static XercesString error("error");
- static XercesString display("display");
-
- bool blockMode = false;
- bool encloseInMathTag = false;
- int eqAttrIndex = attributes.getIndex(blahtexmlNamespace.c_str(), m.c_str());
- if (eqAttrIndex < 0) {
- eqAttrIndex = attributes.getIndex(blahtexmlNamespace.c_str(), inlin.c_str());
- encloseInMathTag = (eqAttrIndex >= 0);
- }
- if (eqAttrIndex < 0) {
- eqAttrIndex = attributes.getIndex(blahtexmlNamespace.c_str(), block.c_str());
- encloseInMathTag = (eqAttrIndex >= 0);
- blockMode = (eqAttrIndex >= 0);
- }
- if (eqAttrIndex >= 0) {
- try {
- XercesString inputXerces(attributes.getValue(eqAttrIndex));
- wstring input = inputXerces.convertTowstring();
- interface.ProcessInput(input);
-
- AttributesImpl newAttributes(attributes);
- newAttributes.removeAttribute(eqAttrIndex);
- SAX2XMLFilterImpl::startElement(uri, localname, qname, newAttributes);
-
- XercesString MathMLnamespace("http://www.w3.org/1998/Math/MathML");
- XercesString unprefixedMath(L"math");
- wstring MathMLprefix;
- bool MathMLexistingNamespace = getMathMLprefix(MathMLprefix);
- if ((desiredMathMLPrefixType == PrefixNone) && (!(MathMLprefix == L""))) {
- MathMLexistingNamespace = false;
- MathMLprefix = L"";
- }
- if ((desiredMathMLPrefixType == PrefixAdd) && (!(MathMLprefix == desiredMathMLPrefix))) {
- MathMLexistingNamespace = false;
- MathMLprefix = desiredMathMLPrefix;
- }
- XercesString MathMLprefix_(MathMLprefix);
-
- if (!MathMLexistingNamespace)
- SAX2XMLFilterImpl::startPrefixMapping(MathMLprefix_.c_str(), MathMLnamespace.c_str());
- XercesString prefixedMath((MathMLprefix == L"") ? L"math" : (MathMLprefix + L":math"));
- if (encloseInMathTag) {
- AttributesImpl mathAttributes;
- if (blockMode)
- mathAttributes.addAttribute(display.c_str(), empty.c_str(), display.c_str(), block.c_str(), empty.c_str());
- SAX2XMLFilterImpl::startElement(MathMLnamespace.c_str(), unprefixedMath.c_str(), prefixedMath.c_str(), mathAttributes);
- }
- interface.PrintAsSAX2(*this, MathMLprefix, true);
- if (encloseInMathTag)
- SAX2XMLFilterImpl::endElement(MathMLnamespace.c_str(), unprefixedMath.c_str(), prefixedMath.c_str());
- if (!MathMLexistingNamespace)
- SAX2XMLFilterImpl::endPrefixMapping(MathMLprefix_.c_str());
- }
- catch (blahtex::Exception& e) {
- wstring output = GetErrorMessage(e);
- XercesString outputXerces(output);
- SAX2XMLFilterImpl::startElement(uri, localname, qname, attributes);
- SAX2XMLFilterImpl::startPrefixMapping(empty.c_str(), blahtexmlNamespace.c_str());
- SAX2XMLFilterImpl::startElement(blahtexmlNamespace.c_str(), error.c_str(), error.c_str(), emptyAttributes);
- SAX2XMLFilterImpl::characters(outputXerces.data(), outputXerces.length());
- SAX2XMLFilterImpl::endElement(blahtexmlNamespace.c_str(), error.c_str(), error.c_str());
- SAX2XMLFilterImpl::endPrefixMapping(empty.c_str());
- numberOfErrors++;
- }
- }
- else {
- SAX2XMLFilterImpl::startElement(uri, localname, qname, attributes);
- }
-}
-
-void BlahtexFilter::startPrefixMapping(const XMLCh* const prefix, const XMLCh* const uri)
-{
- XercesString prefixXerces(prefix), uriXerces(uri);
- pair<wstring, wstring> context(prefixXerces.convertTowstring(), uriXerces.convertTowstring());
- namespaceContext.push_front(context);
- SAX2XMLFilterImpl::startPrefixMapping(prefix, uri);
-}
-
-void BlahtexFilter::endPrefixMapping(const XMLCh* const prefix)
-{
- XercesString prefixXerces(prefix);
- wstring prefixwstring=prefixXerces.convertTowstring();
- for(list_wstring2::iterator i=namespaceContext.begin(); i != namespaceContext.end(); ++i) {
- if ((*i).first == prefixwstring) {
- namespaceContext.erase(i);
- break;
- }
- }
- SAX2XMLFilterImpl::endPrefixMapping(prefix);
-}
-
-bool BlahtexFilter::getMathMLprefix(wstring& prefix)
-{
- for(list_wstring2::iterator i=namespaceContext.begin(); i != namespaceContext.end(); ++i) {
- if ((*i).second == L"http://www.w3.org/1998/Math/MathML") {
- prefix = (*i).first;
- return true;
- }
- }
- prefix = L"";
- return false;
-}
-
-int BlahtexFilter::getNumberOfErrors()
-{
- return numberOfErrors;
-}
-
-void BlahtexFilter::setDesiredMathMLPrefixType(PrefixType aPrefixType, const wstring& aPrefix)
-{
- desiredMathMLPrefixType = aPrefixType;
- desiredMathMLPrefix = aPrefix;
-}
diff --git a/blahtexml/source/BlahtexXMLin/BlahtexFilter.h b/blahtexml/source/BlahtexXMLin/BlahtexFilter.h
deleted file mode 100644
index de63ca2..0000000
--- a/blahtexml/source/BlahtexXMLin/BlahtexFilter.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// File "BlahtexFilter.h"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <list>
-#include <string>
-#include <utility>
-#include <xercesc/parsers/SAX2XMLFilterImpl.hpp>
-#include "../BlahtexCore/Interface.h"
-
-XERCES_CPP_NAMESPACE_USE
-
-typedef list<pair<wstring, wstring> > list_wstring2;
-
-class BlahtexFilter : public SAX2XMLFilterImpl
-{
-public:
- typedef enum { PrefixAuto, PrefixNone, PrefixAdd } PrefixType;
-protected:
- blahtex::Interface& interface;
- list_wstring2 namespaceContext;
- int numberOfErrors;
- PrefixType desiredMathMLPrefixType;
- wstring desiredMathMLPrefix;
-public:
- BlahtexFilter(SAX2XMLReader* parent, blahtex::Interface& anInterface);
- ~BlahtexFilter();
- virtual void startElement(const XMLCh* const uri, const XMLCh* const localname,
- const XMLCh* const qname, const Attributes& attributes);
- virtual void startPrefixMapping(const XMLCh* const prefix, const XMLCh* const uri);
- virtual void endPrefixMapping(const XMLCh* const prefix);
- int getNumberOfErrors();
- void setDesiredMathMLPrefixType(PrefixType aPrefixType, const wstring& aPrefix);
-protected:
- bool getMathMLprefix(wstring& prefix);
-};
diff --git a/blahtexml/source/BlahtexXMLin/SAX2Output.cpp b/blahtexml/source/BlahtexXMLin/SAX2Output.cpp
deleted file mode 100644
index d615551..0000000
--- a/blahtexml/source/BlahtexXMLin/SAX2Output.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-// File "SAX2Output.cpp"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <iostream>
-#include <xercesc/sax2/Attributes.hpp>
-#include <xercesc/util/XMLUniDefs.hpp>
-#include "SAX2Output.h"
-#include "XercesString.h"
-
-XERCES_CPP_NAMESPACE_USE
-using namespace std;
-
-SAX2Output::SAX2Output(ostream& aOut, const char* const encodingName,
- const XMLFormatter::UnRepFlags unRepFlags)
- : out(aOut), format(encodingName, 0, this, XMLFormatter::NoEscapes, unRepFlags),
- doctype(DoctypeNone), publicID(), DTD(), rootElementEncountered(false)
-{
- xmlDeclaration(encodingName);
-}
-
-SAX2Output::SAX2Output(ostream& aOut, const char* const encodingName,
- const XMLFormatter::UnRepFlags unRepFlags,
- Doctype aDoctype, const XercesString& aPublicID, const XercesString& aDTD)
- : out(aOut), format(encodingName, 0, this, XMLFormatter::NoEscapes, unRepFlags),
- doctype(aDoctype), publicID(aPublicID), DTD(aDTD), rootElementEncountered(false)
-{
- xmlDeclaration(encodingName);
-}
-
-SAX2Output::~SAX2Output()
-{
-}
-
-void SAX2Output::writeChars(const XMLByte* const toWrite,
- const unsigned int count, XMLFormatter* const formatter)
-{
- out.write((const char*)toWrite, count);
- out << std::flush;
-}
-
-void SAX2Output::error(const SAXParseException& e)
-{
- cerr << endl
- << "!!! Parsing error at " << XercesString(e.getSystemId()) << ":" << e.getLineNumber()
- << ":" << e.getColumnNumber() << " : " << XercesString(e.getMessage()) << endl;
-}
-
-void SAX2Output::fatalError(const SAXParseException& e)
-{
- cerr << endl
- << "!!! Fatal parsing error at " << XercesString(e.getSystemId()) << ":" << e.getLineNumber()
- << ":" << e.getColumnNumber() << " : " << XercesString(e.getMessage()) << endl;
-}
-
-void SAX2Output::warning(const SAXParseException& e)
-{
- cerr << endl
- << "!!! Parsing warning at " << XercesString(e.getSystemId()) << ":" << e.getLineNumber()
- << ":" << e.getColumnNumber() << " : " << XercesString(e.getMessage()) << endl;
-}
-
-void SAX2Output::characters(const XMLCh* const chars,
- const unsigned int length)
-{
- format.formatBuf(chars, length, XMLFormatter::CharEscapes);
-}
-
-void SAX2Output::endElement(const XMLCh* const uri,
- const XMLCh* const localname, const XMLCh* const qname)
-{
- format << XMLFormatter::NoEscapes << chOpenAngle << chForwardSlash << qname << chCloseAngle;
-}
-
-void SAX2Output::ignorableWhitespace(const XMLCh* const chars,
- const unsigned int length)
-{
- format.formatBuf(chars, length, XMLFormatter::NoEscapes);
-}
-
-void SAX2Output::processingInstruction(const XMLCh* const target,
- const XMLCh* const data)
-{
- format << XMLFormatter::NoEscapes << chOpenAngle << chQuestion << target;
- if (data) format << chSpace << data;
- format << XMLFormatter::NoEscapes << chQuestion << chCloseAngle;
-}
-
-void SAX2Output::startElement(const XMLCh* const uri, const XMLCh* const localname,
- const XMLCh* const qname, const Attributes& attributes)
-{
- if(!rootElementEncountered) {
- doctypeDeclaration(qname);
- rootElementEncountered = true;
- }
- format << XMLFormatter::NoEscapes << chOpenAngle ;
- format << qname ;
-
- XercesString xmlns("xmlns");
- for(list<pair<XercesString, XercesString> >::const_iterator i=prefixMappings.begin(); i!=prefixMappings.end(); ++i) {
- format << XMLFormatter::NoEscapes << chSpace;
- if ((*i).first.size() > 0)
- format << xmlns.c_str() << chColon << (*i).first.c_str();
- else
- format << xmlns.c_str();
- format << chEqual << chDoubleQuote << XMLFormatter::AttrEscapes << (*i).second.c_str()
- << XMLFormatter::NoEscapes << chDoubleQuote;
- }
- prefixMappings.clear();
-
- unsigned int len = attributes.getLength();
- for (unsigned int index=0; index<len; ++index) {
- format << XMLFormatter::NoEscapes << chSpace << attributes.getQName(index)
- << chEqual << chDoubleQuote
- << XMLFormatter::AttrEscapes << attributes.getValue(index)
- << XMLFormatter::NoEscapes << chDoubleQuote;
- }
- format << chCloseAngle;
-}
-
-void SAX2Output::startPrefixMapping(const XMLCh* const prefix, const XMLCh* const uri)
-{
- prefixMappings.push_back(pair<XercesString, XercesString>(XercesString(prefix), XercesString(uri)));
-}
-
-void SAX2Output::xmlDeclaration(const char* const encodingName)
-{
- static XercesString xmlDeclaration1("<?xml version=\"1.0\" encoding=\"");
- XercesString xmlDeclaration2(encodingName);
- static XercesString xmlDeclaration3("\"?>");
- format << xmlDeclaration1.c_str() << xmlDeclaration2.c_str() << xmlDeclaration3.c_str() << chLF;
-}
-
-void SAX2Output::doctypeDeclaration(const XMLCh* const qname)
-{
- static XercesString doctypeDeclaration("<!DOCTYPE");
- static XercesString systemDeclaration("SYSTEM");
- static XercesString publicDeclaration("PUBLIC");
- if((doctype == DoctypeSystem) || (doctype == DoctypePublic)) {
- format << XMLFormatter::NoEscapes << doctypeDeclaration.c_str() << chSpace
- << qname << chSpace;
- if (doctype == DoctypeSystem)
- format << XMLFormatter::NoEscapes << systemDeclaration.c_str() << chSpace;
- else {
- format << XMLFormatter::NoEscapes << publicDeclaration.c_str() << chSpace;
- format << XMLFormatter::NoEscapes << chDoubleQuote << publicID.c_str() << chDoubleQuote << chSpace;
- }
- format << XMLFormatter::NoEscapes << chDoubleQuote << DTD.c_str() << chDoubleQuote << chCloseAngle << chLF;
- }
-}
diff --git a/blahtexml/source/BlahtexXMLin/SAX2Output.h b/blahtexml/source/BlahtexXMLin/SAX2Output.h
deleted file mode 100644
index f803aef..0000000
--- a/blahtexml/source/BlahtexXMLin/SAX2Output.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// File "SAX2Output.h"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <list>
-#include <utility>
-#include <xercesc/sax2/DefaultHandler.hpp>
-#include <xercesc/framework/XMLFormatter.hpp>
-#include "XercesString.h"
-
-XERCES_CPP_NAMESPACE_USE
-
-class SAX2Output : public DefaultHandler, private XMLFormatTarget
-{
-public:
- typedef enum { DoctypeNone=0, DoctypeSystem, DoctypePublic } Doctype;
-protected:
- ostream& out;
- std::list<std::pair<XercesString, XercesString> > prefixMappings;
- XMLFormatter format;
- Doctype doctype;
- XercesString publicID, DTD;
- bool rootElementEncountered;
-public:
- SAX2Output(ostream& aOut, const char* const encodingName, const XMLFormatter::UnRepFlags unRepFlags);
- SAX2Output(ostream& aOut, const char* const encodingName, const XMLFormatter::UnRepFlags unRepFlags,
- Doctype aDoctype, const XercesString& aPublicID, const XercesString& aDTD);
- ~SAX2Output();
- virtual void characters(const XMLCh* const chars, const unsigned int length);
- virtual void endElement( const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname);
- virtual void error(const SAXParseException& e);
- virtual void fatalError(const SAXParseException& e);
- virtual void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
- virtual void processingInstruction(const XMLCh* const target, const XMLCh* const data);
- virtual void startElement(const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname, const Attributes& attributes);
- virtual void startPrefixMapping(const XMLCh* const prefix, const XMLCh* const uri);
- virtual void warning(const SAXParseException& e);
- virtual void writeChars(const XMLByte* const toWrite, const unsigned int count, XMLFormatter* const formatter);
-private:
- void xmlDeclaration(const char* const encodingName);
- void doctypeDeclaration(const XMLCh* const qname);
-};
diff --git a/blahtexml/source/BlahtexXMLin/XercesString.cpp b/blahtexml/source/BlahtexXMLin/XercesString.cpp
deleted file mode 100644
index 69c8613..0000000
--- a/blahtexml/source/BlahtexXMLin/XercesString.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-// File "XercesString.cpp"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <iostream>
-#include "XercesString.h"
-
-XercesString::XercesString()
- : basic_string<XMLCh>()
-{
-}
-
-XercesString::XercesString(const XMLCh *s)
- : basic_string<XMLCh>(s)
-{
-}
-
-XercesString::XercesString(const char *s)
- : basic_string<XMLCh>()
-{
- XMLCh *Xs = XMLString::transcode(s);
- assign(Xs);
- XMLString::release(&Xs);
-}
-
-XercesString::XercesString(const wstring& in)
- : basic_string<XMLCh>()
-{
- for(unsigned int i=0; i<in.length(); ++i) {
- wchar_t utf32 = in[i];
- if (utf32 >= 0x10000UL) {
- push_back(0xD800 - 0x40 + (utf32 >> 10));
- push_back(0xDC00 + (utf32 & 0x3FF));
- }
- else
- push_back(utf32);
- }
-}
-
-wstring XercesString::convertTowstring()
-{
- wstring out;
- wchar_t ucs4;
- bool firstSurrogate = false;
- for(unsigned int i=0; i<length(); ++i) {
- XMLCh utf16 = at(i);
- if (firstSurrogate) {
- if ((utf16 & 0xFC00) == 0xDC00) {
- ucs4 += utf16-0xDC00UL+0x10000UL;
- out.push_back(ucs4);
- }
- /*else
- throw (...);*/
- firstSurrogate = false;
- }
- else if ((utf16 & 0xFC00) == 0xD800) {
- ucs4 = (utf16-0xD800UL) << 10;
- firstSurrogate = true;
- }
- else {
- out.push_back(utf16);
- }
- }
- return out;
-}
-
-using namespace std;
-
-ostream& operator<<(ostream& out, const XercesString& s)
-{
- char *temp = XMLString::transcode(s.c_str());
- out << temp;
- XMLString::release(&temp);
- return out;
-}
diff --git a/blahtexml/source/BlahtexXMLin/XercesString.h b/blahtexml/source/BlahtexXMLin/XercesString.h
deleted file mode 100644
index 3d774ea..0000000
--- a/blahtexml/source/BlahtexXMLin/XercesString.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// File "XercesString.h"
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef XERCESSTRING_H
-#define XERCESSTRING_H
-
-#include <string>
-#include <xercesc/util/XMLString.hpp>
-
-XERCES_CPP_NAMESPACE_USE
-using namespace std;
-
-class XercesString : public basic_string<XMLCh>
-{
-public:
- XercesString();
- XercesString(const char *s);
- XercesString(const XMLCh *s);
- XercesString(const wstring& in);
- wstring convertTowstring();
- friend ostream& operator<<(ostream& out, const XercesString& s);
-};
-
-#endif
diff --git a/blahtexml/source/Messages.cpp b/blahtexml/source/Messages.cpp
deleted file mode 100644
index aff7457..0000000
--- a/blahtexml/source/Messages.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-// File "Messages.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <map>
-#include "BlahtexCore/Misc.h"
-
-using namespace std;
-
-// This is an array containing all the possible error codes that blahtex
-// can emit, together with their English translations.
-//
-// The sequences $0, $1, etc correspond to the numbered arguments of the
-// error.
-
-// FIX: a future version of the command line application should have a
-// "--language" option and read error messages from a file.
-
-pair<wstring, wstring> gEnglishMessagesArray[] =
-{
- // Input syntax errors:
-
- make_pair(L"NonAsciiInMathMode",
- L"Non-ASCII characters may only be used in text mode "
- L"(try enclosing the problem characters in \"\\text{...}\")"
- ),
-
- make_pair(L"IllegalCharacter",
- L"Illegal character in input"
- ),
-
- make_pair(L"ReservedCommand",
- L"The command \"$0\" is reserved for internal use by blahtex"
- ),
-
- make_pair(L"TooManyTokens",
- L"The input is too long"
- ),
-
- make_pair(L"InvalidColour",
- L"The colour \"$0\" is invalid"
- ),
-
- make_pair(L"IllegalFinalBackslash",
- L"Illegal backslash \"\\\" at end of input"
- ),
-
- make_pair(L"UnrecognisedCommand",
- L"Unrecognised command \"$0\""
- ),
-
- make_pair(L"IllegalCommandInMathMode",
- L"The command \"$0\" is illegal in math mode"
- ),
-
- make_pair(L"IllegalCommandInMathModeWithHint",
- L"The command \"$0\" is illegal in math mode "
- L"(perhaps you intended to use \"$1\" instead?)"
- ),
-
- make_pair(L"IllegalCommandInTextMode",
- L"The command \"$0\" is illegal in text mode"
- ),
-
- make_pair(L"IllegalCommandInTextModeWithHint",
- L"The command \"$0\" is illegal in text mode "
- L"(perhaps you intended to use \"$1\" instead?)"
- ),
-
- make_pair(L"MissingOpenBraceBefore",
- L"Missing open brace \"{\" before \"$0\""
- ),
-
- make_pair(L"MissingOpenBraceAfter",
- L"Missing open brace \"{\" after \"$0\""
- ),
-
- make_pair(L"MissingOpenBraceAtEnd",
- L"Missing open brace \"{\" at end of input"
- ),
-
- make_pair(L"NotEnoughArguments",
- L"Not enough arguments were supplied for \"$0\""
- ),
-
- make_pair(L"MissingCommandAfterNewcommand",
- L"Missing or illegal new command name after \"\\newcommand\" "
- L"(there must be precisely one command defined; it must begin "
- L"with a backslash \"\\\" and contain only alphabetic characters)"
- ),
-
- make_pair(L"IllegalRedefinition",
- L"The command \"$0\" has already been defined; "
- L"you cannot redefine it"
- ),
-
- make_pair(L"MissingOrIllegalParameterCount",
- L"Missing or illegal parameter count in definition of \"$0\" "
- L"(must be a single digit between 1 and 9 inclusive)"
- ),
-
- make_pair(L"MissingOrIllegalParameterIndex",
- L"Missing or illegal parameter index in definition of \"$0\""
- ),
-
- make_pair(L"UnmatchedOpenBracket",
- L"Encountered open bracket \"[\" without matching "
- L"close bracket \"]\""
- ),
-
- make_pair(L"UnmatchedOpenBrace",
- L"Encountered open brace \"{\" without matching close brace \"}\""
- ),
-
- make_pair(L"UnmatchedCloseBrace",
- L"Encountered close brace \"}\" without matching open brace \"{\""
- ),
-
- make_pair(L"UnmatchedLeft",
- L"Encountered \"\\left\" without matching \"\\right\""
- ),
-
- make_pair(L"UnmatchedRight",
- L"Encountered \"\\right\" without matching \"\\left\""
- ),
-
- make_pair(L"UnmatchedBegin",
- L"Encountered \"\\begin\" without matching \"\\end\""
- ),
-
- make_pair(L"UnmatchedEnd",
- L"Encountered \"\\end\" without matching \"\\begin\""
- ),
-
- make_pair(L"UnexpectedNextCell",
- L"The command \"&\" may only appear inside a "
- L"\"\\begin ... \\end\" block"
- ),
-
- make_pair(L"UnexpectedNextRow",
- L"The command \"\\\\\" may only appear inside a "
- L"\"\\begin ... \\end\" block"
- ),
-
- make_pair(L"MismatchedBeginAndEnd",
- L"The commands \"$0\" and \"$1\" do not match"
- ),
-
- make_pair(L"CasesRowTooBig",
- L"There can only be two entries in each row of a \"cases\" block"
- ),
-
- make_pair(L"SubstackRowTooBig",
- L"There can only be one entry in each row of a \"substack\" block"
- ),
-
- make_pair(L"MissingDelimiter",
- L"Missing delimiter after \"$0\""
- ),
-
- make_pair(L"IllegalDelimiter",
- L"Illegal delimiter following \"$0\""
- ),
-
- make_pair(L"MisplacedLimits",
- L"The command \"$0\" can only appear after a math operator "
- L"(consider using \"\\mathop\")"
- ),
-
- make_pair(L"DoubleSuperscript",
- L"Encountered two superscripts attached to the same base "
- L"(only one is allowed)"
- ),
-
- make_pair(L"DoubleSubscript",
- L"Encountered two subscripts attached to the same base "
- L"(only one is allowed)"
- ),
-
- make_pair(L"AmbiguousInfix",
- L"Ambiguous placement of \"$0\" (try using additional "
- L"braces \"{ ... }\" to disambiguate)"
- ),
-
- // Errors specific to generating MathML:
-
- make_pair(L"UnavailableSymbolFontCombination",
- L"The symbol \"$0\" is not available in the font \"$1\""
- ),
-
- make_pair(L"TooManyMathmlNodes",
- L"There are too many nodes in the MathML tree"
- ),
-
- // Errors specific to generating purified TeX
-
- make_pair(L"PngIncompatibleCharacter",
- L"Unable to correctly generate PNG containing the character $0"
- ),
-
- make_pair(L"WrongFontEncoding",
- L"The symbol \"$0\" may not appear in font encoding \"$1\""
- ),
-
- make_pair(L"WrongFontEncodingWithHint",
- L"The symbol \"$0\" may not appear in font encoding \"$1\" "
- L"(try using the \"$2{...}\" command)"
- ),
-
- make_pair(L"IllegalNestedFontEncodings",
- L"Font encoding commands may not be nested"
- ),
-
- make_pair(L"LatexPackageUnavailable",
- L"Unable to render PNG because "
- L"the LaTeX package \"$0\" is unavailable"
- ),
-
- make_pair(L"LatexFontNotSpecified",
- L"No LaTeX font has been specified for \"$0\""
- ),
-
- // Now we have errors which may be generated by the command-line
- // application (i.e. by main.cpp)
-
- make_pair(L"InvalidUtf8Input",
- L"The input string was not valid UTF-8"
- ),
-
- make_pair(L"CannotCreateTexFile",
- L"Cannot create tex file"
- ),
-
- make_pair(L"CannotWriteTexFile",
- L"Cannot write to tex file"
- ),
-
- make_pair(L"CannotRunLatex",
- L"Cannot run latex"
- ),
-
- make_pair(L"CannotRunDvipng",
- L"Cannot run dvipng"
- ),
-
- make_pair(L"CannotWritePngDirectory",
- L"Cannot write to output PNG directory"
- ),
-
- make_pair(L"CannotChangeDirectory",
- L"Cannot change working directory"
- )
-};
-
-wishful_hash_map<wstring, wstring> gEnglishMessagesTable(
- gEnglishMessagesArray,
- END_ARRAY(gEnglishMessagesArray)
-);
-
-
-// GetErrorMessage() converts the given exception into an English
-// string, using the table gEnglishMessagesTable.
-wstring GetErrorMessage(const blahtex::Exception& e)
-{
- wishful_hash_map<wstring, wstring>::const_iterator
- messageLookup = gEnglishMessagesTable.find(e.GetCode());
- if (messageLookup == gEnglishMessagesTable.end())
- return L"";
-
- const wstring& source = messageLookup->second;
- wstring message;
-
- // Perform argument substitution on error message, e.g. "$2" gets
- // replaced with contents of mArgs[2]
- for (wstring::const_iterator
- ptr = source.begin(); ptr != source.end(); ptr++
- )
- {
- if (*ptr == L'$')
- {
- ptr++;
- int n = (*ptr) - L'0';
- if (n >= 0 && n < e.GetArgs().size())
- message += e.GetArgs()[n];
- else
- message += L"???";
- }
- else
- message += *ptr;
- }
-
- return message;
-}
-
-
-// Returns a string containing a list of all possible error code and
-// their corresponding messages.
-wstring GetErrorMessages()
-{
- wstring output;
-
- for (wishful_hash_map<wstring, wstring>::const_iterator
- ptr = gEnglishMessagesTable.begin();
- ptr != gEnglishMessagesTable.end();
- ++ptr
- )
- output += ptr->first + L" " + ptr->second + L"\n";
-
- return output;
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/UnicodeConverter.cpp b/blahtexml/source/UnicodeConverter.cpp
deleted file mode 100644
index 4267b04..0000000
--- a/blahtexml/source/UnicodeConverter.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-// File "UnicodeConverter.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include "UnicodeConverter.h"
-#include <iostream>
-#include <stdexcept>
-#include <cerrno>
-
-using namespace std;
-
-UnicodeConverter::~UnicodeConverter()
-{
- if (mIsOpen)
- {
- iconv_close(mInHandle);
- iconv_close(mOutHandle);
- }
-}
-
-void UnicodeConverter::Open()
-{
- if (mIsOpen)
- throw logic_error(
- "UnicodeConverter::Open called on already open object"
- );
-
- if (sizeof(wchar_t) != 4)
- throw runtime_error(
- "The wchar_t data type on this system is not four bytes wide"
- );
-
- // Determine endian-ness of wchar_t.
- // (Really we should be able to just use "WCHAR_T". This unfortunately
- // doesn't seem to available on darwin.)
- wchar_t testChar = L'A';
- const char* UcsString =
- (*(reinterpret_cast<char*>(&testChar)) == 'A')
- ? "UCS-4LE" : "UCS-4BE";
-
- mInHandle = iconv_open(UcsString, "UTF-8");
- if (mInHandle == (iconv_t)(-1))
- {
- switch (errno)
- {
- case EMFILE:
- throw runtime_error(
- "iconv_open failed with errno == EMFILE"
- );
- case ENFILE:
- throw runtime_error(
- "iconv_open failed with errno == ENFILE"
- );
- case ENOMEM:
- throw runtime_error(
- "iconv_open failed with errno == ENOMEM"
- );
- case EINVAL:
- throw runtime_error(
- "iconv_open failed with errno == EINVAL"
- );
- default:
- throw runtime_error(
- "iconv_open failed with unknown error code"
- );
- }
- }
-
- mOutHandle = iconv_open("UTF-8", UcsString);
- if (mOutHandle == (iconv_t)(-1))
- {
- switch (errno)
- {
- case EMFILE:
- throw runtime_error(
- "iconv_open failed with errno == EMFILE"
- );
- case ENFILE:
- throw runtime_error(
- "iconv_open failed with errno == ENFILE"
- );
- case ENOMEM:
- throw runtime_error(
- "iconv_open failed with errno == ENOMEM"
- );
- case EINVAL:
- throw runtime_error(
- "iconv_open failed with errno == EINVAL"
- );
- default:
- throw runtime_error(
- "iconv_open failed with unknown error code"
- );
- }
- }
-
- mIsOpen = true;
-}
-
-wstring UnicodeConverter::ConvertIn(const string& input)
-{
- if (!mIsOpen)
- throw logic_error(
- "UnicodeConverter::ConvertIn called "
- "before UnicodeConverter::Open"
- );
-
- char* inputBuf = new char[input.size()];
- memcpy(inputBuf, input.c_str(), input.size());
-
- char* outputBuf = new char[input.size() * 4];
-
- // The following garbage is needed to handle the unfortunate
- // inconsistency between Linux and BSD definitions for the second
- // parameter of iconv. BSD (including Mac OS X) requires const char*,
- // whereas Linux requires char*, and neither option seems to produce
- // error-free, warning-free compilation on both systems simultaneously.
-#ifdef BLAHTEX_ICONV_CONST
- const
-#endif
- char* source = inputBuf;
- char* dest = outputBuf;
-
- size_t inBytesLeft = input.size();
- size_t outBytesLeft = input.size() * 4;
-
- if (iconv(
- mInHandle,
- &source,
- &inBytesLeft,
- &dest,
- &outBytesLeft
- ) == -1)
- {
- delete[] inputBuf;
- delete[] outputBuf;
- switch (errno)
- {
- case EILSEQ:
- case EINVAL: throw UnicodeConverter::Exception();
- default:
- throw logic_error(
- "Conversion problem in UnicodeConverter::ConvertIn"
- );
- }
- }
-
- wstring output(
- reinterpret_cast<wchar_t*>(outputBuf),
- input.size() - outBytesLeft / 4
- );
- delete[] inputBuf;
- delete[] outputBuf;
- return output;
-}
-
-string UnicodeConverter::ConvertOut(const wstring& input)
-{
- if (!mIsOpen)
- throw logic_error(
- "UnicodeConverter::ConvertOut called "
- "before UnicodeConverter::Open"
- );
-
- wchar_t* inputBuf = new wchar_t[input.size()];
- wmemcpy(inputBuf, input.c_str(), input.size());
-
- char* outputBuf = new char[input.size() * 4];
-
-#ifdef BLAHTEX_ICONV_CONST
- const
-#endif
- char* source = reinterpret_cast<char*>(inputBuf);
- char* dest = outputBuf;
-
- size_t inBytesLeft = input.size() * 4;
- size_t outBytesLeft = input.size() * 4;
-
- if (iconv(
- mOutHandle,
- &source,
- &inBytesLeft,
- &dest,
- &outBytesLeft
- ) == -1)
- {
- delete[] inputBuf;
- delete[] outputBuf;
- switch (errno)
- {
- case EILSEQ:
- case EINVAL: throw UnicodeConverter::Exception();
- default:
- throw logic_error(
- "Conversion problem in UnicodeConverter::ConvertIn"
- );
- }
- }
-
- string output(outputBuf, input.size() * 4 - outBytesLeft);
- delete[] inputBuf;
- delete[] outputBuf;
- return output;
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/UnicodeConverter.h b/blahtexml/source/UnicodeConverter.h
deleted file mode 100644
index 261d6d6..0000000
--- a/blahtexml/source/UnicodeConverter.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// File "UnicodeConverter.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_UNICODE_CONVERTER_H
-#define BLAHTEX_UNICODE_CONVERTER_H
-
-#include <string>
-#include <iconv.h>
-
-// UnicodeConverter handles all UTF8 <=> wchar_t conversions. It's
-// basically a wrapper for the iconv library in terms of
-// - string (assumed to be in UTF-8) and
-// - wstring (in internal wchar_t format, which may be big-endian or
-// little-endian depending on platform).
-class UnicodeConverter
-{
- public:
- UnicodeConverter() :
- mIsOpen(false)
- { }
-
- ~UnicodeConverter();
-
- // Open() must be called before using this object.
- //
- // It will throw a std::runtime_error object if
- // (1) we are running on a platform with less than 4 bytes
- // per wchar_t, or
- // (2) an appropriate iconv_t converter object can't be created
- void Open();
-
- std::wstring ConvertIn(const std::string& input);
- std::string ConvertOut(const std::wstring& input);
-
- // The above 'ConvertIn' and 'ConvertOut' functions will throw this
- // exception object if their input is invalid (e.g. invalid UTF-8).
- // More serious problems report a std::logic_error.
- class Exception
- {
- };
-
- private:
- bool mIsOpen;
-
- // mOutHandle is the iconv object handling wchar_t => UTF-8,
- // mInHandle does the other way.
- iconv_t mOutHandle;
- iconv_t mInHandle;
-};
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/main.cpp b/blahtexml/source/main.cpp
deleted file mode 100644
index a7e22a8..0000000
--- a/blahtexml/source/main.cpp
+++ /dev/null
@@ -1,694 +0,0 @@
-// File "main.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// blahtexml (version 0.5)
-// Copyright (C) 2007-2008, Gilles Van Assche
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include "BlahtexCore/Interface.h"
-#include "UnicodeConverter.h"
-#include "mainPng.h"
-#include <iostream>
-#include <sstream>
-#include <stdexcept>
-
-using namespace std;
-using namespace blahtex;
-
-#ifdef BLAHTEXML_USING_XERCES
-#include <iostream>
-#include <string.h>
-#include <xercesc/framework/StdInInputSource.hpp>
-#include <xercesc/framework/XMLFormatter.hpp>
-#include <xercesc/parsers/SAX2XMLFilterImpl.hpp>
-#include <xercesc/sax2/Attributes.hpp>
-#include <xercesc/sax2/SAX2XMLReader.hpp>
-#include <xercesc/sax2/XMLReaderFactory.hpp>
-#include <xercesc/util/OutOfMemoryException.hpp>
-#include <xercesc/util/PlatformUtils.hpp>
-#include <xercesc/util/TransService.hpp>
-#include <xercesc/util/XMLString.hpp>
-#include <xercesc/util/XMLUniDefs.hpp>
-#include "BlahtexXMLin/BlahtexFilter.h"
-#include "BlahtexXMLin/SAX2Output.h"
-#endif
-
-string gBlahtexVersion = "0.5";
-
-// A single global instance of UnicodeConverter.
-UnicodeConverter gUnicodeConverter;
-
-// Imported from Messages.cpp:
-extern wstring GetErrorMessage(const blahtex::Exception& e);
-extern wstring GetErrorMessages();
-
-// FormatError() converts a blahtex Exception object into a string like
-// "<error><id>...</id><arg>...</arg><arg>...</arg> ...
-// <message>...</message></error".
-wstring FormatError(
- const blahtex::Exception& e,
- const EncodingOptions& options
-)
-{
- wstring output = L"<error><id>" + e.GetCode() + L"</id>";
- for (vector<wstring>::const_iterator
- arg = e.GetArgs().begin(); arg != e.GetArgs().end(); arg++
- )
- output += L"<arg>" + XmlEncode(*arg, options) + L"</arg>";
-
- output += L"<message>";
- output += XmlEncode(GetErrorMessage(e), options);
- output += L"</message>";
-
- output += L"</error>";
- return output;
-}
-
-// ShowUsage() prints a help screen.
-void ShowUsage()
-{
- cout << "\n"
-#ifdef BLAHTEXML_USING_XERCES
-"Blahtexml version " << gBlahtexVersion << "\n"
-#else
-"Blahtex version " << gBlahtexVersion << "\n"
-#endif
-"Copyright (C) 2006, David Harvey\n"
-#ifdef BLAHTEXML_USING_XERCES
-"Copyright (C) 2007-2008, Gilles Van Assche\n"
-#endif
-"\n"
-"This is free software; see the source "
-"for copying conditions. There is NO\n"
-"warranty; not even for MERCHANTABILITY "
-"or FITNESS FOR A PARTICULAR PURPOSE.\n"
-"\n"
-#ifdef BLAHTEXML_USING_XERCES
-"Normal mode: blahtexml [ options ] < inputfile > outputfile\n"
-"XML input mode: blahtexml --xmlin [ options ] < inputfile > outputfile\n"
-#else
-"Usage: blahtex [ options ] < inputfile > outputfile\n"
-#endif
-"\n"
-"SUMMARY OF OPTIONS (see manual for details)\n"
-"\n"
-" --texvc-compatible-commands\n"
-"\n"
-" --mathml\n"
-" --indented\n"
-" --spacing { strict | moderate | relaxed }\n"
-" --mathml-version-1-fonts\n"
-" --disallow-plane-1\n"
-" --mathml-encoding { raw | numeric | short | long }\n"
-" --other-encoding { raw | numeric }\n"
-"\n"
-" --png\n"
-" --use-ucs-package\n"
-" --use-cjk-package\n"
-" --use-preview-package\n"
-" --japanese-font fontname\n"
-" --shell-latex command\n"
-" --shell-dvipng command\n"
-" --temp-directory directory\n"
-" --png-directory directory\n"
-"\n"
-" --debug { parse | layout | purified }\n"
-" --keep-temp-files\n"
-" --throw-logic-error\n"
-" --print-error-messages\n"
-"\n"
-#ifdef BLAHTEXML_USING_XERCES
-" --doctype-system DTD\n"
-" --doctype-public PublicID DTD\n"
-" --doctype-xhtml+mathml\n"
-" --mathml-nsprefix-auto\n"
-" --mathml-nsprefix-none\n"
-" --mathml-nsprefix prefix\n"
-"\n"
-"\n"
-#endif
-"More information available at www.blahtex.org\n"
-"\n";
-
- // FIX: need command line option to select output DPI
-
- exit(0);
-}
-
-// CommandLineException is used for reporting incorrect command line
-// syntax.
-struct CommandLineException
-{
- string mMessage;
-
- CommandLineException(
- const string& message
- ) :
- mMessage(message)
- { }
-};
-
-// Adds a trailing slash to the string, if it's not already there.
-void AddTrailingSlash(string& s)
-{
- if (!s.empty() && s[s.size() - 1] != '/')
- s += '/';
-}
-
-#ifdef BLAHTEXML_USING_XERCES
-SAX2Output::Doctype outputDoctype = SAX2Output::DoctypeNone;
-string outputPublicID;
-string outputDTD;
-BlahtexFilter::PrefixType MathMLPrefixType = BlahtexFilter::PrefixAuto;
-string MathMLPrefix;
-int batchXMLConversion(blahtex::Interface& interface)
-{
- cerr << "\n"
- "Blahtexml version " << gBlahtexVersion << "\n"
- "Copyright (C) 2006, David Harvey\n"
- "Copyright (C) 2007-2008, Gilles Van Assche\n"
- "\n"
- "This is free software; see the source "
- "for copying conditions. There is NO\n"
- "warranty; not even for MERCHANTABILITY "
- "or FITNESS FOR A PARTICULAR PURPOSE.\n";
- cerr << endl;
- try {
- XMLPlatformUtils::Initialize();
- }
- catch (const XMLException& toCatch) {
- XERCES_STD_QUALIFIER cerr << "Error during initialization! :\n" << XMLString::transcode(toCatch.getMessage()) << endl;
- return 1;
- }
- SAX2XMLReader* reader = XMLReaderFactory::createXMLReader();
- BlahtexFilter* parser = new BlahtexFilter(reader, interface);
-
- parser->setFeature(XMLUni::fgSAX2CoreValidation, false);
- parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
- parser->setFeature(XMLUni::fgXercesSchema, false);
- parser->setFeature(XMLUni::fgXercesSchemaFullChecking, false);
- parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, false);
-
- XercesString _MathMLPrefix(MathMLPrefix.c_str());
- wstring __MathMLPrefix = _MathMLPrefix.convertTowstring();
- parser->setDesiredMathMLPrefixType(MathMLPrefixType, __MathMLPrefix);
-
- int parserErrors = 0;
- int result = 0;
- {
- StdInInputSource stdIn;
- try {
- XercesString publicID(outputPublicID.c_str());
- XercesString DTD(outputDTD.c_str());
- SAX2Output output(cout, "UTF-8", XMLFormatter::UnRep_CharRef, outputDoctype, publicID, DTD);
- parser->setContentHandler(&output);
- parser->setErrorHandler(&output);
- parser->parse(stdIn);
- parserErrors = parser->getErrorCount();
- }
- catch (const OutOfMemoryException&) {
- cerr << endl;
- cerr << "Out of memory exception" << endl;
- result = 1;
- }
- catch (const XMLException& e) {
- char *errorString = XMLString::transcode(e.getMessage());
- cerr << endl;
- cerr << "Error: " << errorString << endl;
- XMLString::release(&errorString);
- result = 1;
- }
- }
- if (parserErrors > 0) {
- cerr << "During the XML input parsing, ";
- if (parserErrors == 1) cerr << "an error";
- else cerr << parserErrors << " errors";
- cerr << " occurred." << endl;
- }
- int blahtexErrors = parser->getNumberOfErrors();
- if (blahtexErrors > 0) {
- cerr << "During the blahtex conversion, ";
- if (blahtexErrors == 1) cerr << "an error";
- else cerr << blahtexErrors << " errors";
- cerr << " occurred.\nSee the output file for more information." << endl;
- result = 1;
- }
- delete parser;
- delete reader;
- XMLPlatformUtils::Terminate();
- return result;
-}
-#endif
-
-int main (int argc, char* const argv[]) {
- // This outermost try block catches std::runtime_error
- // and CommandLineException.
- try
- {
- gUnicodeConverter.Open();
-
- blahtex::Interface interface;
-
- bool doPng = false;
- bool doMathml = false;
-#ifdef BLAHTEXML_USING_XERCES
- bool doXMLinput = false;
-#endif
-
- bool debugLayoutTree = false;
- bool debugParseTree = false;
- bool debugPurifiedTex = false;
- bool deleteTempFiles = true;
-
- string shellLatex = "latex";
- string shellDvipng = "dvipng";
- string tempDirectory = "./";
- string pngDirectory = "./";
-
- // Process command line arguments
- for (int i = 1; i < argc; i++)
- {
- string arg(argv[i]);
-
- if (arg == "--help")
- ShowUsage();
-
- else if (arg == "--print-error-messages")
- {
- cout << gUnicodeConverter.ConvertOut(GetErrorMessages())
- << endl;
- return 0;
- }
-
- else if (arg == "--throw-logic-error")
- throw logic_error("Aaarrrgggghhhh!");
-
- else if (arg == "--shell-latex")
- {
- if (++i == argc)
- throw CommandLineException(
- "Missing string after \"--shell-latex\""
- );
- shellLatex = string(argv[i]);
- }
-
- else if (arg == "--shell-dvipng")
- {
- if (++i == argc)
- throw CommandLineException(
- "Missing string after \"--shell-dvipng\""
- );
- shellDvipng = string(argv[i]);
- }
-
- else if (arg == "--temp-directory")
- {
- if (++i == argc)
- throw CommandLineException(
- "Missing string after \"--temp-directory\""
- );
- tempDirectory = string(argv[i]);
- AddTrailingSlash(tempDirectory);
- }
-
- else if (arg == "--png-directory")
- {
- if (++i == argc)
- throw CommandLineException(
- "Missing string after \"--png-directory\""
- );
- pngDirectory = string(argv[i]);
- AddTrailingSlash(pngDirectory);
- }
-
- else if (arg == "--use-ucs-package")
- interface.mPurifiedTexOptions.mAllowUcs = true;
-
- else if (arg == "--use-cjk-package")
- interface.mPurifiedTexOptions.mAllowCJK = true;
-
- else if (arg == "--use-preview-package")
- interface.mPurifiedTexOptions.mAllowPreview = true;
-
- else if (arg == "--japanese-font")
- {
- if (++i == argc)
- throw CommandLineException(
- "Missing string after \"--japanese-font\""
- );
- interface.mPurifiedTexOptions.mJapaneseFont =
- gUnicodeConverter.ConvertIn(string(argv[i]));
- }
-
- else if (arg == "--indented")
- interface.mIndented = true;
-
- else if (arg == "--spacing")
- {
- if (++i == argc)
- throw CommandLineException(
- "Missing string after \"--spacing\""
- );
- arg = string(argv[i]);
-
- if (arg == "strict")
- interface.mMathmlOptions.mSpacingControl
- = MathmlOptions::cSpacingControlStrict;
-
- else if (arg == "moderate")
- interface.mMathmlOptions.mSpacingControl
- = MathmlOptions::cSpacingControlModerate;
-
- else if (arg == "relaxed")
- interface.mMathmlOptions.mSpacingControl
- = MathmlOptions::cSpacingControlRelaxed;
-
- else
- throw CommandLineException(
- "Illegal string after \"--spacing\""
- );
- }
-
- else if (arg == "--mathml-version-1-fonts")
- interface.mMathmlOptions.mUseVersion1FontAttributes = true;
-
- else if (arg == "--texvc-compatible-commands")
- interface.mTexvcCompatibility = true;
-
- else if (arg == "--png")
- doPng = true;
-
- else if (arg == "--mathml")
- doMathml = true;
-
- else if (arg == "--mathml-encoding")
- {
- if (++i == argc)
- throw CommandLineException(
- "Missing string after \"--mathml-encoding\""
- );
- arg = string(argv[i]);
-
- if (arg == "raw")
- interface.mEncodingOptions.mMathmlEncoding
- = EncodingOptions::cMathmlEncodingRaw;
-
- else if (arg == "numeric")
- interface.mEncodingOptions.mMathmlEncoding
- = EncodingOptions::cMathmlEncodingNumeric;
-
- else if (arg == "short")
- interface.mEncodingOptions.mMathmlEncoding
- = EncodingOptions::cMathmlEncodingShort;
-
- else if (arg == "long")
- interface.mEncodingOptions.mMathmlEncoding
- = EncodingOptions::cMathmlEncodingLong;
-
- else
- throw CommandLineException(
- "Illegal string after \"--mathml-encoding\""
- );
- }
-
- else if (arg == "--disallow-plane-1")
- {
- interface.mMathmlOptions .mAllowPlane1 = false;
- interface.mEncodingOptions.mAllowPlane1 = false;
- }
-
- else if (arg == "--other-encoding")
- {
- if (++i == argc)
- throw CommandLineException(
- "Missing string after \"--other-encoding\""
- );
- arg = string(argv[i]);
- if (arg == "raw")
- interface.mEncodingOptions.mOtherEncodingRaw = true;
- else if (arg == "numeric")
- interface.mEncodingOptions.mOtherEncodingRaw = false;
- else
- throw CommandLineException(
- "Illegal string after \"--other-encoding\""
- );
- }
-
- else if (arg == "--debug")
- {
- if (++i == argc)
- throw CommandLineException(
- "Missing string after \"--debug\""
- );
- arg = string(argv[i]);
- if (arg == "layout")
- debugLayoutTree = true;
- else if (arg == "parse")
- debugParseTree = true;
- else if (arg == "purified")
- debugPurifiedTex = true;
- else
- throw CommandLineException(
- "Illegal string after \"--debug\""
- );
- }
-
- else if (arg == "--keep-temp-files")
- deleteTempFiles = false;
-#ifdef BLAHTEXML_USING_XERCES
- else if (arg == "--xmlin")
- doXMLinput = true;
- else if (arg == "--doctype-system") {
- outputDoctype = SAX2Output::DoctypeSystem;
- if (++i == argc) throw CommandLineException("Missing string after \"--doctype-system\"");
- outputDTD = argv[i];
- }
- else if (arg == "--doctype-public") {
- outputDoctype = SAX2Output::DoctypePublic;
- if (++i == argc) throw CommandLineException("Missing two strings after \"--doctype-public\"");
- outputPublicID = argv[i];
- if (++i == argc) throw CommandLineException("Missing one string after \"--doctype-public\"");
- outputDTD = argv[i];
- }
- else if (arg == "--doctype-xhtml+mathml") {
- outputDoctype = SAX2Output::DoctypePublic;
- outputPublicID = "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN";
- outputDTD = "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd";
- MathMLPrefixType = BlahtexFilter::PrefixNone;
- }
- else if (arg == "--mathml-nsprefix-auto")
- MathMLPrefixType = BlahtexFilter::PrefixAuto;
- else if (arg == "--mathml-nsprefix-none")
- MathMLPrefixType = BlahtexFilter::PrefixNone;
- else if (arg == "--mathml-nsprefix") {
- MathMLPrefixType = BlahtexFilter::PrefixAdd;
- if (++i == argc) throw CommandLineException("Missing string after \"--mathml-nsprefix\"");
- MathMLPrefix = argv[i];
- }
-#endif
- else
- throw CommandLineException(
- "Unrecognised command line option \"" + arg + "\""
- );
- }
-
- // Finished processing command line, now process the input
-
-#ifdef BLAHTEXML_USING_XERCES
- if (doXMLinput)
- return batchXMLConversion(interface);
-#endif
- if (isatty(0))
- ShowUsage();
-
- wostringstream mainOutput;
-
- try
- {
- wstring input;
-
- // Read input file
- string inputUtf8;
- {
- char c;
- while (cin.get(c))
- inputUtf8 += c;
- }
-
- // This try block converts UnicodeConverter::Exception into an
- // input syntax error, i.e. if the user supplies invalid UTF-8.
- // (Later we treat such exceptions as debug assertions.)
- try
- {
- input = gUnicodeConverter.ConvertIn(inputUtf8);
- }
- catch (UnicodeConverter::Exception& e)
- {
- throw blahtex::Exception(L"InvalidUtf8Input");
- }
-
- // Build the parse and layout trees.
- interface.ProcessInput(input);
-
- if (debugParseTree)
- {
- mainOutput << L"\n=== BEGIN PARSE TREE ===\n\n";
- interface.GetManager()->GetParseTree()->Print(mainOutput);
- mainOutput << L"\n=== END PARSE TREE ===\n\n";
- }
-
- if (debugLayoutTree)
- {
- mainOutput << L"\n=== BEGIN LAYOUT TREE ===\n\n";
- wostringstream temp;
- interface.GetManager()->GetLayoutTree()->Print(temp);
- mainOutput << XmlEncode(temp.str(), EncodingOptions());
- mainOutput << L"\n=== END LAYOUT TREE ===\n\n";
- }
-
- // Generate purified TeX if required.
- if (doPng || debugPurifiedTex)
- {
- // This stream is where we build the PNG output block:
- wostringstream pngOutput;
-
- try
- {
- wstring purifiedTex = interface.GetPurifiedTex();
-
- if (debugPurifiedTex)
- {
- pngOutput << L"\n=== BEGIN PURIFIED TEX ===\n\n";
- pngOutput << purifiedTex;
- pngOutput << L"\n=== END PURIFIED TEX ===\n\n";
- }
-
- // Make the system calls to generate the PNG image
- // if requested.
- if (doPng)
- {
- PngInfo info = MakePngFile(
- purifiedTex,
- tempDirectory,
- pngDirectory,
- "",
- shellLatex,
- shellDvipng,
- deleteTempFiles
- );
-
- // The height and depth measurements are only
- // valid if the "preview" package is used:
- if (interface.mPurifiedTexOptions.mAllowPreview
- && info.mDimensionsValid
- )
- {
- pngOutput << L"<height>"
- << info.mHeight << L"</height>\n";
- pngOutput << L"<depth>"
- << info.mDepth << L"</depth>\n";
- }
-
- pngOutput << L"<md5>"
- << gUnicodeConverter.ConvertIn(info.mMd5)
- << L"</md5>\n";
- }
- }
-
- // Catching errors that occurred during PNG generation:
- catch (blahtex::Exception& e)
- {
- pngOutput.str(L"");
- pngOutput << FormatError(e, interface.mEncodingOptions)
- << endl;
- }
-
- mainOutput << L"<png>\n" << pngOutput.str() << L"</png>\n";
- }
-
- // This block generates MathML output if requested.
- if (doMathml)
- {
- // This stream is where we build the MathML output block:
- wostringstream mathmlOutput;
-
- try
- {
- mathmlOutput << L"<markup>\n";
- mathmlOutput << interface.GetMathml();
- if (!interface.mIndented)
- mathmlOutput << L"\n";
- mathmlOutput << L"</markup>\n";
- }
-
- // Catch errors in generating the MathML:
- catch (blahtex::Exception& e)
- {
- mathmlOutput.str(L"");
- mathmlOutput
- << FormatError(e, interface.mEncodingOptions)
- << endl;
- }
-
- mainOutput << L"<mathml>\n" << mathmlOutput.str()
- << L"</mathml>\n";
- }
- }
-
- // This catches input syntax errors.
- catch (blahtex::Exception& e)
- {
- mainOutput.str(L"");
- mainOutput << FormatError(e, interface.mEncodingOptions)
- << endl;
- }
-
- cout << "<blahtex>\n"
- << gUnicodeConverter.ConvertOut(mainOutput.str())
- << "</blahtex>\n";
- }
-
- // The following errors might occur if there's a bug in blahtex that
- // some assertion condition picked up. We still want to report these
- // nicely to the user so that they can notify the developers.
- catch (std::logic_error& e)
- {
- // WARNING: this doesn't XML-encode the message
- // (We don't expect to the message to contain the characters &<>)
- cout << "<blahtex>\n<logicError>" << e.what()
- << "</logicError>\n</blahtex>\n";
- }
-
- // These indicate incorrect command line syntax:
- catch (CommandLineException& e)
- {
- cout << "blahtex: " << e.mMessage << " (try \"blahtex --help\")\n";
- }
-
- // These kind of errors should only occur if the program has been
- // installed incorrectly.
- catch (std::runtime_error& e)
- {
- cout << "blahtex runtime error: " << e.what() << endl;
- }
-
- return 0;
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/mainPng.cpp b/blahtexml/source/mainPng.cpp
deleted file mode 100644
index d6cf072..0000000
--- a/blahtexml/source/mainPng.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-// File "mainPng.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include "BlahtexCore/Misc.h"
-#include "UnicodeConverter.h"
-#include "md5Wrapper.h"
-#include "mainPng.h"
-#include <cerrno>
-#include <sys/stat.h>
-#include <iostream>
-#include <fstream>
-#include <sstream>
-
-
-using namespace std;
-using namespace blahtex;
-
-
-// From main.cpp:
-extern UnicodeConverter gUnicodeConverter;
-
-
-// TemporaryFile manages a temporary file; it deletes the named file when
-// the object goes out of scope.
-class TemporaryFile
-{
- string mFilename;
-
- // This flag might get set to false if we are in some kind of
- // debugging mode and want to keep temp files.
- bool mShouldDelete;
-
-public:
- TemporaryFile(
- const string& filename,
- bool shouldDelete = true
- ) :
- mFilename(filename),
- mShouldDelete(shouldDelete)
- { }
-
- ~TemporaryFile()
- {
- if (mShouldDelete)
- unlink(mFilename.c_str());
- }
-};
-
-
-// Tests whether a file exists
-bool FileExists(const string& filename)
-{
- struct stat temp;
- return (stat(filename.c_str(), &temp) == 0);
-}
-
-
-// Attempts to run given command from the given directory.
-// Returns true if the system() call was successful, otherwise false.
-// Can throw a "CannotChangeDirectory" exception if problems occur.
-bool Execute(
- const string& command,
- const string& directory = "./"
-)
-{
- char buffer[5000];
-
- bool NeedToChange = (directory != "" && directory != "./");
-
- if (NeedToChange)
- {
- if (getcwd(buffer, 5000) == NULL)
- throw blahtex::Exception(L"CannotChangeDirectory");
-
- if (chdir(directory.c_str()) != 0)
- throw blahtex::Exception(L"CannotChangeDirectory");
- }
-
- bool result = (system(command.c_str()) == 0);
-
- if (NeedToChange)
- {
- if (chdir(buffer) != 0)
- throw blahtex::Exception(L"CannotChangeDirectory");
- }
-
- return result;
-}
-
-
-PngInfo MakePngFile(
- const wstring& purifiedTex,
- const string& tempDirectory,
- const string& pngDirectory,
- const string& pngFilename,
- const string& shellLatex,
- const string& shellDvipng,
- bool deleteTempFiles
-)
-{
- PngInfo info;
-
- string purifiedTexUtf8 = gUnicodeConverter.ConvertOut(purifiedTex);
-
- // This md5 is used for the temp filenames.
- string md5 = ComputeMd5(purifiedTexUtf8);
-
- string pngActualFilename =
- pngFilename.empty() ? (md5 + ".png") : pngFilename;
-
- // Send output to tex file.
- {
- ofstream texFile(
- (tempDirectory + md5 + ".tex").c_str(),
- ios::out | ios::binary
- );
- if (!texFile)
- throw blahtex::Exception(
- L"CannotCreateTexFile"
- );
- texFile << purifiedTexUtf8;
- if (!texFile)
- throw blahtex::Exception(
- L"CannotWriteTexFile"
- );
- }
-
- // These are temporary files we want deleted when we're done.
- TemporaryFile texTemp(tempDirectory + md5 + ".tex", deleteTempFiles);
- TemporaryFile auxTemp(tempDirectory + md5 + ".aux", deleteTempFiles);
- TemporaryFile logTemp(tempDirectory + md5 + ".log", deleteTempFiles);
- TemporaryFile dviTemp(tempDirectory + md5 + ".dvi", deleteTempFiles);
- TemporaryFile dataTemp(tempDirectory + md5 + ".data", deleteTempFiles);
-
-
- if (!Execute(
- shellLatex + " " + md5 + ".tex >/dev/null 2>/dev/null",
- tempDirectory
- )
- ||
- !FileExists(tempDirectory + md5 + ".dvi")
- )
- throw blahtex::Exception(L"CannotRunLatex");
-
-
- if (!Execute(
- shellDvipng + " " + md5 + ".dvi " +
- "--picky --bg Transparent --gamma 1.3 -D 120 -q -T tight " +
- "--height --depth " +
- "-o \"" + pngActualFilename +
- "\" > " + md5 + ".data 2>/dev/null",
- tempDirectory
- )
- ||
- !FileExists(tempDirectory + pngActualFilename)
- )
- throw blahtex::Exception(L"CannotRunDvipng");
-
- if (rename(
- (tempDirectory + pngActualFilename).c_str(),
- (pngDirectory + pngActualFilename).c_str()
- ))
- throw blahtex::Exception(L"CannotWritePngDirectory");
-
-
- // Read the height and depth of the image from dvipng's output.
- {
- ifstream dataFile(
- (tempDirectory + md5 + ".data").c_str(),
- ios::in | ios::binary
- );
-
- if (dataFile)
- {
- string line, temp;
- while (getline(dataFile, line))
- {
- string::size_type heightPos = line.find("height=");
- string::size_type depthPos = line.find("depth=");
- if (heightPos != string::npos && depthPos != string::npos)
- {
- info.mDimensionsValid = true;
- temp = line.substr(heightPos + 7, 1000);
- istringstream(temp) >> info.mHeight;
- string temp = line.substr(depthPos + 6, 1000);
- istringstream(temp) >> info.mDepth;
- }
- }
- }
- }
-
- info.mMd5 = md5;
- return info;
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/mainPng.h b/blahtexml/source/mainPng.h
deleted file mode 100644
index 3c79ffe..0000000
--- a/blahtexml/source/mainPng.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// File "mainPng.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_MAINPNG_H
-#define BLAHTEX_MAINPNG_H
-
-#include <string>
-
-// Records information about a PNG file generated by MakePngFile.
-struct PngInfo
-{
- // The PNG is stored in md5.png.
- std::string mMd5;
-
- // These are the height and depth reported by dvipng.
- // They are only valid if mDimensionsValid is set.
- bool mDimensionsValid;
- int mHeight;
- int mDepth;
-
- PngInfo() :
- mDimensionsValid(false)
- { }
-};
-
-// Generates a PNG file. Uses tempDirectory for storage of temporary files
-// (.tex, .dvi, .log, .data). Expects tempDirectory and pngDirectory to
-// include a terminating slash. The output file will be stored in the
-// directory pngDirectory in the file pngFilename; if pngFilename is an
-// empty string, MakePngFile will just use the md5 that it computes (which
-// gets returned in PngInfo).
-extern PngInfo MakePngFile(
- const std::wstring& purifiedTex,
- const std::string& tempDirectory,
- const std::string& pngDirectory,
- const std::string& pngFilename,
- const std::string& shellLatex,
- const std::string& shellDvipng,
- bool deleteTempFiles
-);
-
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/md5.c b/blahtexml/source/md5.c
deleted file mode 100644
index faeca9d..0000000
--- a/blahtexml/source/md5.c
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- L. Peter Deutsch
- ghost@aladdin.com
-
- */
-/* $Id: md5.c,v 1.1.1.1 2007/12/23 13:02:11 gvanas Exp $ */
-/*
- Independent implementation of MD5 (RFC 1321).
-
- This code implements the MD5 Algorithm defined in RFC 1321, whose
- text is available at
- http://www.ietf.org/rfc/rfc1321.txt
- The code is derived from the text of the RFC, including the test suite
- (section A.5) but excluding the rest of Appendix A. It does not include
- any code or documentation that is identified in the RFC as being
- copyrighted.
-
- The original and principal author of md5.c is L. Peter Deutsch
- <ghost@aladdin.com>. Other authors are noted in the change history
- that follows (in reverse chronological order):
-
- 2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order
- either statically or dynamically; added missing #include <string.h>
- in library.
- 2002-03-11 lpd Corrected argument list for main(), and added int return
- type, in test program and T value program.
- 2002-02-21 lpd Added missing #include <stdio.h> in test program.
- 2000-07-03 lpd Patched to eliminate warnings about "constant is
- unsigned in ANSI C, signed in traditional"; made test program
- self-checking.
- 1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
- 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5).
- 1999-05-03 lpd Original version.
- */
-
-#include "md5.h"
-#include <string.h>
-
-#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */
-#ifdef ARCH_IS_BIG_ENDIAN
-# define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1)
-#else
-# define BYTE_ORDER 0
-#endif
-
-#define T_MASK ((md5_word_t)~0)
-#define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87)
-#define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9)
-#define T3 0x242070db
-#define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111)
-#define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050)
-#define T6 0x4787c62a
-#define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec)
-#define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe)
-#define T9 0x698098d8
-#define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850)
-#define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e)
-#define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841)
-#define T13 0x6b901122
-#define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c)
-#define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71)
-#define T16 0x49b40821
-#define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d)
-#define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf)
-#define T19 0x265e5a51
-#define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855)
-#define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2)
-#define T22 0x02441453
-#define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e)
-#define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437)
-#define T25 0x21e1cde6
-#define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829)
-#define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278)
-#define T28 0x455a14ed
-#define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa)
-#define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07)
-#define T31 0x676f02d9
-#define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375)
-#define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd)
-#define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e)
-#define T35 0x6d9d6122
-#define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3)
-#define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb)
-#define T38 0x4bdecfa9
-#define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f)
-#define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f)
-#define T41 0x289b7ec6
-#define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805)
-#define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a)
-#define T44 0x04881d05
-#define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6)
-#define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a)
-#define T47 0x1fa27cf8
-#define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a)
-#define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb)
-#define T50 0x432aff97
-#define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58)
-#define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6)
-#define T53 0x655b59c3
-#define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d)
-#define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82)
-#define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e)
-#define T57 0x6fa87e4f
-#define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f)
-#define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb)
-#define T60 0x4e0811a1
-#define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d)
-#define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca)
-#define T63 0x2ad7d2bb
-#define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e)
-
-
-static void
-md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
-{
- md5_word_t
- a = pms->abcd[0], b = pms->abcd[1],
- c = pms->abcd[2], d = pms->abcd[3];
- md5_word_t t;
-#if BYTE_ORDER > 0
- /* Define storage only for big-endian CPUs. */
- md5_word_t X[16];
-#else
- /* Define storage for little-endian or both types of CPUs. */
- md5_word_t xbuf[16];
- const md5_word_t *X;
-#endif
-
- {
-#if BYTE_ORDER == 0
- /*
- * Determine dynamically whether this is a big-endian or
- * little-endian machine, since we can use a more efficient
- * algorithm on the latter.
- */
- static const int w = 1;
-
- if (*((const md5_byte_t *)&w)) /* dynamic little-endian */
-#endif
-#if BYTE_ORDER <= 0 /* little-endian */
- {
- /*
- * On little-endian machines, we can process properly aligned
- * data without copying it.
- */
- if (!((data - (const md5_byte_t *)0) & 3)) {
- /* data are properly aligned */
- X = (const md5_word_t *)data;
- } else {
- /* not aligned */
- memcpy(xbuf, data, 64);
- X = xbuf;
- }
- }
-#endif
-#if BYTE_ORDER == 0
- else /* dynamic big-endian */
-#endif
-#if BYTE_ORDER >= 0 /* big-endian */
- {
- /*
- * On big-endian machines, we must arrange the bytes in the
- * right order.
- */
- const md5_byte_t *xp = data;
- int i;
-
-# if BYTE_ORDER == 0
- X = xbuf; /* (dynamic only) */
-# else
-# define xbuf X /* (static only) */
-# endif
- for (i = 0; i < 16; ++i, xp += 4)
- xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24);
- }
-#endif
- }
-
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
-
- /* Round 1. */
- /* Let [abcd k s i] denote the operation
- a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */
-#define F(x, y, z) (((x) & (y)) | (~(x) & (z)))
-#define SET(a, b, c, d, k, s, Ti)\
- t = a + F(b,c,d) + X[k] + Ti;\
- a = ROTATE_LEFT(t, s) + b
- /* Do the following 16 operations. */
- SET(a, b, c, d, 0, 7, T1);
- SET(d, a, b, c, 1, 12, T2);
- SET(c, d, a, b, 2, 17, T3);
- SET(b, c, d, a, 3, 22, T4);
- SET(a, b, c, d, 4, 7, T5);
- SET(d, a, b, c, 5, 12, T6);
- SET(c, d, a, b, 6, 17, T7);
- SET(b, c, d, a, 7, 22, T8);
- SET(a, b, c, d, 8, 7, T9);
- SET(d, a, b, c, 9, 12, T10);
- SET(c, d, a, b, 10, 17, T11);
- SET(b, c, d, a, 11, 22, T12);
- SET(a, b, c, d, 12, 7, T13);
- SET(d, a, b, c, 13, 12, T14);
- SET(c, d, a, b, 14, 17, T15);
- SET(b, c, d, a, 15, 22, T16);
-#undef SET
-
- /* Round 2. */
- /* Let [abcd k s i] denote the operation
- a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */
-#define G(x, y, z) (((x) & (z)) | ((y) & ~(z)))
-#define SET(a, b, c, d, k, s, Ti)\
- t = a + G(b,c,d) + X[k] + Ti;\
- a = ROTATE_LEFT(t, s) + b
- /* Do the following 16 operations. */
- SET(a, b, c, d, 1, 5, T17);
- SET(d, a, b, c, 6, 9, T18);
- SET(c, d, a, b, 11, 14, T19);
- SET(b, c, d, a, 0, 20, T20);
- SET(a, b, c, d, 5, 5, T21);
- SET(d, a, b, c, 10, 9, T22);
- SET(c, d, a, b, 15, 14, T23);
- SET(b, c, d, a, 4, 20, T24);
- SET(a, b, c, d, 9, 5, T25);
- SET(d, a, b, c, 14, 9, T26);
- SET(c, d, a, b, 3, 14, T27);
- SET(b, c, d, a, 8, 20, T28);
- SET(a, b, c, d, 13, 5, T29);
- SET(d, a, b, c, 2, 9, T30);
- SET(c, d, a, b, 7, 14, T31);
- SET(b, c, d, a, 12, 20, T32);
-#undef SET
-
- /* Round 3. */
- /* Let [abcd k s t] denote the operation
- a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */
-#define H(x, y, z) ((x) ^ (y) ^ (z))
-#define SET(a, b, c, d, k, s, Ti)\
- t = a + H(b,c,d) + X[k] + Ti;\
- a = ROTATE_LEFT(t, s) + b
- /* Do the following 16 operations. */
- SET(a, b, c, d, 5, 4, T33);
- SET(d, a, b, c, 8, 11, T34);
- SET(c, d, a, b, 11, 16, T35);
- SET(b, c, d, a, 14, 23, T36);
- SET(a, b, c, d, 1, 4, T37);
- SET(d, a, b, c, 4, 11, T38);
- SET(c, d, a, b, 7, 16, T39);
- SET(b, c, d, a, 10, 23, T40);
- SET(a, b, c, d, 13, 4, T41);
- SET(d, a, b, c, 0, 11, T42);
- SET(c, d, a, b, 3, 16, T43);
- SET(b, c, d, a, 6, 23, T44);
- SET(a, b, c, d, 9, 4, T45);
- SET(d, a, b, c, 12, 11, T46);
- SET(c, d, a, b, 15, 16, T47);
- SET(b, c, d, a, 2, 23, T48);
-#undef SET
-
- /* Round 4. */
- /* Let [abcd k s t] denote the operation
- a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */
-#define I(x, y, z) ((y) ^ ((x) | ~(z)))
-#define SET(a, b, c, d, k, s, Ti)\
- t = a + I(b,c,d) + X[k] + Ti;\
- a = ROTATE_LEFT(t, s) + b
- /* Do the following 16 operations. */
- SET(a, b, c, d, 0, 6, T49);
- SET(d, a, b, c, 7, 10, T50);
- SET(c, d, a, b, 14, 15, T51);
- SET(b, c, d, a, 5, 21, T52);
- SET(a, b, c, d, 12, 6, T53);
- SET(d, a, b, c, 3, 10, T54);
- SET(c, d, a, b, 10, 15, T55);
- SET(b, c, d, a, 1, 21, T56);
- SET(a, b, c, d, 8, 6, T57);
- SET(d, a, b, c, 15, 10, T58);
- SET(c, d, a, b, 6, 15, T59);
- SET(b, c, d, a, 13, 21, T60);
- SET(a, b, c, d, 4, 6, T61);
- SET(d, a, b, c, 11, 10, T62);
- SET(c, d, a, b, 2, 15, T63);
- SET(b, c, d, a, 9, 21, T64);
-#undef SET
-
- /* Then perform the following additions. (That is increment each
- of the four registers by the value it had before this block
- was started.) */
- pms->abcd[0] += a;
- pms->abcd[1] += b;
- pms->abcd[2] += c;
- pms->abcd[3] += d;
-}
-
-void
-md5_init(md5_state_t *pms)
-{
- pms->count[0] = pms->count[1] = 0;
- pms->abcd[0] = 0x67452301;
- pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476;
- pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301;
- pms->abcd[3] = 0x10325476;
-}
-
-void
-md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
-{
- const md5_byte_t *p = data;
- int left = nbytes;
- int offset = (pms->count[0] >> 3) & 63;
- md5_word_t nbits = (md5_word_t)(nbytes << 3);
-
- if (nbytes <= 0)
- return;
-
- /* Update the message length. */
- pms->count[1] += nbytes >> 29;
- pms->count[0] += nbits;
- if (pms->count[0] < nbits)
- pms->count[1]++;
-
- /* Process an initial partial block. */
- if (offset) {
- int copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
-
- memcpy(pms->buf + offset, p, copy);
- if (offset + copy < 64)
- return;
- p += copy;
- left -= copy;
- md5_process(pms, pms->buf);
- }
-
- /* Process full blocks. */
- for (; left >= 64; p += 64, left -= 64)
- md5_process(pms, p);
-
- /* Process a final partial block. */
- if (left)
- memcpy(pms->buf, p, left);
-}
-
-void
-md5_finish(md5_state_t *pms, md5_byte_t digest[16])
-{
- static const md5_byte_t pad[64] = {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
- md5_byte_t data[8];
- int i;
-
- /* Save the length before padding. */
- for (i = 0; i < 8; ++i)
- data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
- /* Pad to 56 bytes mod 64. */
- md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
- /* Append the length. */
- md5_append(pms, data, 8);
- for (i = 0; i < 16; ++i)
- digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
-}
diff --git a/blahtexml/source/md5.h b/blahtexml/source/md5.h
deleted file mode 100644
index fd6a32d..0000000
--- a/blahtexml/source/md5.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- L. Peter Deutsch
- ghost@aladdin.com
-
- */
-/* $Id: md5.h,v 1.1.1.1 2007/12/23 13:02:11 gvanas Exp $ */
-/*
- Independent implementation of MD5 (RFC 1321).
-
- This code implements the MD5 Algorithm defined in RFC 1321, whose
- text is available at
- http://www.ietf.org/rfc/rfc1321.txt
- The code is derived from the text of the RFC, including the test suite
- (section A.5) but excluding the rest of Appendix A. It does not include
- any code or documentation that is identified in the RFC as being
- copyrighted.
-
- The original and principal author of md5.h is L. Peter Deutsch
- <ghost@aladdin.com>. Other authors are noted in the change history
- that follows (in reverse chronological order):
-
- 2002-04-13 lpd Removed support for non-ANSI compilers; removed
- references to Ghostscript; clarified derivation from RFC 1321;
- now handles byte order either statically or dynamically.
- 1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
- 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
- added conditionalization for C++ compilation from Martin
- Purschke <purschke@bnl.gov>.
- 1999-05-03 lpd Original version.
- */
-
-#ifndef md5_INCLUDED
-# define md5_INCLUDED
-
-/*
- * This package supports both compile-time and run-time determination of CPU
- * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be
- * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is
- * defined as non-zero, the code will be compiled to run only on big-endian
- * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to
- * run on either big- or little-endian CPUs, but will run slightly less
- * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined.
- */
-
-typedef unsigned char md5_byte_t; /* 8-bit byte */
-typedef unsigned int md5_word_t; /* 32-bit word */
-
-/* Define the state of the MD5 Algorithm. */
-typedef struct md5_state_s {
- md5_word_t count[2]; /* message length in bits, lsw first */
- md5_word_t abcd[4]; /* digest buffer */
- md5_byte_t buf[64]; /* accumulate block */
-} md5_state_t;
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/* Initialize the algorithm. */
-void md5_init(md5_state_t *pms);
-
-/* Append a string to the message. */
-void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes);
-
-/* Finish the message and return the digest. */
-void md5_finish(md5_state_t *pms, md5_byte_t digest[16]);
-
-#ifdef __cplusplus
-} /* end extern "C" */
-#endif
-
-#endif /* md5_INCLUDED */
diff --git a/blahtexml/source/md5Wrapper.cpp b/blahtexml/source/md5Wrapper.cpp
deleted file mode 100644
index 2a54670..0000000
--- a/blahtexml/source/md5Wrapper.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// File "md5Wrapper.cpp"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include "md5.h"
-#include <sstream>
-#include <iomanip>
-
-using namespace std;
-
-string ComputeMd5(const string& input)
-{
- md5_state_s state;
- unsigned char buf[16];
-
- md5_init(&state);
-
- md5_append(
- &state,
- reinterpret_cast<const md5_byte_t*>(input.c_str()),
- input.size()
- );
-
- md5_finish(
- &state,
- reinterpret_cast<md5_byte_t*>(buf)
- );
-
- ostringstream result;
- result << hex << setfill('0');
- for (int i = 0; i < 16; i++)
- result << setw(2) << static_cast<unsigned int>(buf[i]);
-
- return result.str();
-}
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/blahtexml/source/md5Wrapper.h b/blahtexml/source/md5Wrapper.h
deleted file mode 100644
index b959f98..0000000
--- a/blahtexml/source/md5Wrapper.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// File "md5Wrapper.h"
-//
-// blahtex (version 0.4.4)
-// a TeX to MathML converter designed with MediaWiki in mind
-// Copyright (C) 2006, David Harvey
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifndef BLAHTEX_MD5_WRAPPER_H
-#define BLAHTEX_MD5_WRAPPER_H
-
-#include <string>
-
-// This is a C++ wrapper for the md5 code in md5.c/md5.h.
-//
-// Thanks to the authors of md5.c/m5.h for making their code freely
-// available.
-//
-// Returns the md5 as a 32-character string.
-extern std::string ComputeMd5(const std::string& input);
-
-#endif
-
-// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
diff --git a/cert8.db b/cert8.db
deleted file mode 100644
index 8b13789..0000000
--- a/cert8.db
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/es_PE/template_blacklist b/es_PE/template_blacklist
deleted file mode 100644
index cbf22b3..0000000
--- a/es_PE/template_blacklist
+++ /dev/null
@@ -1,31 +0,0 @@
-Plantilla:Añadir referencias
-Plantilla:Semiprotegida
-Plantilla:Semiprotegida2
-Plantilla:Semiprotegido
-Plantilla:Protegido
-Plantilla:Protegida
-Plantilla:Pp-template
-Plantilla:Pp-semi-template
-Plantilla:Bueno
-Plantilla:Artículo bueno
-Plantilla:Artículo destacado
-Plantilla:Largo
-Plantilla:Traducción
-Plantilla:Revisar Trad
-Plantilla:Referencias
-Plantilla:Enobras
-Plantilla:En obras
-Plantilla:Incompleto
-Plantilla:En desarrollo
-Plantilla:Endesarrollo
-Plantilla:Wikiquote
-Plantilla:Wikinews
-Plantilla:Wiktionary
-Plantilla:Wikiversidad
-Plantilla:Destacado
-Plantilla:Portal
-Plantilla:Commons
-Plantilla:Commonscat
-Plantilla:Cita requerida
-Plantilla:Esbozo sección
-Plantilla:Sinnotasalpie
diff --git a/generated/dummy b/generated/dummy
deleted file mode 100644
index 8b13789..0000000
--- a/generated/dummy
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/locale/es/LC_MESSAGES/org.laptop.WikipediaActivity.mo b/locale/es/LC_MESSAGES/org.laptop.WikipediaActivity.mo
deleted file mode 100644
index 480d8a9..0000000
--- a/locale/es/LC_MESSAGES/org.laptop.WikipediaActivity.mo
+++ /dev/null
Binary files differ
diff --git a/locale/es/activity.linfo b/locale/es/activity.linfo
deleted file mode 100644
index 23efebc..0000000
--- a/locale/es/activity.linfo
+++ /dev/null
@@ -1,2 +0,0 @@
-[Activity]
-name = Wikipedia
diff --git a/mwlib/EasyTimeline.pl b/mwlib/EasyTimeline.pl
deleted file mode 100755
index 6486224..0000000
--- a/mwlib/EasyTimeline.pl
+++ /dev/null
@@ -1,4718 +0,0 @@
-#!/usr/bin/env perl
-
-# Copyright (C) 2004 Erik Zachte , email xxx\@chello.nl (nospam: xxx=epzachte)
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 2
-# as published by the Free Software Foundation.
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the GNU General Public License for more details, at
-# http://www.fsf.org/licenses/gpl.html
-
-# history:
-# 1.5 May 27 2004 :
-# - when a chart contains only one bar this bar was always centered in the image
-# now AlignBars works well in this case aslo ("justify" treated as "center")
-# - interwiki links reinstalled e.g. [[de:Gorbachev]]
-# - error msgs corrected
-# - minimum image size fixed
-# - line numbering adapted <timeline>spaces<br> does not count as line one in Wikipedia
-# - line breaks in wiki links parsed correctly [[Vladimir~Ilyich~Lenin]]
-# - partial url shown as hint for external link (in GIF/PNG)
-# - BarData: no attribute 'text:..' supplied -> default to space = show no text on axis
-# - PlotData: new attribute 'anchor:..'
-# - revert html encoding of '<' & '>' by MediaWiki
-
-# 1.6 May 28 2004 :
-# - SVG decode special chars in SVG input fixed
-# - BarData: new attributes 'barset:..' and 'barcount:..' # autoincrement bar id
-# - PlotData: new attribute 'barset:..'
-# - LineData: new attribute 'layer:..', draw lines to back or front of bars and texts
-
-# 1.7
-# - EscapeShellArg (Tim Starling)
-
-# 1.8 June .. 2004 :
-# - optional autosizing of image (implied when auto incrementing bar count (also new))
-# - presentation left-right order of bars reversed on TimeAxis = orientation:vertical
-# - TimeAxis option 'order:[normal|reverse]' added
-# - BarData: option barcount replaced by auto incrementing bar count and 'break' and 'skip' attributes
-# - DrawLines -> LineData (command renamed, but also restructured like PlotData, TextData)
-# - new drawing options for LineData, now also lines parallel to time axis, or between arbitrary points
-# - Preset command added (specify default settings with 'Preset =', two sets to start with)
-# - 'text' attribute parsing bugs (# or : in text gave problems, spaces got lost)
-# - PlotArea new attributes 'top' and 'right' make it possible to define plot area margins only
-# so resizing image does not imply adjusting PlotArea 'width' and 'height'
-# - PlotData option 'shift': only changing x or y value is now possible, e.g. shift=(,10)
-# - command ScaleMajor: subs for time axis can now be specified verbatim in option 'text'
-# - extra validation checks, defaults, etc
-# - function PlotScale now provides workaround for Ploticus bug: auto incrementing dates failed
-
-# 1.9 June 2004
-# - stub display order fixed on non time axis
-
-# 1.10 July 2004
-# - tempory debug code (removed)
-
-# 1.11 August 2004
-# - dot in folder name in input path was misunderstood as start of file extension
-# - utf-8 chars within 160-255 range are translated to extended ascii
-# however internal font used by Ploticus has strange mapping so some are replaced
-# by undercore or unaccented version of character
-# this is a make do solution until full unicode support with external fonts will be added
-
- $version = "1.9" ;
-
- use Time::Local ;
- use Getopt::Std ;
- use Cwd ;
-
- $| = 1; # flush screen output
-
- print "EasyTimeline version $version\n" .
- "Copyright (C) 2004 Erik Zachte\n" .
- "Email xxx\@chello.nl (nospam: xxx=epzachte)\n\n" .
- "This program is free software; you can redistribute it\n" .
- "and/or modify it under the terms of the \n" .
- "GNU General Public License version 2 as published by\n" .
- "the Free Software Foundation\n" .
- "------------------------------------------------------\n" ;
-
- &SetImageFormat ;
- &ParseArguments ;
- &InitFiles ;
-
- open "FILE_IN", "<", $file_in ;
- @lines = <FILE_IN> ;
- close "FILE_IN" ;
-
- &InitVars ;
- &ParseScript ;
-
- if ($CntErrors == 0)
- { &WritePlotFile ; }
-
- if ($CntErrors == 1)
- { &Abort ("1 error found") ; }
- elsif ($CntErrors > 1)
- { &Abort ("$CntErrors errors found") ; }
- else
- {
- if (defined @Info)
- {
- print "\nINFO\n" ;
- print @Info ;
- print "\n" ;
- }
- if (defined @Warnings)
- {
- print "\nWARNING(S)\n" ;
- print @Warnings ;
- print "\n" ;
- }
-
- if (! (-e $file_bitmap))
- {
- print "\nImage $file_bitmap not created.\n" ;
- if ((! (-e "pl.exe")) && (! (-e "pl")))
- { print "\nPloticus not found in local folder. Is it on your system path?\n" ; }
- }
- elsif (! (-e $file_vector))
- {
- print "\nImage $file_vector not created.\n" ;
- }
- else
- { print "\nREADY\nNo errors found.\n" ; }
- }
-
- exit ;
-
-sub ParseArguments
-{
- my $options ;
- getopt ("iTAPe", \%options) ;
-
- &Abort ("Specify input file as: -i filename") if (! defined (@options {"i"})) ;
-
- $file_in = @options {"i"} ;
- $listinput = @options {"l"} ; # list all input lines (not recommended)
- $linkmap = @options {"m"} ; # make clickmap for inclusion in html
- $makehtml = @options {"h"} ; # make test html file with gif/png + svg output
- $bypass = @options {"b"} ; # do not use in Wikipedia:bypass some checks
- $showmap = @options {"d"} ; # debug: shows clickable areas in gif/png
- # The following parameters are used by MediaWiki
- # to pass config settings from LocalSettings.php to
- # the perl script
- $tmpdir = @options {"T"} ; # For MediaWiki: temp directory to use
- $plcommand = @options {"P"} ; # For MediaWiki: full path of ploticus command
- $articlepath=@options {"A"} ; # For MediaWiki: Path of an article, relative to this servers root
-
- if (! defined @options {"A"} )
- { $articlepath="http://en.wikipedia.org/wiki/\$1"; }
-
- if (! -e $file_in)
- { &Abort ("Input file '" . $file_in . "' not found.") ; }
-}
-
-sub InitVars
-{
- $true = 1 ;
- $false = 0 ;
- $CntErrors = 0 ;
- $LinkColor = "brightblue" ;
- $MapPNG = $false ; # switched when link or hint found
- $MapSVG = $false ; # switched when link found
- $WarnTextOutsideArea = 0 ;
- $WarnOnRightAlignedText = 0 ;
-
- $hPerc = &EncodeInput ("\%") ;
- $hAmp = &EncodeInput ("\&") ;
- $hAt = &EncodeInput ("\@") ;
- $hDollar = &EncodeInput ("\$") ;
- $hBrO = &EncodeInput ("\(") ;
- $hBrC = &EncodeInput ("\)") ;
- $hSemi = &EncodeInput ("\;") ;
- $hIs = &EncodeInput ("\=") ;
- $hLt = &EncodeInput ("\<") ;
- $hGt = &EncodeInput ("\>") ;
-}
-
-sub InitFiles
-{
- print "\nInput: Script file $file_in\n" ;
-
- $file = $file_in ;
-# 1.10 dot ignore dots in folder names ->
- $file =~ s/\.[^\\\/\.]*$// ; # remove extension
- $file_name = $file ;
- $file_bitmap = $file . "." . $fmt ;
- $file_vector = $file . ".svg" ;
- $file_png = $file . ".png" ;
- $file_htmlmap = $file . ".map" ;
- $file_html = $file . ".html" ;
- $file_errors = $file . ".err" ;
-# $file_pl_info = $file . ".inf" ;
-# $file_pl_err = $file . ".err" ;
- print "Output: Image files $file_bitmap & $file_vector\n" ;
-
- if ($linkmap)
- { print " Map file $file_htmlmap (add to html for clickable map)\n" ; }
- if ($makehtml)
- { print " HTML test file $file_html\n" ; }
-
- # remove previous output
- if (-e $file_bitmap) { unlink $file_bitmap ; }
- if (-e $file_vector) { unlink $file_vector ; }
- if (-e $file_png) { unlink $file_png ; }
- if (-e $file_htmlmap) { unlink $file_htmlmap ; }
- if (-e $file_html) { unlink $file_html ; }
- if (-e $file_errors) { unlink $file_errors ; }
-}
-
-sub SetImageFormat
-{
- $env = "" ;
-# $dir = cwd() ; # is there a better way to detect OS?
-# if ($dir =~ /\//) { $env = "Linux" ; $fmt = "png" ; $pathseparator = "/";}
-# if ($dir =~ /\\/) { $env = "Windows" ; $fmt = "gif" ; $pathseparator = "\\";}
-# cwd always to returns '/'s ? ->
- $OS = $^O ;
- if ($OS =~ /darwin/i)
- { $env = "Linux"; $fmt = "png" ; $pathseparator = "/";}
- elsif ($OS =~ /win/i)
- { $env = "Windows" ; $fmt = "gif" ; $pathseparator = "\\";}
- else
- { $env = "Linux" ; $fmt = "png" ; $pathseparator = "/";}
-
- if ($env ne "")
- { print "\nOS $env detected -> create image in $fmt format.\n" ; }
- else
- {
- print "\nOS not detected. Assuming Windows -> create image in $fmt format.\n" ;
- $env = "Windows" ;
- }
-}
-sub ParseScript
-{
- my $command ; # local version, $Command = global
- $LineNo = 0 ;
- $InputParsed = $false ;
- $CommandNext = "" ;
- $DateFormat = "x.y" ;
-
- $firstcmd = $true ;
- &GetCommand ;
-
- &StoreColor ("white", &EncodeInput ("gray(0.999)"), "") ;
- &StoreColor ("barcoldefault", &EncodeInput ("rgb(0,0.6,0)"), "") ;
-
- while (! $InputParsed)
- {
- if ($Command =~ /^\s*$/)
- { &GetCommand ; next ; }
-
- if (! ($Command =~ /$hIs/))
- { &Error ("Invalid statement. No '=' found.") ;
- &GetCommand ; next ; }
-
- if ($Command =~ /$hIs.*$hIs/)
- { &Error ("Invalid statement. Multiple '=' found.") ;
- &GetCommand ; next ; }
-
- my ($name, $value) = split ($hIs, $Command) ;
- $name =~ s/^\s*(.*?)\s*$/$1/ ;
-
- if ($name =~ /PlotDividers/i)
- { &Error ("Command 'PlotDividers' has been renamed to 'LineData', please adjust.") ;
- &GetCommand ; next ; }
- if ($name =~ /DrawLines/i)
- { &Error ("Command 'DrawLines' has been renamed to 'LineData', please adjust.\n" .
- " Reason for change is consistency: LineData now follows the same syntax rules as PlotData and TextData.") ;
- &GetCommand ; next ; }
-
- if ((! ($name =~ /^(?:Define)\s/)) &&
- (! ($name =~ /^(?:AlignBars|BarData|
- BackgroundColors|Colors|DateFormat|LineData|
- ScaleMajor|ScaleMinor|
- LegendLeft|LegendTop|
- ImageSize|PlotArea|Legend|
- Period|PlotData|Preset|
- TextData|TimeAxis)$/xi)))
- { &ParseUnknownCommand ;
- &GetCommand ; next ; }
-
- $value =~ s/^\s*(.*?)\s*// ;
- if (! ($name =~ /^(?:BarData|Colors|LineData|PlotData|TextData)$/i))
- {
- if ((! (defined ($value))) || ($value eq ""))
- {
- if ($name =~ /Preset/i)
- {
- &Error ("$name definition incomplete. No value specified\n" .
- " At the moment only one preset exists: 'TimeVertical_OneBar_UnitYear'.\n" .
- " See also meta.wikipedia.org/wiki/EasyTimeline/Presets") ;
- }
- else
- { &Error ("$name definition incomplete. No attributes specified") ; }
- &GetCommand ; next ; }
- }
-
- if ($name =~ /^(?:BackgroundColors|Colors|Period|ScaleMajor|ScaleMinor|TimeAxis)$/i)
- {
- my @attributes = split (" ", $value) ;
- foreach $attribute (@attributes)
- {
- my ($attrname, $attrvalue) = split ("\:", $attribute) ;
- if (! ($name."-".$attrname =~ /^(?:Colors-Value|Colors-Legend|
- Period-From|Period-Till|
- ScaleMajor-Color|ScaleMajor-Unit|ScaleMajor-Increment|ScaleMajor-Start|
- ScaleMinor-Color|ScaleMinor-Unit|ScaleMinor-Increment|ScaleMinor-Start|
- BackgroundColors-Canvas|BackgroundColors-Bars|
- TimeAxis-Orientation|TimeAxis-Format)$/xi))
- { &Error ("$name definition invalid. Unknown attribute '$attrname'.") ;
- &GetCommand ; next ; }
-
- if ((! defined ($attrvalue)) || ($attrvalue eq ""))
- { &Error ("$name definition incomplete. No value specified for attribute '$attrname'.") ;
- &GetCommand ; next ; }
- }
- }
-
- if ($Command =~ /^AlignBars/i) { &ParseAlignBars ; }
- elsif ($Command =~ /^BackgroundColors/i) { &ParseBackgroundColors ; }
- elsif ($Command =~ /^BarData/i) { &ParseBarData ; }
- elsif ($Command =~ /^Colors/i) { &ParseColors ; }
- elsif ($Command =~ /^DateFormat/i) { &ParseDateFormat ; }
- elsif ($Command =~ /^Define/i) { &ParseDefine ; }
- elsif ($Command =~ /^ImageSize/i) { &ParseImageSize ; }
- elsif ($Command =~ /^Legend/i) { &ParseLegend ; }
- elsif ($Command =~ /^LineData/i) { &ParseLineData ; }
- elsif ($Command =~ /^Period/i) { &ParsePeriod ; }
- elsif ($Command =~ /^PlotArea/i) { &ParsePlotArea ; }
- elsif ($Command =~ /^PlotData/i) { &ParsePlotData ; }
- elsif ($Command =~ /^Preset/i) { &ParsePreset ; }
- elsif ($Command =~ /^Scale/i) { &ParseScale ; }
- elsif ($Command =~ /^TextData/i) { &ParseTextData ; }
- elsif ($Command =~ /^TimeAxis/i) { &ParseTimeAxis ; }
-
- &GetCommand ;
- $firstcmd = $false ;
- }
-
- if ($CntErrors == 0)
- { &DetectMissingCommands ; }
-
- if ($CntErrors == 0)
- { &ValidateAndNormalizeDimensions ; }
-}
-
-
-sub GetLine
-{
- if ($#lines < 0)
- { $InputParsed = $true ; return ("") ; }
-
- # running in Wikipedia context and first line empty ?
- # skip first line without incrementing line count
- # this is part behind <timeline> and will not be thought of as line 1
- if (defined @options {"A"})
- {
- if (($#lines >= 0) && (@lines [0] =~ /^\s*$/))
- { $Line = shift (@lines) ; }
- }
-
- $Line = "" ;
- while (($#lines >= 0) && ($Line =~ /^\s*$/))
- {
- $LineNo ++ ;
- $Line = shift (@lines) ;
- chomp ($Line) ;
-
- if ($listinput)
- { print "$LineNo: " . &DecodeInput ($Line) . "\n" ; }
-
- # preserve '#' within double quotes
- $Line =~ s/(\"[^\"]*\")/$a=$1,$a=~s^\#^\%\?\+^g,$a/ge ;
-
- $Line =~ s/#>.*?<#//g ;
- if ($Line =~ /#>/)
- {
- $commentstart = $LineNo ;
- $Line =~ s/#>.*?$// ;
- }
- elsif ($Line =~ /<#/)
- {
- undef $commentstart ;
- $Line =~ s/^.*?<#//x ;
- }
- elsif (defined ($commentstart))
- { $Line = "" ; next ; }
-
- # remove single line comments (keep html char tags, like &#32;)
- $Line =~ s/\&\#/\&\$\%/g ;
- $Line =~ s/\#.*$// ;
- $Line =~ s/\&\$\%/\&\#/g ;
- $Line =~ s/\%\?\+/\#/g ;
- $Line =~ s/\s*$//g ;
- $Line =~ s/\t/ /g ;
- }
-
- if ($Line !~ /^\s*$/)
- {
- $Line = &EncodeInput ($Line) ;
-
- if (! ($Line =~ /^\s*Define/i))
- { $Line =~ s/($hDollar[a-zA-Z0-9]+)/&GetDefine($Line,$1)/ge ; }
- }
-
- if (($#lines < 0) && (defined ($commentstart)))
- { &Error2 ("No matching end of comment found for comment block starting at line $commentstart.\n" .
- "Text between \#> and <\# (multiple lines) or following \# (single line) will be treated as comment.") ; }
- return ($Line) ;
-}
-
-sub GetCommand
-{
- undef (%Attributes) ;
- $Command = "" ;
-
- if ($CommandNext ne "")
- {
- $Command = $CommandNext ;
- $CommandNext = "" ;
- }
- else
- { $Command = &GetLine ; }
-
- if ($Command =~ /^\s/)
- {
- &Error ("New command expected instead of data line (= line starting with spaces). Data line(s) ignored.\n") ;
- $Command = &GetLine ;
- while (($#lines >= 0) && ($Command =~ /^\s/))
- { $Command = &GetLine ; }
- }
-
- if ($Command =~ /^[^\s]/)
- {
- $line = $Command ;
- $line =~ s/^.*$hIs\s*// ;
- &CollectAttributes ($line) ;
- }
-}
-
-sub GetData
-{
- undef (%Attributes) ;
- $Command = "" ;
- $NoData = $false ;
- my $line = &GetLine ;
-
- if ($line =~ /^[^\s]/)
- {
- $CommandNext = $line ;
- $NoData = $true ;
- return ("") ;
- }
-
- if ($line =~ /^\s*$/)
- {
- $NoData = $true ;
- return ("") ;
- }
-
- $line =~ s/^\s*//g ;
- &CollectAttributes ($line) ;
-}
-
-sub CollectAttributes
-{
- my $line = shift ;
-
- $line =~ s/(\slink\:[^\s\:]*)\:/$1'colon'/i ; # replace colon (:), would conflict with syntax
- $line =~ s/(\stext\:[^\s\:]*)\:/$1'colon'/i ; # replace colon (:), would conflict with syntax
- $line =~ s/(https?)\:/$1'colon'/i ; # replace colon (:), would conflict with syntax
-
- my $text ;
- ($line, $text) = &ExtractText ($line) ;
- $text =~ s/'colon'/:/ ;
-
- $line =~ s/( $hBrO .+? $hBrC )/&RemoveSpaces($1)/gxe ;
- $line =~ s/\s*\:\s*/:/g ;
- $line =~ s/([a-zA-Z0-9\_]+)\:/lc($1) . ":"/gxe ;
- @Fields = split (" ", $line) ;
-
- $name = "" ;
- foreach $field (@Fields)
- {
- if ($field =~ /\:/)
- {
- ($name, $value) = split (":", $field) ;
- $name =~ s/^\s*(.*)\s*$/lc($1)/gxe ;
- $value =~ s/^\s*(.*)\s*$/$1/gxe ;
- if (($name ne "bar") && ($name ne "text") && ($name ne "link") && ($name ne "legend")) # && ($name ne "hint")
- { $value = lc ($value) ; }
-
- if ($name eq "link") # restore colon
- { $value =~ s/'colon'/:/ ; }
-
- if ($value eq "")
- {
- if ($name =~ /Text/i)
- { $value = " " ; }
- else
- { &Error ("No value specified for attribute '$name'. Attribute ignored.") ; }
- }
- else
- { @Attributes {$name} = $value ; }
- }
- else
- {
- if (defined (@Attributes {"single"}))
- { &Error ("Invalid attribute '$field' ignored.\nSpecify attributes as 'name:value' pair(s).") ; }
- else
- {
- $field =~ s/^\s*(.*)\s*$/$1/gxe ;
- @Attributes {"single"} = $field ;
- }
- }
- }
- if (($name ne "") && (@Attributes {"single"} ne ""))
- {
- &Error ("Invalid attribute '" . @Attributes {"single"} . "' ignored.\nSpecify attributes as 'name:value' pairs.") ;
- delete (@Attributes {"single"}) ;
- }
-
- if ((defined ($text)) && ($text ne ""))
- { @Attributes {"text"} = &ParseText ($text) ; }
-}
-
-sub GetDefine
-{
- my $command = shift ;
- my $const = shift ;
- $const = lc ($const) ;
- my $value = @Consts {lc ($const)} ;
- if (! defined ($value))
- {
- &Error ("Unknown constant. 'Define $const = ... ' expected.") ;
- return ($const);
- }
- return ($value) ;
-}
-
-sub ParseAlignBars
-{
- &CheckPreset ("AlignBars") ;
-
- $align = @Attributes {"single"} ;
- if (! ($align =~ /^(?:justify|early|late)$/i))
- { &Error ("AlignBars value '$align' invalid. Specify 'justify', 'early' or 'late'.") ; return ; }
-
- $AlignBars = lc ($align) ;
-}
-
-sub ParseBackgroundColors
-{
- if (! &ValidAttributes ("BackgroundColors"))
- { &GetData ; next ;}
-
- &CheckPreset ("BackGroundColors") ;
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
- if ($attribute =~ /Canvas/i)
- {
- if (! &ColorPredefined ($attrvalue))
- {
- if (! defined (@Colors {lc ($attrvalue)}))
- { &Error ("BackgroundColors definition invalid. Attribute '$attribute': unknown color '$attrvalue'.\n" .
- " Specify command 'Color' before this command.") ; return ; }
- }
- if (defined (@Colors {lc ($attrvalue)}))
- { @Attributes {"canvas"} = @Colors { lc ($attrvalue) } ; }
- else
- { @Attributes {"canvas"} = lc ($attrvalue) ; }
- }
- elsif ($attribute =~ /Bars/i)
- {
- if (! defined (@Colors {lc ($attrvalue)}))
- { &Error ("BackgroundColors definition invalid. Attribute '$attribute' unknown color '$attrvalue'.\n" .
- " Specify command 'Color' before this command.") ; return ; }
-
- @Attributes {"bars"} = lc ($attrvalue) ;
- }
- }
-
- %BackgroundColors = %Attributes ;
-}
-
-sub ParseBarData
-{
- &GetData ;
- if ($NoData)
- { &Error ("Data expected for command 'BarData', but line is not indented.\n") ; return ; }
-
- my ($bar, $text, $link, $hint, $barset) ; # , $barcount) ;
-
- BarData:
- while ((! $InputParsed) && (! $NoData))
- {
- if (! &ValidAttributes ("BarData"))
- { &GetData ; next ;}
-
- $bar = "" ; $link = "" ; $hint = "" ; $barset = "" ; # $barcount = "" ;
-
- my $data2 = $data ;
- ($data2, $text) = &ExtractText ($data2) ;
- @Attributes = split (" ", $data2) ;
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
- if ($attribute =~ /^Bar$/i)
- {
- $bar = $attrvalue ;
- }
- elsif ($attribute =~ /^BarSet$/i)
- {
- $barset = $attrvalue ;
- }
- # elsif ($attribute =~ /^BarCount$/i)
- # {
- # $barcount = $attrvalue ;
- # if (($barcount !~ /^\d?\d?\d$/) || ($barcount < 2) || ($barcount > 200))
- # { &Error ("BarData attribute 'barcount' invalid. Specify a number between 2 and 200\n") ;
- # &GetData ; next BarData ; }
- # }
- elsif ($attribute =~ /^Text$/i)
- {
- $text = $attrvalue ;
- $text =~ s/\\n/~/gs ;
- if ($text =~ /\~/)
- { &Warning ("BarData attribute 'text' contains ~ (tilde).\n" .
- "Tilde will not be translated into newline character (only in PlotData)") ; }
- if ($text =~ /\^/)
- { &Warning ("BarData attribute 'text' contains ^ (caret).\n" .
- "Caret will not be translated into tab character (only in PlotData)") ; }
- }
- elsif ($attribute =~ /^Link$/i)
- {
- $link = &ParseText ($attrvalue) ;
-
- if ($link =~ /\[.*\]/)
- { &Error ("BarData attribute 'link' contains implicit (wiki style) link.\n" .
- "Use implicit link style with attribute 'text' only.\n") ;
- &GetData ; next BarData ; }
-
- $link = &EncodeURL (&NormalizeURL ($link)) ;
-
- $MapPNG = $true ;
- }
- }
-
- if (($bar eq "") && ($barset eq ""))
- { &Error ("BarData attribute missing. Specify either 'bar' of 'barset'.\n") ;
- &GetData ; next BarData ; }
-
- if (($bar ne "") && ($barset ne ""))
- { &Error ("BarData attributes 'bar' and 'barset' are mutually exclusive.\nSpecify one of these per data line\n") ;
- &GetData ; next BarData ; }
-
- # if (($barset ne "") && ($barcount eq ""))
- # { &Error ("BarData attribute 'barset' specified without attribute 'barcount'.\n") ;
- # &GetData ; next BarData ; }
-
- # if (($barset eq "") && ($barcount ne ""))
- # { &Error ("BarData attribute 'barcount' specified without attribute 'barset'.\n") ;
- # &GetData ; next BarData ; }
-
- if (($barset ne "") && ($link ne ""))
- { &Error ("BarData attribute 'link' not valid in combination with attribute 'barset'.\n") ;
- &GetData ; next BarData ; }
-
- if ($link ne "")
- {
- if ($text =~ /\[.*\]/)
- {
- &Warning ("BarData contains implicit link(s) in attribute 'text' and explicit attribute 'link'.\n" .
- "Implicit link(s) ignored.") ;
- $text =~ s/\[+ (?:[^\|]* \|)? ([^\]]*) \]+/$1/gx ;
- }
-
- if ($hint eq "")
- { $hint = &ExternalLinkToHint ($link) ; }
- }
-
- if (($bar ne "") && ($bar !~ /[a-zA-Z0-9\_]+/))
- { &Error ("BarData attribute bar:'$bar' invalid.\nUse only characters 'a'-'z', 'A'-'Z', '0'-'9', '_'\n") ;
- &GetData ; next BarData ; }
-
- if ($bar ne "")
- {
- if (@Axis {"time"} eq "x")
- { push @Bars, $bar ; }
- else
- { unshift @Bars, $bar ; }
-
- if ($text ne "")
- { @BarLegend {lc ($bar)} = $text ; }
- else
- { @BarLegend {lc ($bar)} = " " ; }
-
- if ($link ne "")
- { @BarLink {lc ($bar)} = $link ; }
- }
- else
- {
-# for ($b = 1 ; $b <= $barcount ; $b++)
-# {
-# $bar = $barset . "#" . $b ;
-
- $bar = $barset . "#1" ;
- if (@Axis {"time"} eq "x")
- { push @Bars, $bar ; }
- else
- { unshift @Bars, $bar ; }
-
- if ($text ne "")
- { @BarLegend {lc ($bar)} = $text . " - " . $b ; }
- else
- { @BarLegend {lc ($bar)} = " " ; }
-# }
- }
-
-
- &GetData ;
- }
-}
-
-sub ParseColors
-{
-
- &GetData ;
- if ($NoData)
- { &Error ("Data expected for command 'Colors', but line is not indented.\n") ; return ; }
-
- Colors:
- while ((! $InputParsed) && (! $NoData))
- {
- if (! &ValidAttributes ("Colors"))
- { &GetData ; next ;}
-
- &CheckPreset ("Colors") ;
-
- my $addtolegend = $false ;
- my $legendvalue = "" ;
- my $colorvalue = "" ;
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
- if ($attribute =~ /Id/i)
- {
- $colorname = $attrvalue ;
- }
- elsif ($attribute =~ /Legend/i)
- {
- $addtolegend = $true ;
- $legendvalue = $attrvalue ;
- if ($legendvalue =~ /^[yY]$/)
- { push @LegendData, $colorname ; }
- elsif (! ($attrvalue =~ /^[nN]$/))
- {
- $legendvalue = &ParseText ($legendvalue) ;
- push @LegendData, $legendvalue ;
- }
- }
- elsif ($attribute =~ /Value/i)
- {
- $colorvalue = $attrvalue ;
- if ($colorvalue =~ /^white$/i)
- { $colorvalue = "gray" . $hBrO . "0.999" . $hBrC ; }
- }
- }
-
- if (&ColorPredefined ($colorvalue))
- {
- &StoreColor ($colorname, $colorvalue, $legendvalue) ;
- &GetData ; next Colors ;
- }
-
- if ($colorvalue =~ /^[a-z]+$/i)
- {
- if (! ($colorvalue =~ /^(?:gray|rgb|hsb)/i))
- { &Error ("Color value invalid: unknown constant '$colorvalue'.") ;
- &GetData ; next Colors ; }
- }
-
- if (! ($colorvalue =~ /^(?:gray|rgb|hsb) $hBrO .+? $hBrC/xi))
- { &Error ("Color value invalid. Specify constant or 'gray/rgb/hsb(numeric values)' ") ;
- &GetData ; next Colors ; }
-
- if ($colorvalue =~ /^gray/i)
- {
- if ($colorvalue =~ /gray $hBrO (?:0|1|0\.\d+) $hBrC/xi)
- { &StoreColor ($colorname, $colorvalue, $legendvalue) ; }
- else
- { &Error ("Color value invalid. Specify 'gray(x) where 0 <= x <= 1' ") ; }
-
- &GetData ; next Colors ;
- }
-
- if ($colorvalue =~ /^rgb/i)
- {
- my $colormode = substr ($colorvalue,0,3) ;
- if ($colorvalue =~ /rgb $hBrO
- (?:0|1|0\.\d+) \,
- (?:0|1|0\.\d+) \,
- (?:0|1|0\.\d+)
- $hBrC/xi)
- { &StoreColor ($colorname, $colorvalue, $legendvalue) ; }
- else
- { &Error ("Color value invalid. Specify 'rgb(r,g,b) where 0 <= r,g,b <= 1' ") ; }
-
- &GetData ; next Colors ;
- }
-
- if ($colorvalue =~ /^hsb/i)
- {
- my $colormode = substr ($colorvalue,0,3) ;
- if ($colorvalue =~ /hsb $hBrO
- (?:0|1|0\.\d+) \,
- (?:0|1|0\.\d+) \,
- (?:0|1|0\.\d+)
- $hBrC/xi)
- { &StoreColor ($colorname, $colorvalue, $legendvalue) ; }
- else
- { &Error ("Color value invalid. Specify 'hsb(h,s,b) where 0 <= h,s,b <= 1' ") ; }
-
- &GetData ; next Colors ;
- }
-
- &Error ("Color value invalid.") ;
- &GetData ;
- }
-}
-
-sub StoreColor
-{
- my $colorname = shift ;
- my $colorvalue = shift ;
- my $legendvalue = shift ;
- if (defined (@Colors {lc ($colorname)}))
- { &Warning ("Color '$colorname' redefined.") ; }
- @Colors {lc ($colorname)} = lc ($colorvalue) ;
- if ((defined ($legendvalue)) && ($legendvalue ne ""))
- { @ColorLabels {lc ($colorname)} = $legendvalue ; }
-}
-
-sub ParseDateFormat
-{
- &CheckPreset ("DateFormat") ;
-
- my $datevalue = lc (@Attributes {"single"}) ;
- $datevalue =~ s/\s//g ;
- $datevalue = lc ($datevalue) ;
- if (($datevalue ne "dd/mm/yyyy") && ($datevalue ne "mm/dd/yyyy") && ($datevalue ne "yyyy") && ($datevalue ne "x.y"))
- { &Error ("Invalid DateFormat. Specify as 'dd/mm/yyyy', 'mm/dd/yyyy', 'yyyy' or 'x.y'\n" .
- " (use first two only for years >= 1800)\n") ; return ; }
-
- $DateFormat = $datevalue ;
-}
-
-sub ParseDefine
-{
- my $command = $Command ;
- my $command2 = $command ;
- $command2 =~ s/^Define\s*//i ;
-
- my ($name, $value) = split ($hIs, $command2) ;
- $name =~ s/^\s*(.*?)\s*$/$1/g ;
- $value =~ s/^\s*(.*?)\s*$/$1/g ;
-
- if (! ($name =~ /^$hDollar/))
- { &Error ("Define '$name' invalid. Name does not start with '\$'.") ; return ; }
- if (! ($name =~ /^$hDollar[a-zA-Z0-9\_]+$/))
- { &Error ("Define '$name' invalid. Valid characters are 'a'-'z', 'A'-'Z', '0'-'9', '_'.") ; return ; }
-
- $value =~ s/($hDollar[a-zA-Z0-9]+)/&GetDefine($command,$1)/ge ;
- @Consts {lc ($name)} = $value ;
-}
-
-sub ParseLineData
-{
- &GetData ;
- if ($NoData)
- { &Error ("Data expected for command 'LineData', but line is not indented.\n") ; return ; }
-
- if ((! (defined ($DateFormat))) || (! (defined (@Period {"from"}))))
- {
- if (! (defined ($DateFormat)))
- { &Error ("LineData invalid. No (valid) command 'DateFormat' specified in previous lines.") ; }
- else
- { &Error ("LineData invalid. No (valid) command 'Period' specified in previous lines.") ; }
-
- while ((! $InputParsed) && (! $NoData))
- { &GetData ; }
- return ;
- }
-
- my ($at, $from, $till, $atpos, $frompos, $tillpos, $color, $layer, $width, $points, $explanation) ;
-
- $layer = "front" ;
- $width = 2.0 ;
-
- my $data2 = $data ;
-
- LineData:
- while ((! $InputParsed) && (! $NoData))
- {
- $at = "" ; $from = "" ; $till = "" ; $atpos = "" ; $frompos = "" ; $tillpos = "" ; $points = "" ;
-
- &CheckPreset ("LineData") ;
-
- if (! &ValidAttributes ("LineData"))
- { &GetData ; next ;}
-
- if (defined (@LineDefs {"color"})) { $color = @LineDefs {"color"} ; }
- if (defined (@LineDefs {"layer"})) { $layer = @LineDefs {"layer"} ; }
- if (defined (@LineDefs {"width"})) { $width = @LineDefs {"width"} ; }
- if (defined (@LineDefs {"frompos"})) { $frompos = @LineDefs {"frompos"} ; }
- if (defined (@LineDefs {"tillpos"})) { $tillpos = @LineDefs {"tillpos"} ; }
- if (defined (@LineDefs {"atpos"})) { $atpos = @LineDefs {"atpos"} ; }
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
- if ($attribute =~ /^(?:At|From|Till)$/i)
- {
- if ($attrvalue =~ /^Start$/i)
- { $attrvalue = @Period {"from"} ; }
-
- if ($attrvalue =~ /^End$/i)
- { $attrvalue = @Period {"till"} ; }
-
- if (! &ValidDateFormat ($attrvalue))
- { &Error ("LineData attribute '$attribute' invalid.\n" .
- "Date does not conform to specified DateFormat '$DateFormat'.") ;
- &GetData ; next LineData ; }
-
- if (! &ValidDateRange ($attrvalue))
- { &Error ("LineData attribute '$attribute' invalid.\n" .
- "Date '$attrvalue' not within range as specified by command Period.") ;
- &GetData ; next LineData ; }
-
-# if (substr ($attrvalue,6,4) < 1800)
-# { &Error ("LineData attribute '$attribute' invalid. Specify year >= 1800.") ;
-# &GetData ; next LineData ; }
-
- if ($attribute =~ /At/i)
- {
- $at = $attrvalue ; $from = "" ; $till = "" ; }
- elsif ($attribute =~ /From/i)
- { $from = $attrvalue ; $at = "" ; }
- else
- { $till = $attrvalue ; $at = "" ; }
- }
- elsif ($attribute =~ /^(?:atpos|frompos|tillpos)$/i)
- {
- if ($attrvalue =~ /^(?:Start|End)$/i)
- { $attrvalue = lc ($attrvalue) ; }
- elsif (! &ValidAbs ($attrvalue))
- { &Error ("LineData attribute '$attribute' invalid.\n" .
- "Specify value as x[.y][px, in, cm] examples: '200', '20px', '1.3in'") ;
- &GetData ; next LineData ; }
-
- if ($attribute =~ /atpos/i)
- { $atpos = &Normalize ($attrvalue) ; }
- elsif ($attribute =~ /frompos/i)
- { $frompos = &Normalize ($attrvalue) ; }
- else
- { $tillpos = &Normalize ($attrvalue) ; }
- }
- elsif ($attribute =~ /Color/i)
- {
- if ((! &ColorPredefined ($attrvalue)) && (! defined (@Colors {lc ($attrvalue)})))
- { &Error ("LineData attribute '$attribute' invalid. Unknown color '$attrvalue'.\n" .
- " Specify command 'Color' before this command.") ;
- &GetData ; next LineData ; }
-
- if (! &ColorPredefined ($attrvalue))
- { $attrvalue = @Colors {lc ($attrvalue)} ; }
-
- $color = $attrvalue ;
- }
- elsif ($attribute =~ /Layer/i)
- {
- if (! ($attrvalue =~ /^(?:back|front)$/i))
- { &Error ("LineData attribute '$attrvalue' invalid.\nSpecify back(default) or front") ;
- &GetData ; next LineData ; }
-
- $layer = $attrvalue ;
- }
- elsif ($attribute =~ /Points/i)
- {
- $attribute =~ s/\s//g ;
-
- if ($attrvalue !~ /^$hBrO\d+\,\d+$hBrC$hBrO\d+\,\d+$hBrC$/)
- { &Error ("LineData attribute '$attrvalue' invalid.\nSpecify 'points:(x1,y1)(x2,y2)'") ;
- &GetData ; next LineData ; }
-
- $attrvalue =~ s/^$hBrO(\d+)\,(\d+)$hBrC$hBrO(\d+)\,(\d+)$hBrC$/$1,$2,$3,$4/ ;
- $points = $attrvalue ;
- }
- elsif ($attribute =~ /Width/i)
- {
- if (! &ValidAbs ($attrvalue))
- { &Error ("LineData attribute '$attribute' invalid.\n" .
- "Specify value as x[.y][px, in, cm] examples: '200', '20px', '1.3in'") ;
- &GetData ; next LineData ; }
-
- if (($attrvalue < 0.1) || ($attrvalue > 10))
- { &Error ("LineData attribute '$attribute' invalid.\n" .
- "Specify value as between 0.1 and 10") ;
- &GetData ; next LineData ; }
-
- $width = $attrvalue ;
- }
- }
-
- if (($at eq "") && ($from eq "") && ($till eq "") && ($points eq "")) # upd defaults
- {
- if ($color ne "") { @LineDefs {"color"} = $color ; }
- if ($layer ne "") { @LineDefs {"layer"} = $layer ; }
- if ($width ne "") { @LineDefs {"width"} = $width ; }
- if ($atpos ne "") { @LineDefs {"atpos"} = $atpos ; }
- if ($frompos ne "") { @LineDefs {"frompos"} = $frompos ; }
- if ($tillpos ne "") { @LineDefs {"tillpos"} = $tillpos ; }
- }
-
- if ($layer eq "")
- { $layer = "back" ; }
-
- if ($color eq "")
- { $color = "black" ; }
-
- $explanation = "\nA line is defined as follows:\n" .
- " Perpendicular to the time axis: 'at frompos tillpos'\n" .
- " Parralel to the time axis: 'from till atpos'\n" .
- " Any direction: points(x1,y1)(x2,y2)\n" .
- " at,from,till expect date/time values, just like with command PlotData\n" .
- " frompos,tillpos,atpos,x1,x2,y1,y2 expect coordinates (e.g. pixels values)\n" ;
-
- if (($at ne "") && (($from ne "") || ($till ne "") || ($points ne "")))
- { &Error ("LineData attribute 'at' can not be combined with 'from', 'till' or 'points'\n" . $explanation) ;
- $explanation = "" ;
- &GetData ; next LineData ; }
-
- if ((($from ne "") && ($till eq "")) || (($from eq "") && ($till ne "")))
- { &Error ("LineData attributes 'from' and 'till' should always be specified together\n" . $explanation) ;
- $explanation = "" ;
- &GetData ; next LineData ; }
-
- if (($points ne "") && (($from ne "") || ($till ne "") || ($at ne "")))
- { &Error ("LineData attribute 'points' can not be combined with 'at', 'from' or 'till'\n" . $explanation) ;
- $explanation = "" ;
- &GetData ; next LineData ; }
-
- if ($at ne "")
- { push @DrawLines, sprintf ("1|%s|%s|%s|%s|%s|%s\n", $at, $frompos, $tillpos, lc ($color), $width, lc ($layer)) ; }
-
- if ($from ne "")
- { push @DrawLines, sprintf ("2|%s|%s|%s|%s|%s|%s\n", $atpos, $from, $till, lc ($color), $width, lc ($layer)) ; }
-
- if ($points ne "")
- { push @DrawLines, sprintf ("3|%s|%s|%s|%s\n", $points, lc ($color), $width, lc ($layer)) ; }
- &GetData ;
- }
-}
-
-sub ParseImageSize
-{
- if (! &ValidAttributes ("ImageSize")) { return ; }
-
- &CheckPreset ("ImageSize") ;
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
- if ($attribute =~ /Width|Height/i)
- {
- if ($attrvalue !~ /auto/i)
- {
- if (! &ValidAbs ($attrvalue))
- { &Error ("ImageSize attribute '$attribute' invalid.\n" .
- "Specify value as x[.y][px, in, cm] examples: '200', '20px', '1.3in'") ; return ; }
- }
- }
-
- elsif ($attribute =~ /BarIncrement/i)
- {
- if (! &ValidAbs ($attrvalue))
- { &Error ("ImageSize attribute '$attribute' invalid.\n" .
- "Specify value as x[.y][px, in, cm] examples: '200', '20px', '1.3in'") ; return ; }
-
- @Attributes {"barinc"} = $attrvalue ;
- }
-# if ($attribute =~ /Width/i)
-# { @Attributes {"width"} = $attrvalue ; }
-# elsif ($attribute =~ /Height/i)
-# { @Attributes {"height"} = $attrvalue ; }
- }
-
- if ((@Attributes {"width"} =~ /auto/i) || (@Attributes {"height"} =~ /auto/i))
- {
- if (@Attributes {"barinc"} eq "")
- { &Error ("ImageSize attribute 'barincrement' missing.\n" .
- "Automatic determination of image width or height implies specification of this attribute") ; return ; }
- }
-
- if ((@Attributes {"width"} !~ /auto/i) && (@Attributes {"height"} !~ /auto/i))
- {
- if (@Attributes {"barinc"} ne "")
- { &Error ("ImageSize attribute 'barincrement' not valid now.\n" .
- "This attribute is only valid (and mandatory) in combination with 'width:auto' or 'height:auto'") ; return ; }
- }
-
- %Image = %Attributes ;
-}
-
-sub ParseLegend
-{
- if (! &ValidAttributes ("Legend")) { return ; }
-
- &CheckPreset ("Legend") ;
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
- if ($attribute =~ /Columns/i)
- {
- if (($attrvalue < 1) || ($attrvalue > 4))
- { &Error ("Legend attribute 'columns' invalid. Specify 1,2,3 or 4") ; return ; }
- }
- elsif ($attribute =~ /Orientation/i)
- {
- if (! ($attrvalue =~ /^(?:hor|horizontal|ver|vertical)$/i))
- { &Error ("Legend attribute '$attrvalue' invalid. Specify hor[izontal] or ver[tical]") ; return ; }
-
- @Attributes {"orientation"} = substr ($attrvalue,0,3) ;
- }
- elsif ($attribute =~ /Position/i)
- {
- if (! ($attrvalue =~ /^(?:top|bottom|right)$/i))
- { &Error ("Legend attribute '$attrvalue' invalid.\nSpecify top, bottom or right") ; return ; }
- }
- elsif ($attribute =~ /Left/i)
- {
- if (! &ValidAbsRel ($attrvalue))
- { &Error ("Legend attribute '$attribute' invalid.\nSpecify value as x[.y][px, in, cm] examples: '200', '20px', '1.3in'") ; return ; } }
- elsif ($attribute =~ /Top/i)
- {
- if (! &ValidAbsRel ($attrvalue))
- { &Error ("Legend attribute '$attribute' invalid.\nSpecify value as x[.y][px, in, cm] examples: '200', '20px', '1.3in'") ; return ; } }
- elsif ($attribute =~ /ColumnWidth/i)
- {
- if (! &ValidAbsRel ($attrvalue))
- { &Error ("Legend attribute '$attribute' invalid.\nSpecify value as x[.y][px, in, cm] examples: '200', '20px', '1.3in'") ; return ; }
- }
- }
-
- if (defined (@Attributes {"position"}))
- {
- if (defined (@Attributes {"left"}))
- { &Error ("Legend definition invalid. Attributes 'position' and 'left' are mutually exclusive.") ; return ; }
- }
- else
- {
- if ((! defined (@Attributes {"left"})) && (! defined (@Attributes {"top"})))
- {
- &Info ("Legend definition: none of attributes 'position', 'left' or 'top' have been defined. Position 'bottom' assumed.") ;
- @Attributes {"position"} = "bottom" ;
- }
- elsif ((! defined (@Attributes {"left"})) || (! defined (@Attributes {"top"})))
- { &Error ("Legend definition invalid. Specify 'position', or 'left' & 'top'.") ; return ; }
- }
-
- if (@Attributes {"position"} =~ /right/i)
- {
- if (defined (@Attributes {"columns"}))
- { &Error ("Legend definition invalid.\nAttribute 'columns' and 'position:right' are mutually exclusive.") ; return ; }
- if (defined (@Attributes {"columnwidth"}))
- { &Error ("Legend definition invalid.\nAttribute 'columnwidth' and 'position:right' are mutually exclusive.") ; return ; }
- }
-
- if (@Attributes {"orientation"} =~ /hor/i)
- {
- if (@Attributes {"position"} =~ /right/i)
- { &Error ("Legend definition invalid.\n'position:right' and 'orientation:horizontal' are mutually exclusive.") ; return ; }
- if (defined (@Attributes {"columns"}))
- { &Error ("Legend definition invalid.\nAttribute 'columns' and 'orientation:horizontal' are mutually exclusive.") ; return ; }
- if (defined (@Attributes {"columnwidth"}))
- { &Error ("Legend definition invalid.\nAttribute 'columnwidth' and 'orientation:horizontal' are mutually exclusive.") ; return ; }
- }
-
- if ((@Attributes {"orientation"} =~ /hor/i) && (defined (@Attributes {"columns"})))
- { &Error ("Legend definition invalid.\nDo not specify attribute 'columns' with 'orientation:horizontal'.") ; return ; }
-
- if (@Attributes {"columns"} > 1)
- {
- if ((defined (@Attributes {"left"})) && (! defined (@Attributes {"columnwidth"})))
- { &Error ("Legend attribute 'columnwidth' not defined.\nThis is needed when attribute 'left' is specified.") ; return ; }
- }
-
- if (! defined (@Attributes {"orientation"}))
- { @Attributes {"orientation"} = "ver" ; }
-
- %Legend = %Attributes ;
-}
-
-sub ParsePeriod
-{
- if (! defined ($DateFormat))
- { &Error ("Period definition ambiguous. No (valid) command 'DateFormat' specified in previous lines.") ; return ; }
-
- if (! ValidAttributes ("Period")) { return ; }
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
- if ($DateFormat eq "yyyy")
- {
- if ($attrvalue !~ /^\-?\d+$/)
- { &Error ("Period definition invalid.\nInvalid year '$attrvalue' specified for attribute '$attribute'.") ; return ; }
- }
- elsif ($DateFormat eq "x.y")
- {
- if (! ($attrvalue =~ /^\-?\d+(?:\.\d+)?$/))
- { &Error ("Period definition invalid.\nInvalid year '$attrvalue' specified for attribute '$attribute'.") ; return ; }
- }
- else
- {
- if (($attrvalue =~ /^\d+$/) && ($attrvalue >= 1800) && ($attrvalue <= 2030))
- {
- if ($attribute =~ /^From$/i)
- { $attrvalue = "01/01/" . $attrvalue ; }
- if ($attribute =~ /^Till$/i)
- {
- if ($DateFormat eq "dd/mm/yyyy")
- { $attrvalue = "31/12/" . $attrvalue ; }
- else
- { $attrvalue = "12/31/" . $attrvalue ; }
- }
- }
-
- $ValidDate = &ValidDateFormat ($attrvalue) ;
- if (! $ValidDate)
- { &Error ("Period attribute '$attribute' invalid.\n" .
- "Date does not conform to specified DateFormat '$DateFormat'.") ; return ; }
- if (substr ($attrvalue,6,4) < 1800)
- { &Error ("Period attribute '$attribute' invalid. Specify year >= 1800.") ; return ; }
-
- @Attributes {$attribute} = $attrvalue ;
- }
- }
-
- %Period = %Attributes ;
-}
-
-sub ParsePlotArea
-{
- if (! &ValidAttributes ("PlotArea")) { return ; }
-
- &CheckPreset ("PlotArea") ;
-
- foreach $attribute (@Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
- if (! &ValidAbsRel ($attrvalue))
- { &Error ("PlotArea attribute '$attribute' invalid.\n" .
- "Specify value as x[.y][px, in, cm, %] examples: '200', '20px', '1.3in', '80%'") ; return ; }
- }
-
- if ((@Attributes {"top"} ne "") && (@Attributes {"height"} ne ""))
- { &Error ("PlotArea attributes 'top' and 'height' are mutually exclusive. Specify only one of them.") ; return ; }
-
- if ((@Attributes {"right"} ne "") && (@Attributes {"width"} ne ""))
- { &Error ("PlotArea attributes 'right' and 'width' are mutually exclusive. Specify only one of them.") ; return ; }
-
- if ((@Attributes {"top"} eq "") && (@Attributes {"height"} eq ""))
- { &Error ("PlotArea definition incomplete. Either attribute 'top' (advised) or 'height' should be specified") ; return ; }
-
- if ((@Attributes {"right"} eq "") && (@Attributes {"width"} eq ""))
- { &Error ("PlotArea definition incomplete. Either attribute 'right' (advised) or 'width' should be specified") ; return ; }
-
- %PlotArea = %Attributes ;
-}
-
-# command Bars found ?
-# Y | N
-# bar: found ? | bar: found ?
-# Y | N | Y | N
-# validate | previous bar: found? | @Bars contains | previous bar: found?
-# bar:.. | | bar: ? | Y | N
-# | Y | N | | copy | assume
-# | copy | $#Bars .. | Y | N | bar: | bar:---
-# | bar: |== 0 | - | assume | |
-# | | assume bar:--- | | bar:--- | |
-# | |== 1 |
-# | | assume @Bar[0] |
-# | |> 1 |
-# | | err |
-sub ParsePlotData
-{
- if (defined (@Bars))
- { $BarsCommandFound = $true ; }
- else
- { $BarsCommandFound = $false ; }
- $prevbar = "" ;
-
- if ((! (defined ($DateFormat))) || (@Period {"from"} eq "") || (@Axis {"time"} eq ""))
- {
- if (! (defined ($DateFormat)))
- { &Error ("PlotData invalid. No (valid) command 'DateFormat' specified in previous lines.") ; }
- elsif (@Period {"from"} eq "")
- { &Error ("PlotData invalid. No (valid) command 'Period' specified in previous lines.") ; }
- else
- { &Error ("PlotData invalid. No (valid) command 'TimeAxis' specified in previous lines.") ; }
-
- &GetData ;
- while ((! $InputParsed) && (! $NoData))
- { &GetData ; }
- return ;
- }
-
- &GetData ;
- if ($NoData)
- { &Error ("Data expected for command 'PlotData', but line is not indented.\n") ; return ; }
-
- my ($bar, $at, $from, $till, $color, $bgcolor, $textcolor, $fontsize, $width,
- $text, $anchor, $align, $shift, $shiftx, $shifty, $mark, $markcolor, $link, $hint) ;
-
- @PlotDefs {"anchor"} = "middle" ;
-
- PlotData:
- while ((! $InputParsed) && (! $NoData))
- {
- if (! &ValidAttributes ("PlotData"))
- { &GetData ; next ;}
-
- $bar = "" ; # $barset = "" ;
- $at = "" ; $from = "" ; $till = "" ;
- $color = "barcoldefault" ; $bgcolor = "" ; $textcolor = "black" ; $fontsize = "S" ; $width = "0.25" ;
- $text = "" ; $align = "left" ; $shift = "" ; $shiftx = "" ; $shifty = "" ; $anchor = "" ;
- $mark = "" ; $markcolor = "" ;
- $link = "" ; $hint = "" ;
-
- &CheckPreset ("PlotData") ;
-
- if (defined (@PlotDefs {"bar"})) { $bar = @PlotDefs {"bar"} ; }
- # if (defined (@PlotDefs {"barset"})) { $barset = @PlotDefs {"barset"} ; }
- if (defined (@PlotDefs {"color"})) { $color = @PlotDefs {"color"} ; }
- if (defined (@PlotDefs {"bgcolor"})) { $bgcolor = @PlotDefs {"bgcolor"} ; }
- if (defined (@PlotDefs {"textcolor"})) { $textcolor = @PlotDefs {"textcolor"} ; }
- if (defined (@PlotDefs {"fontsize"})) { $fontsize = @PlotDefs {"fontsize"} ; }
- if (defined (@PlotDefs {"width"})) { $width = @PlotDefs {"width"} ; }
- if (defined (@PlotDefs {"anchor"})) { $anchor = @PlotDefs {"anchor"} ; }
- if (defined (@PlotDefs {"align"})) { $align = @PlotDefs {"align"} ; }
- if (defined (@PlotDefs {"shiftx"})) { $shiftx = @PlotDefs {"shiftx"} ; }
- if (defined (@PlotDefs {"shifty"})) { $shifty = @PlotDefs {"shifty"} ; }
- if (defined (@PlotDefs {"mark"})) { $mark = @PlotDefs {"mark"} ; }
- if (defined (@PlotDefs {"markcolor"})) { $markcolor = @PlotDefs {"markcolor"} ; }
-# if (defined (@PlotDefs {"link"})) { $link = @PlotDefs {"link"} ; }
-# if (defined (@PlotDefs {"hint"})) { $hint = @PlotDefs {"hint"} ; }
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
- if ($attribute =~ /^Bar$/i)
- {
- if (! ($attrvalue =~ /[a-zA-Z0-9\_]+/))
- { &Error ("PlotData attribute '$attribute' invalid.\n" .
- "Use only characters 'a'-'z', 'A'-'Z', '0'-'9', '_'\n") ;
- &GetData ; next PlotData ; }
-
- $attrvalue2 = $attrvalue ;
-
- if ($BarsCommandFound)
- {
- if (! &BarDefined ($attrvalue2))
- { &Error ("PlotData invalid. Bar '$attrvalue' not (properly) defined.") ;
- &GetData ; next PlotData ; }
- }
- else
- {
- if (! &BarDefined ($attrvalue2))
- {
- if (@Axis {"time"} eq "x")
- { push @Bars, $attrvalue2 ; }
- else
- { unshift @Bars, $attrvalue2 ; }
- }
- }
- $bar = $attrvalue2 ;
- $prevbar = $bar ;
- }
- elsif ($attribute =~ /^BarSet$/i)
- {
- if (! ($attrvalue =~ /[a-zA-Z0-9\_]+/))
- { &Error ("PlotData attribute '$attribute' invalid.\n" .
- "Use only characters 'a'-'z', 'A'-'Z', '0'-'9', '_'\n") ;
- &GetData ; next PlotData ; }
-
- $attrvalue2 = $attrvalue ;
-
- if ($attrvalue =~ /break/i)
- { $barndx = 0 ; }
- elsif ($attrvalue =~ /skip/i)
- {
- $barndx ++ ;
- &BarDefined ($prevbar . "#" . $barndx) ;
- }
- else
- {
- if ($BarsCommandFound)
- {
- if (! &BarDefined ($attrvalue2 . "#1"))
- { &Error ("PlotData invalid. BarSet '$attrvalue' not (properly) defined with command BarData.") ;
- &GetData ; next PlotData ; }
- }
- $bar = $attrvalue2 ;
- if ($bar ne $prevbar)
- { $barndx = 0 ; }
- $prevbar = $bar ;
- }
- }
- elsif ($attribute =~ /^(?:At|From|Till)$/i)
- {
- if ($attrvalue =~ /^Start$/i)
- { $attrvalue = @Period {"from"} ; }
- if ($attrvalue =~ /^End$/i)
- { $attrvalue = @Period {"till"} ; }
-
- if (! &ValidDateFormat ($attrvalue))
- {
- &Error ("PlotData attribute '$attribute' invalid.\n" .
- "Date '$attrvalue' does not conform to specified DateFormat $DateFormat.") ;
- &GetData ; next PlotData ; }
-
- if (! &ValidDateRange ($attrvalue))
- { &Error ("Plotdata attribute '$attribute' invalid.\n" .
- "Date '$attrvalue' not within range as specified by command Period.") ;
-
- &GetData ; next PlotData ; }
-
- if ($attribute =~ /^At$/i)
- { $at = $attrvalue ; }
- elsif ($attribute =~ /^From$/i)
- { $from = $attrvalue ; }
- else
- { $till = $attrvalue ; }
- }
-# elsif ($attribute =~ /^From$/i)
-# {
-# if ($attrvalue =~ /^Start$/i)
-# { $attrvalue = @Period {"from"} ; }
-
-# if (! &ValidDateFormat ($attrvalue))
-# { &Error ("PlotData invalid.\nDate '$attrvalue' does not conform to specified DateFormat $DateFormat.") ;
-# &GetData ; next PlotData ; }
-
-# if (! &ValidDateRange ($attrvalue))
-# { &Error ("Plotdata attribute 'from' invalid.\n" .
-# "Date '$attrvalue' not within range as specified by command Period.") ;
-# &GetData ; next PlotData ; }
-
-# $from = $attrvalue ;
-# }
-# elsif ($attribute =~ /^Till$/i)
-# {
-# if ($attrvalue =~ /^End$/i)
-# { $attrvalue = @Period {"till"} ; }
-
-# if (! &ValidDateFormat ($attrvalue))
-# { &Error ("PlotData invalid. Date '$attrvalue' does not conform to specified DateFormat $DateFormat.") ;
-# &GetData ; next PlotData ; }
-
-# if (! &ValidDateRange ($attrvalue))
-# { &Error ("Plotdata attribute 'till' invalid.\n" .
-# "Date '$attrvalue' not within range as specified by command Period.") ;
-# &GetData ; next PlotData ; }
-
-# $till = $attrvalue ;
-# }
- elsif ($attribute =~ /^Color$/i)
- {
- if (! &ColorPredefined ($attrvalue))
- {
- if (! defined (@Colors {lc ($attrvalue)}))
- { &Error ("PlotData invalid. Attribute '$attribute' has unknown color '$attrvalue'.\n" .
- " Specify command 'Color' before this command.") ;
- &GetData ; next PlotData ; }
- }
- if (defined (@Colors {lc ($attrvalue)}))
- { $color = @Colors { lc ($attrvalue) } ; }
- else
- { $color = lc ($attrvalue) ; }
-
- $color = $attrvalue ;
- }
- elsif ($attribute =~ /^BgColor$/i)
- {
- if (! &ColorPredefined ($attrvalue))
- {
- if (! defined (@Colors {lc ($attrvalue)}))
- { &Error ("PlotData invalid. Attribute '$attribute' has unknown color '$attrvalue'.\n" .
- " Specify command 'Color' before this command.") ;
- &GetData ; next PlotData ; }
- }
- if (defined (@Colors {lc ($attrvalue)}))
- { $bgcolor = @Colors { lc ($attrvalue) } ; }
- else
- { $bgcolor = lc ($attrvalue) ; }
- }
- elsif ($attribute =~ /^TextColor$/i)
- {
- if (! &ColorPredefined ($attrvalue))
- {
- if (! defined (@Colors {lc ($attrvalue)}))
- { &Error ("PlotData invalid. Attribute '$attribute' contains unknown color '$attrvalue'.\n" .
- " Specify command 'Color' before this command.") ;
- &GetData ; next PlotData ; }
- }
- if (defined (@Colors {lc ($attrvalue)}))
- { $textcolor = @Colors { lc ($attrvalue) } ; }
- else
- { $textcolor = lc ($attrvalue) ; }
- }
- elsif ($attribute =~ /^Width$/i)
- {
- $width = &Normalize ($attrvalue) ;
- if ($width > $MaxBarWidth)
- { $MaxBarWidth = $width ; }
- }
- elsif ($attribute =~ /^FontSize$/i)
- {
- if (($attrvalue !~ /\d+(?:\.\d)?/) && ($attrvalue !~ /xs|s|m|l|xl/i))
- { &Error ("PlotData invalid. Specify for attribute '$attribute' a number of XS,S,M,L,XL.") ;
- &GetData ; next PlotData ; }
-
- $fontsize = $attrvalue ;
- if ($fontsize =~ /(?:XS|S|M|L|XL)/i)
- {
- if ($fontsize !~ /(?:xs|s|m|l|xl)/i)
- {
- if ($fontsize < 6)
- { &Warning ("TextData attribute 'fontsize' value too low. Font size 6 assumed.\n") ;
- $fontsize = 6 ; }
- if ($fontsize > 30)
- { &Warning ("TextData attribute 'fontsize' value too high. Font size 30 assumed.\n") ;
- $fontsize = 30 ; }
- }
- }
- }
- elsif ($attribute =~ /^Anchor$/i)
- {
- if (! ($attrvalue =~ /^(?:from|till|middle)$/i))
- { &Error ("PlotData value '$attribute' invalid. Specify 'from', 'till' or 'middle'.") ;
- &GetData ; next PlotData ; }
-
- $anchor = lc ($attrvalue) ;
- }
- elsif ($attribute =~ /^Align$/i)
- {
- if (! ($attrvalue =~ /^(?:left|right|center)$/i))
- { &Error ("PlotData value '$attribute' invalid. Specify 'left', 'right' or 'center'.") ;
- &GetData ; next PlotData ; }
-
- $align = lc ($attrvalue) ;
- }
- elsif ($attribute =~ /^Shift$/i)
- {
- $shift = $attrvalue ;
- $shift =~ s/$hBrO(.*?)$hBrC/$1/ ;
- $shift =~ s/\s//g ;
- ($shiftx2,$shifty2) = split (",", $shift) ;
- if ($shiftx2 ne "")
- { $shiftx = &Normalize ($shiftx2) ; }
- if ($shifty2 ne "")
- { $shifty = &Normalize ($shifty2) ; }
-
- if (($shiftx < -10) || ($shiftx > 10) || ($shifty < -10) || ($shifty > 10))
- { &Error ("PlotData invalid. Attribute '$shift', specify value(s) between -1000 and 1000 pixels = -10 and 10 inch.") ;
- &GetData ; next PlotData ; }
- }
- elsif ($attribute =~ /^Text$/i)
- {
- $text = &ParseText ($attrvalue) ;
- $text =~ s/\\n/\n/g ;
- if ($text =~ /\^/)
- { &Warning ("TextData attribute 'text' contains ^ (caret).\n" .
- "Caret symbol will not be translated into tab character (use TextData when tabs are needed)") ; }
-
-# $text=~ s/(\[\[ [^\]]* \n [^\]]* \]\])/&NormalizeWikiLink($1)/gxe ;
- $text=~ s/(\[\[? [^\]]* \n [^\]]* \]?\])/&NormalizeWikiLink($1)/gxe ;
- }
- elsif ($attribute =~ /^Link$/i)
- {
- $link = &ParseText ($attrvalue) ;
- $link = &EncodeURL (&NormalizeURL ($link)) ;
- }
-# elsif ($attribute =~ /^Hint$/i)
-# {
-# $hint = &ParseText ($attrvalue) ;
-# $hint =~ s/\\n/\n/g ;
-# }
- elsif ($attribute =~ /^Mark$/i)
- {
- $attrvalue =~ s/$hBrO (.*) $hBrC/$1/x ;
- (@suboptions) = split (",", $attrvalue) ;
- $mark = @suboptions [0] ;
- if (! ($mark =~ /^(?:Line|None)$/i))
- { &Error ("PlotData invalid. Value '$mark' for attribute 'mark' unknown.") ;
- &GetData ; next PlotData ; }
-
- if (defined (@suboptions [1]))
- {
- $markcolor = @suboptions [1] ;
-
- if (! &ColorPredefined ($markcolor))
- {
- if (! defined (@Colors {lc ($markcolor)}))
- { &Error ("PlotData invalid. Attribute 'mark': unknown color '$markcolor'.\n" .
- " Specify command 'Color' before this command.") ;
- &GetData ; next PlotData ; }
- }
- $markcolor = lc ($markcolor) ;
- }
- else
- { $markcolor = "black" ; }
- }
- else
- { &Error ("PlotData invalid. Unknown attribute '$attribute' found.") ;
- &GetData ; next PlotData ; }
- }
-
-# if ($text =~ /\[\[.*\[\[/s)
-# { &Error ("PlotData invalid. Text segment '$text' contains more than one wiki link. Only one allowed.") ;
-# &GetData ; next PlotData ; }
-
-# if (($text ne "") || ($link ne ""))
-# { ($text, $link, $hint) = &ProcessWikiLink ($text, $link, $hint) ; }
-
- $shift = $shiftx . "," . $shifty ;
-
- if ($MaxBarWidth eq "")
- { $MaxBarWidth = $width - 0.001 ; }
-
- if ($bar ne "")
- {
- if (! defined (@BarLegend {lc($bar)}))
- { @BarLegend {lc($bar)} = $bar ; }
- if (! defined (@BarWidths {$bar}))
- { @BarWidths {$bar} = $width ; } # was 0 ??
- }
-
- if (($at eq "") && ($from eq "") && ($till eq "")) # upd defaults
- {
- if ($bar ne "") { @PlotDefs {"bar"} = $bar ; }
-# if ($barset ne "") { @PlotDefs {"barset"} = $barset ; }
- if ($color ne "") { @PlotDefs {"color"} = $color ; }
- if ($bgcolor ne "") { @PlotDefs {"bgcolor"} = $bgcolor ; }
- if ($textcolor ne "") { @PlotDefs {"textcolor"} = $textcolor ; }
- if ($fontsize ne "") { @PlotDefs {"fontsize"} = $fontsize ; }
- if ($width ne "") { @PlotDefs {"width"} = $width ; }
- if ($anchor ne "") { @PlotDefs {"anchor"} = $anchor ; }
- if ($align ne "") { @PlotDefs {"align"} = $align ; }
- if ($shiftx ne "") { @PlotDefs {"shiftx"} = $shiftx ; }
- if ($shifty ne "") { @PlotDefs {"shifty"} = $shifty ; }
- if ($mark ne "") { @PlotDefs {"mark"} = $mark ; }
- if ($markcolor ne "") { @PlotDefs {"markcolor"} = $markcolor ; }
-# if ($link ne "") { @PlotDefs {"link"} = $link ; }
-# if ($hint ne "") { @PlotDefs {"hint"} = $hint ; }
- &GetData ; next PlotData ;
- }
-
- if ($bar eq "")
- {
- if ($prevbar ne "")
- { $bar = $prevbar ; }
- else
- {
-# if ($BarsCommandFound)
-# {
- if ($#Bars > 0)
- { &Error ("PlotData invalid. Specify attribute 'bar'.") ;
- &GetData ; next PlotData ; }
- elsif ($#Bars == 0)
- {
- $bar = @Bars [0] ;
- &Info ($data, "PlotData incomplete. Attribute 'bar' missing, value '" . @Bars [0] . "' assumed.") ;
- }
- else
- { $bar = "1" ; }
-# }
-# else
-# {
-# if ($#Bars > 0)
-# { &Error ("PlotData invalid. Attribute 'bar' missing.") ;
-# &GetData ; next PlotData ; }
-# elsif ($#Bars == 0)
-# {
-# $bar = @Bars [0] ;
-# &Info ($data, "PlotData incomplete. Attribute 'bar' missing, value '" . @Bars [0] . "' assumed.") ;
-# }
-# else { $bar = "1" ; }
-# }
- $prevbar = $bar ;
- }
- }
-
- if (&BarDefined ($bar . "#1")) # bar is actually a bar set
- {
- if (($from ne "") || ($at ne "") || ($text eq " ")) # data line ?
- {
- $barndx++ ;
- if (! &BarDefined ($bar . "#" . $barndx))
- { $barndx = 1 ; }
- $bar = $bar . "#" . $barndx ;
- # $text = $bar ;
- }
- }
-
- if (($at ne "") && (($from ne "") || ($till ne "")))
- { &Error ("PlotData invalid. Attributes 'at' and 'from/till' are mutually exclusive.") ;
- &GetData ; next PlotData ; }
-
- if ((($from eq "") && ($till ne "")) || (($from ne "") && ($till eq "")))
- { &Error ("PlotData invalid. Specify attribute 'at' or 'from' + 'till'.") ;
- &GetData ; next PlotData ; }
-
-
- if ($at ne "")
- {
- if ($text ne "")
- {
- if ($align eq "")
- { &Error ("PlotData invalid. Attribute 'align' missing.") ;
- &GetData ; next PlotData ; }
- if ($fontsize eq "")
- { &Error ("PlotData invalid. Attribute '[font]size' missing.") ;
- &GetData ; next PlotData ; }
- if ($text eq "")
- { &Error ("PlotData invalid. Attribute 'text' missing.") ;
- &GetData ; next PlotData ; }
- }
- }
- else
- {
- if (($text ne "") && ($anchor eq ""))
- { &Error ("PlotData invalid. Attribute 'anchor' missing.") ;
- &GetData ; next PlotData ; }
- if ($color eq "")
- { &Error ("PlotData invalid. Attribute 'color' missing.") ;
- &GetData ; next PlotData ; }
- if ($width eq "")
- { &Error ("PlotData invalid. Attribute 'width' missing.") ;
- &GetData ; next PlotData ; }
- }
-
- if ($from ne "")
- {
- if (($link ne "") && ($hint eq ""))
- { $hint = &ExternalLinkToHint ($link) ; }
-
- if (($link ne "") || ($hint ne ""))
- { $MapPNG = $true ; }
- if ($link ne "")
- { $MapSVG = $true ; }
-
- push @PlotBars, sprintf ("%6.3f,%s,%s,%s,%s,%s,%s,\n", $width, $bar, $from, $till, lc ($color),$link,$hint) ;
- if ($width > @BarWidths {$bar})
- { @BarWidths {$bar} = $width ; }
-
- if ($text ne "")
- {
- if ($anchor eq "from")
- { $at = $from ; }
- elsif ($anchor eq "till")
- { $at = $till ; }
- else
- { $at = &DateMedium ($from, $till) ; }
- }
-
- if (($mark ne "") && ($mark !~ /none/i))
- {
- push @PlotLines, sprintf ("%s,%s,%s,%s,,,\n", $bar, $from, $from, lc ($markcolor)) ;
- push @PlotLines, sprintf ("%s,%s,%s,%s,,,\n", $bar, $till, $till, lc ($markcolor)) ;
- $mark = "" ;
- }
- }
-
- if ($at ne "")
- {
- if (($mark ne "") && ($mark !~ /none/i))
- { push @PlotLines, sprintf ("%s,%s,%s,%s,,,\n", $bar, $at, $at, lc ($markcolor)) ; }
-
- if ($text ne "")
- {
- my $textdetails = "" ;
-
- if ($link ne "")
- {
- if ($text =~ /\[.*\]/)
- {
- &Warning ("PlotData contains implicit link(s) in attribute 'text' and explicit attribute 'link'. " .
- "Implicit link(s) ignored.") ;
- $text =~ s/\[+ (?:[^\|]* \|)? ([^\]]*) \]+/$1/gx ;
- }
- if ($hint eq "")
- { $hint = &ExternalLinkToHint ($link) ; }
- }
-
- if ($anchor eq "")
- { $anchor = "middle" ; }
- if ($align eq "")
- { $align = "center" ; }
- if ($color eq "")
- { $color = "black" ; }
- if ($fontsize eq "")
- { $fontsize = "S" ; }
- if ($adjust eq "")
- { $adjust = "0,0" ; }
-
-# $textdetails = " textdetails: align=$align size=$size" ;
-# if ($textcolor eq "")
-# { $textcolor = "black" ; }
-# if ($color ne "")
-# { $textdetails .= " color=$textcolor" ; }
-
-# my ($xpos, $ypos) ;
-# my $barcnt = 0 ;
-# for ($b = 0 ; $b <= $#Bars ; $b++)
-# {
-# if (lc(@Bars [$b]) eq lc($bar))
-# { $barcnt = ($b + 1) ; last ; }
-# }
-
-# if (@Axis {"time"} eq "x")
-# { $xpos = "$at(s)" ; $ypos = "[$barcnt](s)" ; }
-# else
-# { $ypos = "$at(s)" ; $xpos = "[$barcnt](s)" ; }
-
-# if ($shift ne "")
-# {
-# my ($shiftx, $shifty) = split (",", $shift) ;
-# if ($shiftx > 0)
-# { $xpos .= "+$shiftx" ; }
-# if ($shiftx < 0)
-# { $xpos .= "$shiftx" ; }
-# if ($shifty > 0)
-# { $ypos .= "+$shifty" ; }
-# if ($shifty < 0)
-# { $ypos .= "$shifty" ; }
-# }
-
- $text =~ s/\,/\#\%\$/g ;
- $link =~ s/\,/\#\%\$/g ;
- $hint =~ s/\,/\#\%\$/g ;
- $shift =~ s/\,/\#\%\$/g ;
- $textcolor =~ s/\,/\#\%\$/g ;
- push @PlotText, sprintf ("%s,%s,%s,%s,%s,%s,%s,%s,%s", $at, $bar, $text, $textcolor, $fontsize, $align, $shift, $link, $hint) ;
- }
- }
-
- &GetData ;
- }
-
- if ((! $BarsCommandFound) && ($#Bars > 1))
- { &Info2 ("PlotBars definition: no (valid) command 'BarData' found in previous lines.\nBars will presented in order of appearance in PlotData.") ; }
-
- $maxwidth = 0 ;
- foreach $key (keys %BarWidths)
- {
- if (@BarWidths {$key} == 0)
- { &Warning ("PlotData incomplete. No bar width defined for bar '$key', assume width from widest bar (used for line marks).") ; }
- elsif (@BarWidths {$key} > $maxwidth)
- { $maxwidth = @BarWidths {$key} ; }
- }
- foreach $key (keys %BarWidths)
- {
- if (@BarWidths {$key} == 0)
- { @BarWidths {$key} = $maxwidth ; }
- }
-}
-
-sub ParsePreset
-{
- if (! $firstcmd)
- { &Error ("Specify 'Preset' command before any other commands, if desired at all.\n") ; return ; }
-
- $preset = @Attributes {"single"} ;
- if ($preset !~ /^(?:TimeVertical_OneBar_UnitYear|TimeHorizontal_AutoPlaceBars_UnitYear)$/i)
- { &Error ("Preset value invalid.\n" .
- " At the moment two presets are available:\n" .
- " TimeVertical_OneBar_UnitYear and TimeHorizontal_AutoPlaceBars_UnitYear\n" .
- " See also meta.wikipedia.org/wiki/EasyTimeline/Presets") ; return ; }
-
- $Preset = $preset ;
-
- if ($Preset =~ /^TimeVertical_OneBar_UnitYear/i)
- {
- $DateFormat = "yyyy" ;
- $AlignBars = "early" ;
- @Axis {"format"} = "yyyy" ;
- @Axis {"time"} = "y" ;
- @PlotArea {"left"} = 45 ;
- @PlotArea {"right"} = 10 ;
- @PlotArea {"top"} = 10 ;
- @PlotArea {"bottom"} = 10 ;
- push @PresetList, "PlotArea|+|left|" . @PlotArea {"left"} ;
- push @PresetList, "PlotArea|+|right|" . @PlotArea {"right"};
- push @PresetList, "PlotArea|+|top|" . @PlotArea {"top"} ;
- push @PresetList, "PlotArea|+|bottom|" . @PlotArea {"bottom"} ;
- push @PresetList, "PlotArea|-|width" ;
- push @PresetList, "PlotArea|-|height" ;
- push @PresetList, "Dateformat|-||yyyy" ;
- push @PresetList, "TimeAxis|=|format|" . @Axis {"format"} ;
- push @PresetList, "TimeAxis|=|orientation|vertical" ;
- push @PresetList, "ScaleMajor|=|unit|year" ;
- push @PresetList, "ScaleMinor|=|unit|year" ;
- push @PresetList, "AlignBars|=||early" ;
- push @PresetList, "PlotData|+|mark|" . $hBrO . "line,white" . $hBrC ;
- push @PresetList, "PlotData|+|align|left" ;
- push @PresetList, "PlotData|+|fontsize|S" ;
- push @PresetList, "PlotData|+|width|20" ;
- push @PresetList, "PlotData|+|shift|" . $hBrO . "20,0" . $hBrC ;
- }
- elsif ($Preset =~ /TimeHorizontal_AutoPlaceBars_UnitYear/i)
- {
- $DateFormat = "yyyy" ;
- $AlignBars = "justify" ;
- @Axis {"format"} = "yyyy" ;
- @Axis {"time"} = "x" ;
- @PlotArea {"left"} = 25 ;
- @PlotArea {"right"} = 25 ;
- @PlotArea {"top"} = 15 ;
- @PlotArea {"bottom"} = 30 ;
- @Image {"height"} = "auto" ;
- @Image {"barinc"} = 20 ;
- @BackgroundColors {"canvas"} = "gray(0.7)" ;
- @Legend {"orientation"} = "ver" ;
- @Legend {"left"} = @PlotArea {"left"}+10 ;
- @Legend {"top"} = @PlotArea {"bottom"}+100 ;
- &StoreColor ("canvas", &EncodeInput ("gray(0.7)"), "") ;
- &StoreColor ("grid1", &EncodeInput ("gray(0.4)"), "") ;
- &StoreColor ("grid2", &EncodeInput ("gray(0.2)"), "") ;
- push @PresetList, "ImageSize|=|height|auto" ;
- push @PresetList, "ImageSize|+|barincrement|20" ;
- push @PresetList, "PlotArea|+|left|" . @PlotArea {"left"} ;
- push @PresetList, "PlotArea|+|right|" . @PlotArea {"right"};
- push @PresetList, "PlotArea|+|top|" . @PlotArea {"top"} ;
- push @PresetList, "PlotArea|+|bottom|" . @PlotArea {"bottom"} ;
- push @PresetList, "PlotArea|-|width" ;
- push @PresetList, "PlotArea|-|height" ;
- push @PresetList, "Dateformat|-||yyyy" ;
- push @PresetList, "TimeAxis|=|format|" . @Axis {"format"} ;
- push @PresetList, "TimeAxis|=|orientation|horizontal" ;
- push @PresetList, "ScaleMajor|=|unit|year" ;
- push @PresetList, "ScaleMajor|+|grid|grid1" ;
- push @PresetList, "ScaleMinor|=|unit|year" ;
- push @PresetList, "AlignBars|=||justify" ;
- push @PresetList, "Legend|+|orientation|" . @Legend {"orientation"} ;
- push @PresetList, "Legend|+|left|" . @Legend {"left"} ;
- push @PresetList, "Legend|+|top|" . @Legend {"top"} ;
- push @PresetList, "PlotData|+|align|left" ;
- push @PresetList, "PlotData|+|anchor|from" ;
- push @PresetList, "PlotData|+|fontsize|M" ;
- push @PresetList, "PlotData|+|width|15" ;
- push @PresetList, "PlotData|+|textcolor|black" ;
- push @PresetList, "PlotData|+|shift|" . $hBrO . "4,-6" . $hBrC ;
- }
-}
-
-sub ParseScale
-{
- my ($scale) ;
-
- if ($Command =~ /ScaleMajor/i)
- { $scale .= 'Major' ; }
- else
- { $scale .= 'Minor' ; }
-
- if (! ValidAttributes ("Scale" . $scale)) { return ; }
-
- &CheckPreset (Scale . $scale) ;
-
- @Scales {$scale} = $true ;
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
- if ($attribute =~ /Grid/i) # preferred gridcolor instead of grid, grid allowed for compatability
- {
- if ((! &ColorPredefined ($attrvalue)) && (! defined (@Colors {lc ($attrvalue)})))
- { &Error ("Scale attribute '$attribute' invalid. Unknown color '$attrvalue'.\n" .
- " Specify command 'Color' before this command.") ; return ; }
- @Attributes {$scale . " grid"} = $attrvalue ;
- delete (@Attributes {"grid"}) ;
- }
- elsif ($attribute =~ /Text/i)
- {
- $attrvalue =~ s/\~/\\n/g ;
- $attrvalue =~ s/^\"//g ;
- $attrvalue =~ s/\"$//g ;
- @Attributes {$scale . " stubs"} = $attrvalue ;
- }
- elsif ($attribute =~ /Unit/i)
- {
- if ($DateFormat eq "yyyy")
- {
- if (! ($attrvalue =~ /^(?:year|years)$/i))
- { &Error ("Scale attribute '$attribute' invalid. DateFormat 'yyyy' implies 'unit:year'.") ; return ; }
- }
- else
- {
- if (! ($attrvalue =~ /^(?:year|month|day)s?$/i))
- { &Error ("Scale attribute '$attribute' invalid. Specify year, month or day.") ; return ; }
- }
- $attrvalue =~ s/s$// ;
- @Attributes {$scale . " unit"} = $attrvalue ;
- delete (@Attributes {"unit"}) ;
- }
- elsif ($attribute =~ /Increment/i)
- {
- if ((! ($attrvalue =~ /^\d+$/i)) || ($attrvalue == 0))
- { &Error ("Scale attribute '$attribute' invalid. Specify positive integer.") ; return ; }
- @Attributes {$scale . " inc"} = $attrvalue ;
- delete (@Attributes {"increment"}) ;
- }
- elsif ($attribute =~ /Start/i)
- {
- if (! (defined ($DateFormat)))
- { &Error ("Scale attribute '$attribute' invalid.\n" .
- "No (valid) command 'DateFormat' specified in previous lines.") ; return ; }
-
- if (($DateFormat eq "dd/mm/yyyy") || ($DateFormat eq "mm/dd/yyyy"))
- {
- if (($attrvalue =~ /^\d+$/) && ($attrvalue >= 1800) && ($attrvalue <= 2030))
- { $attrvalue = "01/01/" . $attrvalue ; }
- }
-
- if (! &ValidDateFormat ($attrvalue))
- { &Error ("Scale attribute '$attribute' invalid.\n" .
- "Date does not conform to specified DateFormat '$DateFormat'.") ; return ; }
-
- if (($DateFormat =~ /\d\d\/\d\d\/\d\d\d\d/) && (substr ($attrvalue,6,4) < 1800))
- { &Error ("Scale attribute '$attribute' invalid.\n" .
- " Specify year >= 1800.") ; return ; }
-
- if (! &ValidDateRange ($attrvalue))
- { &Error ("Scale attribute '$attribute' invalid.\n" .
- "Date '$attrvalue' not within range as specified by command Period.") ; return ; }
-
- @Attributes {$scale . " start"} = $attrvalue ;
- delete (@Attributes {"start"}) ;
- }
- if ($DateFormat eq "yyyy") { @Attributes {$scale . " unit"} = "year" ; }
- }
-
- foreach $attribute (keys %Attributes)
- { @Scales {$attribute} = @Attributes {$attribute} ; }
-}
-
-sub ParseTextData
-{
- &GetData ;
- if ($NoData)
- { &Error ("Data expected for command 'TextData', but line is not indented.\n") ; return ; }
-
- my ($pos, $tabs, $fontsize, $lineheight, $textcolor, $text, $link, $hint) ;
-
- TextData:
- while ((! $InputParsed) && (! $NoData))
- {
- if (! &ValidAttributes ("TextData"))
- { &GetData ; next ;}
-
- &CheckPreset ("TextData") ;
-
- $pos = "" ; $tabs = "" ; $fontsize = "" ; $lineheight = "" ; $textcolor = "" ; $link = "" ; $hint = "" ;
-
- if (defined (@TextDefs {"tabs"})) { $tabs = @TextDefs {"tabs"} ; }
- if (defined (@TextDefs {"fontsize"})) { $fontsize = @TextDefs {"fontsize"} ; }
- if (defined (@TextDefs {"lineheight"})) { $lineheight = @TextDefs {"lineheight"} ; }
- if (defined (@TextDefs {"textcolor"})) { $textcolor = @TextDefs {"textcolor"} ; }
-
- my $data2 = $data ;
- ($data2, $text) = &ExtractText ($data2) ;
- @Attributes = split (" ", $data2) ;
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
- if ($attribute =~ /^FontSize$/i)
- {
- if (($attrvalue !~ /\d+(?:\.\d)?/) && ($attrvalue !~ /^(?:xs|s|m|l|xl)$/i))
- { &Error ("TextData invalid. Attribute '$attribute': specify number of XS,S,M,L,XL.") ;
- &GetData ; next TextData ; }
-
- $fontsize = $attrvalue ;
-
- if ($fontsize !~ /^(?:xs|s|m|l|xl)$/i)
- {
- if ($fontsize < 6)
- { &Warning ("TextData attribute 'fontsize' value too low. Font size 6 assumed.\n") ;
- $fontsize = 6 ; }
- if ($fontsize > 30)
- { &Warning ("TextData attribute 'fontsize' value too high. Font size 30 assumed.\n") ;
- $fontsize = 30 ; }
- }
- }
- elsif ($attribute =~ /^LineHeight$/i)
- {
- $lineheight = &Normalize ($attrvalue) ;
- if (($lineheight < -0.4) || ($lineheight > 0.4))
- {
- if (! $bypass)
- { &Error ("TextData attribute 'lineheight' invalid.\n" .
- "Specify value up to 40 pixels = 0.4 inch\n" .
- "Run with option -b (bypass checks) when this is correct.\n") ; }
- }
- }
- elsif ($attribute =~ /^Pos$/i)
- {
- $attrvalue =~ s/\s*$hBrO (.*) $hBrC\s*/$1/x ;
- ($posx,$posy) = split (",", $attrvalue) ;
- $posx = &Normalize ($posx) ;
- $posy = &Normalize ($posy) ;
- $pos = "$posx,$posy" ;
- }
- elsif ($attribute =~ /^Tabs$/i)
- {
- $tabs = $attrvalue ;
- }
- elsif ($attribute =~ /^(?:Color|TextColor)$/i)
- {
- if (! &ColorPredefined ($attrvalue))
- {
- if (! defined (@Colors {lc ($attrvalue)}))
- { &Error ("TextData invalid. Attribute '$attribute' contains unknown color '$attrvalue'.\n" .
- " Specify command 'Color' before this command.") ;
- &GetData ; next TextData ; }
- }
- if (defined (@Colors {lc ($attrvalue)}))
- { $textcolor = @Colors { lc ($attrvalue) } ; }
- else
- { $textcolor = lc ($attrvalue) ; }
- }
- elsif ($attribute =~ /^Text$/i)
- {
- $text = $attrvalue ;
- $text =~ s/\\n/~/gs ;
- if ($text =~ /\~/)
- { &Warning ("TextData attribute 'text' contains ~ (tilde).\n" .
- "Tilde will not be translated into newline character (only in PlotData)") ; }
-
- }
- elsif ($attribute =~ /^Link$/i)
- {
- $link = &ParseText ($attrvalue) ;
- $link = &EncodeURL (&NormalizeURL ($link)) ;
- }
- }
-
- if ($fontsize eq "")
- { $fontsize = "S" ; }
-
- if ($lineheight eq "")
- {
- if ($fontsize =~ /^(?:XS|S|M|L|XL)$/i)
- {
- if ($fontsize =~ /XS/i) { $lineheight = 0.11 ; }
- elsif ($fontsize =~ /S/i) { $lineheight = 0.13 ; }
- elsif ($fontsize =~ /M/i) { $lineheight = 0.155 ; }
- elsif ($fontsize =~ /XL/i) { $lineheight = 0.24 ; }
- else { $lineheight = 0.19 ; }
- }
- else
- {
- $lineheight = sprintf ("%.2f", (($fontsize * 1.2) / 100)) ;
- if ($lineheight < $fontsize/100 + 0.02)
- { $lineheight = $fontsize/100 + 0.02 ; }
- }
- }
-
- if ($textcolor eq "")
- { $textcolor = "black" ; }
-
- if ($pos eq "")
- {
- $pos = @TextDefs {"pos"} ;
- ($posx,$posy) = split (",", $pos) ;
- $posy -= $lineheight ;
- if ($posy < 0)
- { $posy = 0 ; }
- $pos = "$posx,$posy" ;
- @TextDefs {"pos"} = $pos ;
- }
-
-# if ($link ne "")
-# { ($text, $link, $hint) = &ProcessWikiLink ($text, $link, $hint) ; }
-
- if ($text eq "") # upd defaults
- {
- if ($pos ne "") { @TextDefs {"pos"} = $pos ; }
- if ($tabs ne "") { @TextDefs {"tabs"} = $tabs ; }
- if ($fontsize ne "") { @TextDefs {"fontsize"} = $fontsize ; }
- if ($textcolor ne "") { @TextDefs {"textcolor"} = $textcolor ; }
- if ($lineheight ne "") { @TextDefs {"lineheight"} = $lineheight ; }
- &GetData ; next TextData ;
- }
-
- if ($link ne "")
- {
- if ($text =~ /\[.*\]/)
- {
- &Warning ("TextData contains implicit link(s) in attribute 'text' and explicit attribute 'link'.\n" .
- "Implicit link(s) ignored.") ;
- $text =~ s/\[+ (?:[^\|]* \|)? ([^\]]*) \]+/$1/gx ;
- }
-
- if ($hint eq "")
- { $hint = &ExternalLinkToHint ($link) ; }
- }
-
- if ($text =~ /\[ [^\]]* \^ [^\]]* \]/x)
- {
- &Warning ("TextData attribute 'text' contains tab character (^) inside implicit link ([[..]]). Tab ignored.") ;
- $text =~ s/(\[+ [^\]]* \^ [^\]]* \]+)/($a = $1), ($a =~ s+\^+ +g), $a/gxe ;
- }
-
- if (defined ($tabs) && ($tabs ne ""))
- {
- $tabs =~ s/^\s*$hBrO (.*) $hBrC\s*$/$1/x ;
- @Tabs = split (",", $tabs) ;
- foreach $tab (@Tabs)
- {
- $tab =~ s/\s* (.*) \s*$/$1/x ;
- if (! ($tab =~ /\d+\-(?:center|left|right)$/))
- { &Error ("Specify attribute 'tabs' as 'n-a,n-a,n-a,.. where n = numeric value, a = left|right|center.") ;
- while ((! $InputParsed) && (! $NoData)) { &GetData ; } return ; }
- }
-
- @Text = split ('\^', $text) ;
- if ($#Text > $#Tabs + 1)
- { &Error ("TextData invalid. " . $#Text . " tab characters ('^') in text, only " . ($#Tabs+1) . " tab(s) defined.") ;
- &GetData ; next TextData ; }
- }
-
- &WriteText ("^", "", 0, $posx, $posy, $text, $textcolor, $fontsize, "left", $link, $hint, $tabs) ;
-
- &GetData ;
- }
-}
-
-sub ParseTimeAxis
-{
- if (! &ValidAttributes ("TimeAxis")) { return ; }
-
- &CheckPreset ("TimeAxis") ;
-
- foreach $attribute (keys %Attributes)
- {
- my $attrvalue = @Attributes {$attribute} ;
-
-
- if ($attribute =~ /Format/i)
- {
- if ($attrvalue =~ /^yy$/i)
- { &Error ("TimeAxis attribute '$attribute' valid but not available, waiting for bug fix.\n" .
- "Please specify 'format:yyyy' instead of 'format:yy'.") ; return ; }
-
- if ($DateFormat eq "yyyy")
- {
- if (! ($attrvalue =~ /^(?:yy|yyyy)$/i))
- { &Error ("TimeAxis attribute '$attribute' invalid.\n" .
- "DateFormat 'yyyy' implies 'format:yy' or 'format:yyyy'.") ; return ; }
- }
- }
-
- elsif ($attribute =~ /Order/i)
- {
- if ($attrvalue !~ /^(?:normal|reverse)$/i)
- { &Error ("TimeAxis attribute '$attribute' invalid.\n" .
- " Specify 'order:normal' (default) or 'order:reverse'\n" .
- " normal =\n" .
- " vertical axis: highest date on top,\n" .
- " horizontal axis: highest date at right side\n" ) ; return ; }
-
- if (($attrvalue =~ /reverse/i) && ($DateFormat ne "yyyy"))
- { &Error ("TimeAxis attribute '$attribute' invalid.\n" .
- " 'order:reverse' is only possible with DateFormat=yyyy (sorry)\n") ; return ; }
-
- @Attributes {"order"} = lc ($attrvalue) ;
- }
-
- elsif ($attribute =~ /Orientation/i)
- {
- if ($attrvalue =~ /^hor(?:izontal)?$/i)
- { @Attributes {"time"} = "x" ; }
- elsif ($attrvalue =~ /^ver(?:tical)?$/i)
- { @Attributes {"time"} = "y" ; }
- else
- { &Error ("TimeAxis attribute '$attribute' invalid.\n" .
- "Specify hor[izontal] or ver[tical]") ; return ; }
- delete (@Attributes {"orientation"}) ;
- }
- }
-
- if (! defined (@Attributes {"format"}))
- { @Attributes {"format"} = "yyyy" ; }
-
- %Axis = %Attributes ;
-}
-
-sub ParseUnknownCommand
-{
- $name = $Command ;
- $name =~ s/[^a-zA-Z].*$// ;
- &Error ("Command '$name' unknown.") ;
-}
-
-sub RemoveSpaces
-{
- my $text = shift ;
- $text =~ s/\s//g ;
- return ($text) ;
-}
-
-sub DetectMissingCommands
-{
- if (! defined (%Image)) { &Error2 ("Command ImageSize missing or invalid") ; }
- if (! defined (%PlotArea)) { &Error2 ("Command PlotArea missing or invalid") ; }
- if (! defined ($DateFormat)) { &Error2 ("Command DateFormat missing or invalid") ; }
- if (! defined (@Axis {"time"})) { &Error2 ("Command TimeAxis missing or invalid") ; }
-
- if ((@Image {"width"} =~ /auto/i) && (@Axis {"time"} =~ /x/i))
- { &Error2 ("ImageSize value 'width:auto' only allowed with TimeAxis value 'orientation:vertical'") ; }
- if ((@Image {"height"} =~ /auto/i) && (@Axis {"time"} =~ /y/i))
- { &Error2 ("ImageSize value 'height:auto' only allowed with TimeAxis value 'orientation:horizontal'") ; }
-}
-
-sub Normalize
-{
- my $number = shift ;
- my $reference = shift ;
- my ($val, $dim) ;
-
- if (($number eq "") || ($number =~ /auto/i))
- { return ($number) ; }
-
- $val = $number ; $val =~ s/[^\d\.\-].*$//g ;
- $dim = $number ; $dim =~ s/\d//g ;
- if ($dim =~ /in/i) { $number = $val ; }
- elsif ($dim =~ /cm/i) { $number = $val / 2.54 ; }
- elsif ($dim =~ /%/) { $number = $reference * $val / 100 ; }
- else { $number = $val / 100 ; }
- return (sprintf ("%.3f", $number)) ;
-}
-
-sub ValidateAndNormalizeDimensions
-{
- my ($val, $dim) ;
-
- if (@Image {"width"} =~ /auto/i)
- {
- foreach $attribute ("width","left","right")
- { if (@PlotArea {$attribute} =~ /\%/)
- { &Error2 ("You specified 'ImageSize = width:auto'.\n" .
- " This implies absolute values in PlotArea attributes 'left', 'right' and/or 'width' (no \%).\n") ; return ; }
- }
-
- if ((@PlotArea {"width"} ne "") || (@PlotArea {"left"} eq "") || (@PlotArea {"right"} eq ""))
- { &Error2 ("You specified 'ImageSize = width:auto'.\n" .
- " This implies 'PlotArea = width:auto'.\n" .
- " Instead of 'width' specify plot margins with PlotArea attributes 'left' and 'right'.\n") ; return ; }
- }
-
-
- if (@Image {"height"} =~ /auto/i)
- {
- foreach $attribute ("height","top","bottom")
- { if (@PlotArea {$attribute} =~ /\%/)
- { &Error2 ("You specified 'ImageSize = height:auto'.\n" .
- " This implies absolute values in PlotArea attributes 'top', 'bottom' and/or 'height' (no \%).\n") ; return ; }
- }
-
- if ((@PlotArea {"height"} ne "") || (@PlotArea {"top"} eq "") || (@PlotArea {"bottom"} eq ""))
- { &Error2 ("You specified 'ImageSize = height:auto'.\n" .
- " This implies 'PlotArea = height:auto'.\n" .
- " Instead of 'height' specify plot margins with PlotArea attributes 'top' and 'bottom'.\n") ; return ; }
- }
-
- @Image {"width"} = &Normalize (@Image {"width"}) ;
- @Image {"height"} = &Normalize (@Image {"height"}) ;
- @Image {"barinc"} = &Normalize (@Image {"barinc"}) ;
- @PlotArea {"width"} = &Normalize (@PlotArea {"width"}, @Image {"width"}) ;
- @PlotArea {"height"} = &Normalize (@PlotArea {"height"}, @Image {"height"}) ;
- @PlotArea {"left"} = &Normalize (@PlotArea {"left"}, @Image {"width"}) ;
- @PlotArea {"right"} = &Normalize (@PlotArea {"right"}, @Image {"width"}) ;
- @PlotArea {"bottom"} = &Normalize (@PlotArea {"bottom"}, @Image {"height"}) ;
- @PlotArea {"top"} = &Normalize (@PlotArea {"top"}, @Image {"height"}) ;
-
- if (@Image {"width"} =~ /auto/i)
- {
- @PlotArea {"width"} = $#Bars * @Image {"barinc"} ;
- @Image {"width"} = @PlotArea {"left"} + @PlotArea {"width"} + @PlotArea {"right"} ;
- }
-
- elsif (@Image {"height"} =~ /auto/i)
- {
- @PlotArea {"height"} = $#Bars * @Image {"barinc"} ;
- @Image {"height"} = @PlotArea {"top"} + @PlotArea {"height"} + @PlotArea {"bottom"} ;
- }
-
- if (@PlotArea {"right"} ne "")
- { @PlotArea {"width"} = @Image {"width"} - @PlotArea {"left"} - @PlotArea {"right"} ; }
-
- if (@PlotArea {"top"} ne "")
- { @PlotArea {"height"} = @Image {"height"} - @PlotArea {"top"} - @PlotArea {"bottom"} ; }
-
- if ((@Image {"width"} > 16) || (@Image {"height"} > 20))
- {
- if (! $bypass)
- { &Error2 ("Maximum image size is 1600x2000 pixels = 16x20 inch\n" .
- " Run with option -b (bypass checks) when this is correct.\n") ; return ; }
- }
-
- if ((@Image {"width"} < 0.25) || (@Image {"height"} < 0.25))
- {
- &Error2 ("Minimum image size is 25x25 pixels = 0.25x0.25 inch\n") ;
- return ;
- }
-
- if (@PlotArea {"width"} > @Image {"width"})
- { &Error2 ("Plot width larger than image width. Please adjust.\n") ; return ; }
-
- if (@PlotArea {"width"} < 0.2)
- { &Error2 ("Plot width less than 20 pixels = 0.2 inch. Please adjust.\n") ; return ; }
-
- if (@PlotArea {"height"} > @Image {"height"})
- { &Error2 ("Plot height larger than image height. Please adjust.\n") ; return ; }
-
- if (@PlotArea {"height"} < 0.2)
- { &Error2 ("Plot height less than 20 pixels = 0.2 inch. Please adjust.\n") ; return ; }
-
- if (@PlotArea {"left"} + @PlotArea {"width"} > @Image {"width"})
- { &Error2 ("Plot width + margins larger than image width. Please adjust.\n") ; return ; }
-# @PlotArea {"left"} = @Image {"width"} - @PlotArea {"width"} ; }
-
- if (@PlotArea {"left"} < 0)
- { @PlotArea {"left"} = 0 ; }
-
- if (@PlotArea {"bottom"} + @PlotArea {"height"} > @Image {"height"})
- { &Error2 ("Plot height + margins larger than image height. Please adjust.\n") ; return ; }
-# @PlotArea {"bottom"} = @Image {"height"} - @PlotArea {"height"} ; }
-
- if (@PlotArea {"bottom"} < 0)
- { @PlotArea {"bottom"} = 0 ; }
-
- if ((defined (@Scales {"Major"})) ||
- (defined (@Scales {"Minor"})))
- {
- if (defined (@Scales {"Major"}))
- { $margin = 0.2 ; }
- else
- { $margin = 0.05 ; }
-
- if (@Axis {"time"} eq "x")
- {
- if (@PlotArea {"bottom"} < $margin)
- { &Error2 ("Not enough space below plot area for plotting time axis\n" .
- " Specify 'PlotArea = bottom:x', where x is at least " . (100 * $margin) . " pixels = $margin inch\n") ; return ; }
- }
- else
- {
- if (@PlotArea {"left"} < $margin)
- { &Error2 ("Not enough space outside plot area for plotting time axis\n" .
- " Specify 'PlotArea = left:x', where x is at least " . (100 * $margin) . " pixels = $margin inch\n") ; return ; }
- }
- }
-
- if (defined (@Legend {"orientation"}))
- {
- if (defined (@Legend {"left"}))
- { @Legend {"left"} = &Normalize (@Legend {"left"}, @Image {"width"}) ; }
- if (defined (@Legend {"top"}))
- { @Legend {"top"} = &Normalize (@Legend {"top"}, @Image {"height"}) ; }
- if (defined (@Legend {"columnwidth"}))
- { @Legend {"columnwidth"} = &Normalize (@Legend {"columnwidth"}, @Image {"width"}) ; }
-
- if (! defined (@Legend {"columns"}))
- {
- @Legend {"columns"} = 1 ;
- if ((@Legend {"orientation"} =~ /ver/i) &&
- (@Legend {"position"} =~ /^(?:top|bottom)$/i))
- {
- if ($#LegendData > 10)
- {
- @Legend {"columns"} = 3 ;
- &Info2 ("Legend attribute 'columns' not defined. 3 columns assumed.") ;
- }
- elsif ($#LegendData > 5)
- {
- @Legend {"columns"} = 2 ;
- &Info2 ("Legend attribute 'columns' not defined. 2 columns assumed.") ;
- }
- }
- }
-
- if (@Legend {"position"} =~ /top/i)
- {
- if (! defined (@Legend {"left"}))
- { @Legend {"left"} = @PlotArea {"left"} ; }
- if (! defined (@Legend {"top"}))
- { @Legend {"top"} = (@Image {"height"} - 0.2) ; }
- if ((! defined (@Legend {"columnwidth"})) && (@Legend {"columns"} > 1))
- { @Legend {"columnwidth"} = sprintf ("%02f", ((@PlotArea {"left"} + @PlotArea {"width"} - 0.2) / @Legend {"columns"})) ; }
- }
- elsif (@Legend {"position"} =~ /bottom/i)
- {
- if (! defined (@Legend {"left"}))
- { @Legend {"left"} = @PlotArea {"left"} ; }
- if (! defined (@Legend {"top"}))
- { @Legend {"top"} = (@PlotArea {"bottom"} - 0.4) ; }
- if ((! defined (@Legend {"columnwidth"})) && (@Legend {"columns"} > 1))
- { @Legend {"columnwidth"} = sprintf ("%02f", ((@PlotArea {"left"} + @PlotArea {"width"} - 0.2) / @Legend {"columns"})) ; }
- }
- elsif (@Legend {"position"} =~ /right/i)
- {
- if (! defined (@Legend {"left"}))
- { @Legend {"left"} = (@PlotArea {"left"} + @PlotArea {"width"} + 0.2) ; }
- if (! defined (@Legend {"top"}))
- { @Legend {"top"} = (@PlotArea {"bottom"} + @PlotArea {"height"} - 0.2) ; }
- }
- }
-
- if (! defined (@Axis {"order"}))
- { @Axis {"order"} = "normal" ; }
-}
-
-sub WriteProcAnnotate
-{
- my $bar = shift ;
- my $shiftx = shift ;
- my $xpos = shift ;
- my $ypos = shift ;
- my $text = shift ;
- my $textcolor = shift ;
- my $fontsize = shift ;
- my $align = shift ;
- my $link = shift ;
- my $hint = shift ;
-
- if (length ($text) > 250)
- { &Error ("Text segments can be up to 250 characters long. This segment is " . length ($text) . " chars.\n" .
- " You can either shorten the text or\n" .
- " - PlotData: insert line breaks (~)\n" .
- " - TextData: insert tabs (~) to produce columns\n") ; return ; }
-
- if ($textcolor eq "")
- { $textcolor = "black" ; }
-
- my $textdetails = " textdetails: align=$align size=$fontsize color=$textcolor" ;
-
- push @PlotTextsPng, "#proc annotate\n" ;
- push @PlotTextsSvg, "#proc annotate\n" ;
-
- push @PlotTextsPng, " location: $xpos $ypos\n" ;
- push @PlotTextsSvg, " location: $xpos $ypos\n" ;
-
- push @PlotTextsPng, $textdetails . "\n" ;
- push @PlotTextsSvg, $textdetails . "\n" ;
-
- $text2 = $text ;
- $text2 =~ s/\[\[//g ;
- $text2 =~ s/\]\]//g ;
- if ($text2 =~ /^\s/)
- { push @PlotTextsPng, " text: \n\\$text2\n\n" ; }
- else
- { push @PlotTextsPng, " text: $text2\n\n" ; }
-
- $text2 = $text ;
- if ($link ne "")
- {
- # put placeholder in Ploticus input file
- # will be replaced by real link after SVG generation
- # this allows adding color info
- push @linksSVG, &DecodeInput ($link) ;
- my $lcnt = $#linksSVG ;
- $text2 =~ s/\[\[ ([^\]]+) \]\]/\[$lcnt\[$1\]$lcnt\]/x ;
- $text2 =~ s/\[\[ ([^\]]+) $/\[$lcnt\[$1\]$lcnt\]/x ;
- $text2 =~ s/^ ([^\[]+) \]\]/\[$lcnt\[$1\]$lcnt\]/x ;
- }
-
- $text3 = &EncodeHtml ($text2) ;
- if ($text2 ne $text3)
- {
- # put placeholder in Ploticus input file
- # will be replaced by real text after SVG generation
- # Ploticus would autoscale image improperly when text contains &#xxx; tags
- # because this would count as 5 chars
- push @textsSVG, &DecodeInput ($text3) ;
- $text3 = "{{" . $#textsSVG . "}}" ;
- while (length ($text3) < length ($text2)) { $text3 .= "x" ; }
- }
-
- if ($text3 =~ /^\s/)
- { push @PlotTextsSvg, " text: \n\\$text3\n\n" ; }
- else
- { push @PlotTextsSvg, " text: $text3\n\n" ; }
-
- if ($link ne "")
- {
- $MapPNG = $true ;
-
- push @PlotTextsPng, "#proc annotate\n" ;
- push @PlotTextsPng, " location: $xpos $ypos\n" ;
-
-# push @PlotTextsPng, " boxmargin: 0.01\n" ;
-
- if ($align ne "right")
- {
- push @PlotTextsPng, " clickmapurl: $link\n" ;
- if ($hint ne "")
- { push @PlotTextsPng, " clickmaplabel: $hint\n" ; }
- }
- else
- {
- if ($bar eq "")
- {
- if ($WarnOnRightAlignedText ++ == 0)
- { &Warning2 ("Links on right aligned texts are only supported for svg output,\npending Ploticus bug fix.") ; }
- return ;
- }
- else
- {
- push @PlotTextsPng, " clickmapurl: $link\&\&$shiftx\n" ;
- if ($hint ne "")
- { push @PlotTextsPng, " clickmaplabel: $hint\n" ; }
- }
- }
-
- $textdetails =~ s/color=[^\s]+/color=$LinkColor/ ;
- push @PlotTextsPng, $textdetails . "\n" ;
-
- $text = &DecodeInput ($text) ;
- if ($text =~ /^[^\[]+\]\]/)
- { $text = "[[" . $text ; }
- if ($text =~ /\[\[[^\]]+$/)
- { $text .= "]]" ; }
- my $pos1 = index ($text, "[[") ;
- my $pos2 = index ($text, "]]") + 1 ;
- if (($pos1 > -1) && ($pos2 > -1))
- {
- for (my $i = 0 ; $i < length ($text) ; $i++)
- {
- $c = substr ($text, $i, 1) ;
- if ($c ne "\n")
- {
- if (($i < $pos1) || ($i > $pos2))
- { substr ($text, $i, 1) = " " ; }
- }
- }
- }
-
- $text =~ s/\[\[(.*?)\]\]/$1/s ;
-
- if ($text =~ /^\s/)
- { push @PlotTextsPng, " text: \n\\$text\n\n" ; }
- else
- { push @PlotTextsPng, " text: $text\n\n" ; }
-
-# push @PlotTextsPng, "#proc rect\n" ;
-# push @PlotTextsPng, " color: green\n" ;
-# push @PlotTextsPng, " rectangle: 1(s)+0.25 1937.500(s)+0.06 1(s)+0.50 1937.500(s)+0.058\n" ;
-# push @PlotTextsPng, "\n\n" ;
- }
-}
-
-sub WriteText
-{
- my $mode = shift ;
- my $bar = shift ;
- my $shiftx = shift ;
- my $posx = shift ;
- my $posy = shift ;
- my $text = shift ;
- my $textcolor = shift ;
- my $fontsize = shift ;
- my $align = shift ;
- my $link = shift ;
- my $hint = shift ;
- my $tabs = shift ;
- my ($link2, $hint2, $tab) ;
- my $outside = $false ;
- if (@Axis {"order"} =~ /reverse/i)
- {
- if (@Axis {"time"} eq "y")
- { $posy =~ s/(.*)(\(s\))/(-$1).$2/xe ; }
- else
- { $posx =~ s/(.*)(\(s\))/(-$1).$2/xe ; }
- }
-
- if ($posx !~ /\(s\)/)
- {
- if ($posx < 0)
- { $outside = $true ; }
- if (@Image {"width"} !~ /auto/i)
- {
- if ($posx > @Image {"width"}/100)
- { $outside = $true ; }
- }
- }
- if ($posy !~ /\(s\)/)
- {
- if ($posy < 0)
- { $outside = $true ; }
- if (@Image {"height"} !~ /auto/i)
- {
- if ($posy > @Image {"height"}/100)
- { $outside = $true ; }
- }
- }
- if ($outside)
- {
- if ($WarnTextOutsideArea++ < 5)
- { $text =~ s/\n/~/g ;
- &Error ("Text segment '$text' falls outside image area. Text ignored.") ; }
- return ;
- }
-
- my @Tabs = split (",", $tabs) ;
- foreach $tab (@Tabs)
- { $tab =~ s/\s* (.*) \s*$/$1/x ; }
-
- $posx0 = $posx ;
- my @Text ;
- my $dy = 0 ;
-
- if ($text =~ /\[\[.*\]\]/)
- {
- $link = "" ; $hint = "" ;
- }
-
- my @Text ;
- if ($mode eq "^")
- { @Text = split ('\^', $text) ; }
- elsif ($mode eq "~")
- {
- @Text = split ('\n', $text) ;
-
- if ($fontsize =~ /^(?:XS|S|M|L|XL)$/i)
- {
- if ($fontsize =~ /XS/i) { $dy = 0.09 ; }
- elsif ($fontsize =~ /S/i) { $dy = 0.11 ; }
- elsif ($fontsize =~ /M/i) { $dy = 0.135 ; }
- elsif ($fontsize =~ /XL/i) { $dy = 0.21 ; }
- else { $dy = 0.16 ; }
- }
- else
- {
- $dy = sprintf ("%.2f", (($fontsize * 1.2) / 100)) ;
- if ($dy < $fontsize/100 + 0.02)
- { $dy = $fontsize/100 + 0.02 ; }
- }
- }
- else
- { push @Text, $text ; }
-
-
- foreach $text (@Text)
- {
- if ($text !~ /^[\n\s]*$/)
- {
- $link2 = "" ;
- $hint2 = "" ;
- ($text, $link2, $hint2) = &ProcessWikiLink ($text, $link2, $hint2) ;
-
- if ($link2 eq "")
- {
- $link2 = $link ;
- if (($link ne "") && ($text !~ /\[\[.*\]\]/))
- { $text = "[[" . $text . "]]" ;}
- }
- if ($hint2 eq "")
- { $hint2 = $hint ; }
-
- &WriteProcAnnotate ($bar, $shiftx, $posx, $posy, $text, $textcolor, $fontsize, $align, $link2, $hint2) ;
- }
-
- if ($#Tabs >= 0)
- {
- $tab = shift (@Tabs) ;
- ($dx,$align) = split ("\-", $tab) ;
- $posx = $posx0 + &Normalize ($dx) ;
- }
- if ($posy =~ /\+/)
- { ($posy1, $posy2) = split ('\+', $posy) ; }
- elsif ($posy =~ /.+\-/)
- {
- if ($posy =~ /^\-/)
- {
- ($sign, $posy1, $posy2) = split ('\-', $posy) ; $posy2 = -$posy2 ;
- $posy1 = "-" . $posy1 ;
- }
- else
- { ($posy1, $posy2) = split ('\-', $posy) ; $posy2 = -$posy2 ; }
- }
- else
- { $posy1 = $posy ; $posy2 = 0 ; }
-
- $posy2 -= $dy ;
-
- if ($posy2 == 0)
- { $posy = $posy1 ; }
- elsif ($posy2 < 0)
- { $posy = $posy1 . "$posy2" ; }
- else
- { $posy = $posy1 . "+" . $posy2 ; }
- }
-}
-
-sub WriteProcDrawCommandsOld
-{
- my $posx = shift ;
- my $posy = shift ;
- my $text = shift ;
- my $textcolor = shift ;
- my $fontsize = shift ;
- my $link = shift ;
- my $hint = shift ;
-
- $posx0 = $posx ;
- my @Text = split ('\^', $text) ;
- my $align = "text" ;
- foreach $text (@Text)
- {
- push @TextData, " mov $posx $posy\n" ;
- push @TextData, " textsize $fontsize\n" ;
- push @TextData, " color $textcolor\n" ;
- push @TextData, " $align $text\n" ;
-
-
- $tab = shift (@Tabs) ;
- ($dx,$align) = split ("\-", $tab) ;
- $posx = $posx0 + &Normalize ($dx) ;
- if ($align =~ /left/i) { $align = "text" ; }
- elsif ($align =~ /right/i) { $align = "rightjust" ; }
- else { $align = "centext" ; }
- }
-}
-
-sub WritePlotFile
-{
- &WriteTexts ;
-
- $script = "" ;
- my ($color) ;
- if (@Axis {"time"} eq "x")
- { $AxisBars = "y" ; }
- else
- { $AxisBars = "x" ; }
-
-# if ((@Axis {"time"} eq "y") && ($#Bars > 0))
-# {
-# undef @BarsTmp ;
-# while ($#Bars >= 0)
-# { push @BarsTmp, pop @Bars ; }
-# @Bars = @BarsTmp ;
-# }
-
- if ($tmpdir ne "")
- { $file_script = $tmpdir.$pathseparator."EasyTimeline.txt.$$" ; }
- else
- { $file_script = "EasyTimeline.txt" ; }
-
- print "Ploticus input file = ".$file_script."\n";
-
- # $fmt = "gif" ;
- open "FILE_OUT", ">", $file_script ;
-
- #proc settings
-# $script .= "#proc settings\n" ;
-# $script .= " xml_encoding: utf-8\n" ;
-# $script .= "\n" ;
-
- # proc page
- $script .= "#proc page\n" ;
- $script .= " dopagebox: no\n" ;
- $script .= " pagesize: ". @Image {"width"} . " ". @Image {"height"} . "\n" ;
- if (defined (@BackgroundColors {"canvas"}))
- { $script .= " backgroundcolor: " . @BackgroundColors {"canvas"} . "\n" ; }
- $script .= "\n" ;
-
- $barcnt = $#Bars + 1 ;
-
-# if ($AlignBars eq "justify") && ($#Bars > 0)
-#
-# given P = plotwidth in pixels
-# given B = half bar width in pixels
-# get U = plotwidth in units
-# get x = half bar width in units
-#
-# first bar plotted at unit 1
-# last bar plotted at unit c
-# let C = c - 1 (units between centers of lowest and highest bar) -> x = (U-C) / 2
-#
-# Justify: calculate range for axis in units:
-# axis starts at 1-x and ends at c+x =
-# x/B = U/P -> x = BU/P (1)
-# U = c+x - (1-x) = (c-1) + 2x -> x = (U-(c-1))/2 (2)
-#
-# (1) & (2) -> BU/P = (U-(c-1))/2
-# -> 2BU/P = U-(c-1)
-# -> 2BU/P = U - C
-# -> 2BU = PU - PC
-# -> U (2B-P) = -PC
-# -> U = -PC/(2B-P)
-# P = @PlotArea {$extent}
-# C = c - 1 = $#Bars
-# 2B = $MaxBarWidth
- if (! defined ($AlignBars))
- {
- &Info2 ("AlignBars not defined. Alignment 'early' assumed.") ;
- $AlignBars = "early" ;
- }
-
- if (@Axis {"time"} eq "x")
- { $extent = "height" ; }
- else
- { $extent = "width" ; }
-
- if ($MaxBarWidth > @PlotArea {$extent})
- { &Error2 ("Maximum bar width exceeds plotarea " . $extent . ".") ; return ; }
-
- if ($MaxBarWidth == @PlotArea {$extent})
- { @PlotArea {$extent} += 0.01 ; }
-
- if ($MaxBarWidth == @PlotArea {$extent})
- {
- $till = 1 ;
- $from = 1 ;
- }
- else
- {
- if ($AlignBars eq "justify")
- {
- if ($#Bars > 0)
- {
- $U = - (@PlotArea {$extent} * $#Bars) / ($MaxBarWidth - @PlotArea {$extent}) ;
- $x = ($U - $#Bars) / 2 ;
- $from = 1 - $x ;
- $till = 1 + $#Bars + $x ;
- }
- else # one bar-> "justify" is misnomer here, treat as "center"
- {
- # $x = ($MaxBarWidth /2) / @PlotArea {$extent} ;
- # $from = 0.5 - $x ;
- # $till = $from + 1 ;
- $from = 0.5 ;
- $till = 1.5 ;
- }
- }
- elsif ($AlignBars eq "early")
- {
- $U = $#Bars + 1 ;
- if ($U == 0)
- { $U = 1 ; }
- $x = (($MaxBarWidth /2) * $U) / @PlotArea {$extent} ;
- $from = 1 - $x ;
- $till = $from + $U ;
- }
- elsif ($AlignBars eq "late")
- {
- $U = $#Bars + 1 ;
- $x = (($MaxBarWidth /2) * $U) / @PlotArea {$extent} ;
- $till = $U + $x ;
- $from = $till - $U ;
- }
- }
-
-# if ($#Bars == 0)
-# {
-# $from = 1 - $MaxBarWidth ;
-# $till = 1 + $MaxBarWidth ;
-# }
- if ($from eq $till)
- { $till = $from + 1 ; }
-
- #proc areadef
- $script .= "#proc areadef\n" ;
- $script .= " rectangle: " . @PlotArea {"left"} . " " . @PlotArea {"bottom"} . " " .
- sprintf ("%.2f", @PlotArea {"left"} + @PlotArea {"width"}). " " . sprintf ("%.2f", @PlotArea {"bottom"} + @PlotArea {"height"}) . "\n" ;
- if (($DateFormat eq "yyyy") || ($DateFormat eq "x.y"))
- { $script .= " " . @Axis {"time"} . "scaletype: linear\n" ; } # date yyyy
- else
- { $script .= " " . @Axis {"time"} . "scaletype: date $DateFormat\n" ; }
-
- if (@Axis {"order"} !~ /reverse/i)
- { $script .= " " . @Axis {"time"} . "range: " . @Period{"from"} . " " . @Period{"till"} . "\n" ; }
- else
- { $script .= " " . @Axis {"time"} . "range: " . (-@Period{"till"}) . " " . (-@Period{"from"}) . "\n" ; }
-
- $script .= " " . $AxisBars . "scaletype: linear\n" ;
- $script .= " " . $AxisBars . "range: " . sprintf ("%.3f", $from-0.001) . " " . sprintf ("%.3f", $till) . "\n" ;
- $script .= " #saveas: A\n" ;
- $script .= "\n" ;
-
- #proc rect (test)
-# $script .= "#proc rect\n" ;
-# $script .= " rectangle 1.0 1.0 1.4 1.4\n" ;
-# $script .= " color gray(0.95)\n" ;
-# $script .= " clickmaplabel: Vladimir Ilyich Lenin\n" ;
-# $script .= " clickmapurl: http://www.wikipedia.org/wiki/Vladimir_Lenin\n" ;
-
-
- #proc legendentry
- foreach $color (sort keys %Colors)
- {
- $script .= "#proc legendentry\n" ;
- $script .= " sampletype: color\n" ;
-
- if ((defined (@ColorLabels {$color})) && (@ColorLabels {$color} ne ""))
- { $script .= " label: " . @ColorLabels {$color} . "\n" ; }
- $script .= " details: " . @Colors {$color} . "\n" ;
- $script .= " tag: $color\n" ;
- $script .= "\n" ;
- }
-
- if (defined (@BackgroundColors {"bars"}))
- {
- #proc getdata / #proc bars
- $script .= "#proc getdata\n" ;
- $script .= " delim: comma\n" ;
- $script .= " data:\n" ;
-
- $maxwidth = 0 ;
- foreach $entry (@PlotBars)
- {
- ($width) = split (",", $entry) ;
- if ($width > $maxwidth)
- { $maxwidth = $width ; }
- }
-
- for ($b = 0 ; $b <= $#Bars ; $b++)
- { $script .= ($b+1) . "," . @Period {"from"} . "," . @Period {"till"} . ",".
- @BackgroundColors {"bars"} . "\n" ; }
- $script .= "\n" ;
-
- #proc bars
- $script .= "#proc bars\n" ;
- $script .= " axis: " . @Axis {"time"} . "\n" ;
- $script .= " barwidth: $maxwidth\n" ;
- $script .= " outline: no\n" ;
- if (@Axis {"time"} eq "x")
- { $script .= " horizontalbars: yes\n" ; }
- $script .= " locfield: 1\n" ;
- $script .= " segmentfields: 2 3\n" ;
- $script .= " colorfield: 4\n" ;
-
-# $script .= " clickmaplabel: Vladimir Ilyich Lenin\n" ;
-# $script .= " clickmapurl: http://www.wikipedia.org/wiki/Vladimir_Lenin\n" ;
-
- $script .= "\n" ;
- }
-
- #proc axis
- if (defined (@Scales {"Minor grid"}))
- { &PlotScale ("Minor", $true) ; }
- if (defined (@Scales {"Major grid"}))
- { &PlotScale ("Major", $true) ; }
-
- &PlotLines ("back") ;
-
- @PlotBarsNow = @PlotBars ;
- &PlotBars ;
-
- $script .= "\n([inc3])\n\n" ; # will be replace by rects
-
-%x = %BarWidths ;
- foreach $entry (@PlotLines)
- {
- ($bar) = split (",", $entry) ;
- $bar =~ s/\#.*// ;
- $width = @BarWidths {$bar} ;
- $entry = sprintf ("%6.3f",$width) . "," . $entry ;
- }
-
- @PlotBarsNow = @PlotLines ;
- &PlotBars ;
-
- #proc axis
- if ($#Bars > 0)
- {
- $scriptPng2 = "#proc " . $AxisBars . "axis\n" ;
- $scriptSvg2 = "#proc " . $AxisBars . "axis\n" ;
- if ($AxisBars eq "x")
- {
- $scriptPng2 .= " stubdetails: adjust=0,0.09\n" ;
- $scriptSvg2 .= " stubdetails: adjust=0,0.09\n" ;
- }
- else
- {
- $scriptPng2 .= " stubdetails: adjust=0.09,0\n" ;
- $scriptSvg2 .= " stubdetails: adjust=0.09,0\n" ;
- }
- $scriptPng2 .= " tics: none\n" ;
- $scriptSvg2 .= " tics: none\n" ;
- $scriptPng2 .= " stubrange: 1\n" ;
- $scriptSvg2 .= " stubrange: 1\n" ;
- if ($AxisBars eq "y")
- {
- $scriptPng2 .= " stubslide: -" . sprintf ("%.2f", $MaxBarWidth / 2) . "\n" ;
- $scriptSvg2 .= " stubslide: -" . sprintf ("%.2f", $MaxBarWidth / 2) . "\n" ;
- }
- $scriptPng2 .= " stubs: text\n" ;
- $scriptSvg2 .= " stubs: text\n" ;
-
- my ($text, $link, $hint) ;
-
- undef (@Bars2) ;
- foreach $bar (@Bars)
- {
- if ($AxisBars eq "y")
- { push @Bars2, $bar ; }
- else
- { unshift @Bars2, $bar ; }
- }
-
- foreach $bar (@Bars2)
- {
- $hint = "" ;
- $text = @BarLegend {lc ($bar)} ;
- if ($text =~ /^\s*$/)
- { $text = "\\" ; }
-
- $link = @BarLink {lc ($bar)} ;
- if (! defined ($link))
- {
- if ($text =~ /\[.*\]/)
- { ($text, $link, $hint) = &ProcessWikiLink ($text, $link, $hint) ; }
- }
-
- $text =~ s/\[+([^\]]*)\]+/$1/ ;
- $scriptPng2 .= "$text\n" ;
- if (defined ($link))
- {
- push @linksSVG, $link ;
- my $lcnt = $#linksSVG ;
- $scriptSvg2 .= "[" . $lcnt . "[" . $text . "]" . $lcnt . "]\n" ;
- }
- else
- { $scriptSvg2 .= "$text\n" ; }
- }
- $scriptPng2 .= "\n" ;
- $scriptSvg2 .= "\n" ;
-
- $scriptPng2 .= "#proc " . $AxisBars . "axis\n" ;
- if ($AxisBars eq "x")
- { $scriptPng2 .= " stubdetails: adjust=0,0.09 color=$LinkColor\n" ; }
- else
- { $scriptPng2 .= " stubdetails: adjust=0.09,0 color=$LinkColor\n" ; }
- $scriptPng2 .= " tics: none\n" ;
- $scriptPng2 .= " stubrange: 1\n" ;
- if ($AxisBars eq "y")
- { $scriptPng2 .= " stubslide: -" . sprintf ("%.2f", $MaxBarWidth / 2) . "\n" ; }
- $scriptPng2 .= " stubs: text\n" ;
-
- $barcnt = $#Bars + 1 ;
- foreach $bar (@Bars2)
- {
- $hint = "" ;
- $text = @BarLegend {lc ($bar)} ;
- if ($text =~ /^\s*$/)
- { $text = "\\" ; }
-
- $link = @BarLink {lc ($bar)} ;
- if (! defined ($link))
- {
- if ($text =~ /\[.*\]/)
- { ($text, $link, $hint) = &ProcessWikiLink ($text, $link, $hint) ; }
- }
- if ((! defined ($link)) || ($link eq ""))
- { $text = "\\" ; }
- else
- {
- $scriptPng3 .= "#proc rect\n" ;
- $scriptPng3 .= " rectangle: 0 $barcnt(s)+0.05 " . @PlotArea {"left"} . " $barcnt(s)-0.05\n" ;
- $scriptPng3 .= " color: " . @BackgroundColors {"canvas"} . "\n" ;
- $scriptPng3 .= " clickmapurl: " . $link . "\n" ;
- if ((defined ($hint)) && ($hint ne ""))
- { $scriptPng3 .= " clickmaplabel: " . $hint . "\n" ; }
-
- $text =~ s/\[+([^\]]*)\]+/$1/ ;
- }
- $scriptPng2 .= "$text\n" ;
-
- $barcnt-- ;
- }
- $scriptPng2 .= "\n" ;
- }
-
- &PlotLines ("front") ;
-
- $script .= "\n([inc1])\n\n" ; # will be replaced by annotations
- $script .= "\n([inc2])\n\n" ;
-
-
- if ($#PlotTextsPng >= 0)
- {
- foreach $command (@PlotTextsPng)
- {
- if ($command =~ /^\s*location/)
- { $command =~ s/(.*)\[(.*)\](.*)/$1 . ($#Bars - $2 + 2) . $3/xe ; }
-
- $scriptPng1 .= $command ;
- }
- $scriptPng1 .= "\n" ;
- }
-
- if ($#PlotTextsSvg >= 0)
- {
- foreach $command (@PlotTextsSvg)
- {
- if ($command =~ /^\s*location/)
- { $command =~ s/(.*)\[(.*)\](.*)/$1 . ($#Bars - $2 + 2) . $3/xe ; }
-
- $scriptSvg1 .= $command ;
- }
- $scriptSvg1 .= "\n" ;
- }
-
-# $script .= "#proc symbol\n" ;
-# $script .= " location: 01/01/1943(s) Korea \n" ;
-# $script .= " symbol: style=fill shape=downtriangle fillcolor=white radius=0.04\n" ;
-# $script .= "\n" ;
-
- #proc axis
- # repeat without grid to get axis on top of bar
- # needed because axis may overlap bar slightly
- if (defined (@Scales {"Minor"}))
- { &PlotScale ("Minor", $false) ; }
- if (defined (@Scales {"Major"}))
- { &PlotScale ("Major", $false) ; }
-
- #proc drawcommands
- if ($#TextData >= 0)
- {
- $script .= "#proc drawcommands\n" ;
- $script .= " commands:\n" ;
- foreach $entry (@TextData)
- { $script .= $entry ; }
- $script .= "\n" ;
- }
-
- #proc legend
- if (defined (@Legend {"orientation"}))
- {
- if (($#LegendData < 0) && ($Preset eq ""))
- { &Error2 ("Command 'Legend' found, but no entries for the legend were specified.\n" .
- " Please remove or disable command (disable = put \# before the command)\n" .
- " or specify entries for the legend with command 'Colors', attribute 'legend'\n") ;
- return ; }
-
- $perColumn = 999 ;
- if (@Legend {"orientation"} =~ /ver/i)
- {
- if (@Legend {"columns"} > 1)
- {
- $perColumn = 0 ;
- while ((@Legend {"columns"} * $perColumn) < $#LegendData + 1)
- { $perColumn ++ ; }
- }
- }
-
- for ($l = 1 ; $l <= @Legend {"columns"} ; $l++)
- {
- $script .= "#proc legend\n" ;
- $script .= " noclear: yes\n" ;
- if (@Legend {"orientation"} =~ /ver/i)
- { $script .= " format: multiline\n" ; }
- else
- { $script .= " format: singleline\n" ; }
- $script .= " seglen: 0.2\n" ;
- $script .= " swatchsize: 0.12\n" ;
- $script .= " textdetails: size=S\n" ;
- $script .= " location: " . (@Legend{"left"}+0.2) . " " . @Legend{"top"} . "\n" ;
- $script .= " specifyorder:\n" ;
- for ($l2 = 1 ; $l2 <= $perColumn ; $l2++)
- {
- $category = shift (@LegendData) ;
- if (defined ($category))
- { $script .= "$category\n" ; }
- }
- $script .= "\n" ;
- @Legend {"left"} += @Legend {"columnwidth"} ;
- }
- }
-
- $script .= "#endproc\n" ;
-
- print "\nGenerating output:\n" ;
- if ( $plcommand ne "" )
- { $pl = $plcommand; }
- else
- {
- $pl = "pl.exe" ;
- if ($env eq "Linux")
- { $pl = "pl" ; }
- }
-
- print "Using ploticus command \"".$pl."\" (".$plcommand.")\n";
-
- $script_save = $script ;
-
- $script =~ s/\(\[inc1\]\)/$scriptSvg1/ ;
- $script =~ s/\(\[inc2\]\)/$scriptSvg2/ ;
- $script =~ s/\(\[inc3\]\)// ;
-
- $script =~ s/textsize XS/textsize 7/gi ;
- $script =~ s/textsize S/textsize 8.9/gi ;
-
- $script =~ s/textsize M/textsize 10.5/gi ;
- $script =~ s/textsize L/textsize 13/gi ;
- $script =~ s/textsize XL/textsize 17/gi ;
- $script =~ s/size=XS/size=7/gi ;
- $script =~ s/size=S/size=8.9/gi ;
- $script =~ s/size=M/size=10.5/gi ;
- $script =~ s/size=L/size=13/gi ;
- $script =~ s/size=XL/size=17/gi ;
-
-
- $script =~ s/(\n location:.*)/&ShiftOnePixelForSVG($1)/ge ;
-
- open "FILE_OUT", ">", $file_script ;
- print FILE_OUT &DecodeInput($script) ;
- close "FILE_OUT" ;
-
- $map = ($MapSVG) ? "-map" : "";
-
- print "Running Ploticus to generate svg file\n" ;
-# my $cmd = "$pl $map -" . "svg" . " -o $file_vector $file_script -tightcrop -font \"Times\"" ;
-# my $cmd = "$pl $map -" . "svg" . " -o $file_vector $file_script -tightcrop" ;
- my $cmd = EscapeShellArg($pl) . " $map -" . "svg" . " -o " .
- EscapeShellArg($file_vector) . " " . EscapeShellArg($file_script) . " -tightcrop" ;
- print "$cmd\n";
- system ($cmd) ;
-
- $script = $script_save ;
- $script =~ s/dopagebox: no/dopagebox: yes/ ;
-
- $script =~ s/\(\[inc1\]\)/$scriptPng1/ ;
- $script =~ s/\(\[inc2\]\)/$scriptPng2/ ;
- $script =~ s/\(\[inc3\]\)/$scriptPng3/ ;
-
- $script =~ s/textsize XS/textsize 6/gi ;
- $script =~ s/textsize S/textsize 8/gi ;
- $script =~ s/textsize M/textsize 10/gi ;
- $script =~ s/textsize L/textsize 14/gi ;
- $script =~ s/textsize XL/textsize 18/gi ;
- $script =~ s/size=XS/size=6/gi ;
- $script =~ s/size=S/size=8/gi ;
- $script =~ s/size=M/size=10/gi ;
- $script =~ s/size=L/size=14/gi ;
- $script =~ s/size=XL/size=18/gi ;
-
- open "FILE_OUT", ">", $file_script ;
- print FILE_OUT &DecodeInput($script) ;
- close "FILE_OUT" ;
-
- $map = ($MapPNG && $linkmap) ? "-csmap" : "";
- if ($linkmap && $showmap)
- { $map .= " -csmapdemo" ; }
-
-# $crop = "-crop 0,0," + @ImageSize {"width"} . "," . @ImageSize {"height"} ;
- print "Running Ploticus to generate bitmap\n" ;
-# $cmd = "$pl $map -" . $fmt . " -o $file_bitmap $file_script -tightcrop" ; # -v $file_bitmap" ;
-# $cmd = "$pl $map -" . $fmt . " -o $file_bitmap $file_script -tightcrop -diagfile $file_pl_info -errfile $file_pl_err" ;
- $cmd = EscapeShellArg($pl) . " $map -" . $fmt . " -o " .
- EscapeShellArg($file_bitmap) . " " . EscapeShellArg($file_script) . " -tightcrop" .
- " -mapfile " . EscapeShellArg($file_htmlmap) ;
- print "$cmd\n";
- system ($cmd) ;
-
- if ((-e $file_bitmap) && (-s $file_bitmap > 500 * 1024))
- {
- &Error2 ("Output image size exceeds 500 K. Image deleted.\n" .
- "Run with option -b (bypass checks) when this is correct.\n") ;
- unlink $file_bitmap ;
- } ;
-
- # not for Wikipedia, only for offline use:
- if ((-e $file_bitmap) && ($fmt eq "gif"))
- {
- print "Running nconvert to convert gif image to png format\n\n" ;
- print "---------------------------------------------------------------------------\n" ;
- $cmd = "nconvert.exe -out png " . EscapeShellArg($file_bitmap) ;
- system ($cmd) ;
- print "---------------------------------------------------------------------------\n" ;
-
- if (! (-e $file_png))
- { print "PNG file not created (is nconvert.exe missing?)\n\n" ; }
- }
-
- if (-e $file_htmlmap) # correct click coordinates of right aligned texts (Ploticus bug)
- {
- open "FILE_IN", "<", $file_htmlmap ;
- @map = <FILE_IN> ;
- close "FILE_IN" ;
-
- foreach $line (@map)
- {
- chomp $line ;
- if ($line =~ /\&\&/)
- {
- $coords = $line ;
- $shift = $line ;
- $coords =~ s/^.*coords\=\"([^\"]*)\".*$/$1/ ;
- $shift =~ s/^.*\&\&([^\"]*)\".*$/$1/ ;
- $line =~ s/\&\&[^\"]*// ;
- (@updcoords) = split (",", $coords) ;
- $maplength = @updcoords [2] - @updcoords [0] ;
- @updcoords [0] = @updcoords [0] - 2 * ($maplength-25) ;
- @updcoords [2] = @updcoords [0] + $maplength ;
- $coordsnew = join (",", @updcoords) ;
- $line =~ s/$coords/$coordsnew/ ;
- push @map2, $line . "\n" ;
- }
- else
- { push @map2, $line . "\n" ; }
- }
-
- open "FILE_OUT", ">", $file_htmlmap ;
- print FILE_OUT @map2 ;
- close "FILE_OUT" ;
- }
-
- if (-e $file_vector)
- {
- open "FILE_IN", "<", $file_vector ;
- @svg = <FILE_IN> ;
- close "FILE_IN" ;
-
- foreach $line (@svg)
- {
- $line =~ s/\{\{(\d+)\}\}x+/@textsSVG[$1]/gxe ;
- $line =~ s/\[(\d+)\[ (.*?) \]\d+\]/'<a style="fill:blue;" xlink:href="' . @linksSVG[$1] . '">' . $2 . '<\/a>'/gxe ;
- }
-
- open "FILE_OUT", ">", $file_vector ;
- print FILE_OUT @svg ;
- close "FILE_OUT" ;
- }
-
- # not for Wikipedia, for offline use:
- if ($makehtml)
- {
- $map = "" ;
- if ($linkmap)
- {
- open "FILE_IN", "<", $file_htmlmap ;
- while ($line = <FILE_IN>)
- { $map .= $line ; }
- close "FILE_IN" ;
- }
- print "Generating html test file\n" ;
- $width = sprintf ("%.0f", @Image {"width"} * 100) ;
- $height = sprintf ("%.0f", @Image {"height"} * 100) ;
- $html = <<__HTML__ ;
-
-<html>
-<head>
-<title>%FILENAME% - EasyTimeline test file</title>\n
-</head>
-
-<body>
-<h1><font color="green">EasyTimeline</font> - Test Page</h1>
-
-<b>Fixed size version (PNG): file $file_png</b><p>
-<map name="map1">
-$map</map>
-
-<!--
-If you want a border simplest way is set <img .. border='1'>
-Here tables are used to draw similar borders around both images (border='1' seems not to work for embed tag)
--->
-
-<table border='1' cellpadding='0' cellspacing='0'><tr><td>
-<img src=$file_png usemap='#map1' border='0'>
-</td></tr></table>
-
-<hr>
-<b>Scalable version (SVG): file $file_vector</b><p>
-<table border='1' cellpadding='0' cellspacing='0'><tr><td>
-<noembed>Your browser does not support embedded objects</noembed>
-<embed src='$file_vector' name='SVGEmbed' border='1'
-width='$width' height='$height' type='image/svg-xml' pluginspage='http://www.adobe.com/svg/viewer/install/'>
-</td></tr></table>
-
-<p>As you can see the scalable version renders fonts smoother better than the bitmap version.
-<br>Any SVG picture can also be rescaled or zoomed into, without annoying artefacts.
-
-<p>Windows users:<br>
-<small>&nbsp;&nbsp;Right mouse click on picture for zoom options or</small>
-<p><small>&nbsp;&nbsp;Ctrl+click for zoom in</small>
-<br><small>&nbsp;&nbsp;Ctrl+Shift+click for zoom out</small>
-<br><small>&nbsp;&nbsp;Alt+drag with mouse to move focus</small>
-
-</body>
-</html>
-
-__HTML__
-
- $html =~ s/\%FILENAME\%/$file_name/ ;
-
- open "FILE_OUT", ">", $file_html ;
- print FILE_OUT $html ;
- close "FILE_OUT" ;
- }
-# my $cmd = "\"c:\\\\Program Files\\\\XnView\\\\xnview.exe\"" ;
-# system ("\"c:\\\\Program Files\\\\XnView\\\\xnview.exe\"", "d:\\\\Wikipedia\\Perl\\\\Wo2\\\\Test.png") ;
-}
-
-sub WriteTexts
-{
- my ($line, $xpos, $ypos) ;
- foreach $line (@PlotText)
- {
- my ($at, $bar, $text, $textcolor, $fontsize, $align, $shift, $link, $hint) = split (",", $line) ;
- $text =~ s/\#\%\$/\,/g ;
- $link =~ s/\#\%\$/\,/g ;
- $hint =~ s/\#\%\$/\,/g ;
- $shift =~ s/\#\%\$/\,/g ;
- $textcolor =~ s/\#\%\$/\,/g ;
-
- my $barcnt = 0 ;
- for ($b = 0 ; $b <= $#Bars ; $b++)
- {
- if (lc(@Bars [$b]) eq lc($bar))
- { $barcnt = ($b + 1) ; last ; }
- }
-
- if (@Axis {"time"} eq "x")
- { $xpos = "$at(s)" ; $ypos = "[$barcnt](s)" ; }
- else
- { $ypos = "$at(s)" ; $xpos = "[$barcnt](s)" ; }
-
- if ($shift ne "")
- {
- my ($shiftx, $shifty) = split (",", $shift) ;
- if ($shiftx > 0)
- { $xpos .= "+$shiftx" ; }
- if ($shiftx < 0)
- { $xpos .= "$shiftx" ; }
- if ($shifty > 0)
- { $ypos .= "+$shifty" ; }
- if ($shifty < 0)
- { $ypos .= "$shifty" ; }
- }
-
- &WriteText ("~", $bar, $shiftx, $xpos, $ypos, $text, $textcolor, $fontsize, $align, $link, $hint) ;
- }
-}
-
-sub PlotBars
-{
- #proc getdata / #proc bars
- while ($#PlotBarsNow >= 0)
- {
- undef @PlotBarsLater ;
-
- $maxwidth = 0 ;
- foreach $entry (@PlotBarsNow)
- {
- ($width) = split (",", $entry) ;
- if ($width > $maxwidth)
- { $maxwidth = $width ; }
- }
-
- $script .= "#proc getdata\n" ;
- $script .= " delim: comma\n" ;
- $script .= " data:\n" ;
-
- foreach $entry (@PlotBarsNow)
- {
- my ($width, $bar, $from, $till, $color, $link, $hint) = split (",", $entry) ;
- if ($width < $maxwidth)
- {
- push @PlotBarsLater, $entry ;
- next ;
- }
- for ($b = 0 ; $b <= $#Bars ; $b++)
- {
- if (lc(@Bars [$b]) eq lc($bar))
- { $bar = ($#Bars - ($b - 1)) ; last ; }
- }
- if (@Axis {"order"} !~ /reverse/i)
- { $entry = "$bar,$from,$till,$color,$link,$hint,\n" ; }
- else
- { $entry = "$bar," . (-$till) . "," . (-$from) . ",$color,$link,$hint,\n" ; }
-
- $script .= "$entry" ;
- }
- $script .= "\n" ;
-
- #proc bars
- $script .= "#proc bars\n" ;
- $script .= " axis: " . @Axis {"time"} . "\n" ;
- $script .= " barwidth: $maxwidth\n" ;
- $script .= " outline: no\n" ;
-# $script .= " thinbarline: width=5\n" ;
- if (@Axis {"time"} eq "x")
- { $script .= " horizontalbars: yes\n" ; }
- $script .= " locfield: 1\n" ;
- $script .= " segmentfields: 2 3\n" ;
- $script .= " colorfield: 4\n" ;
-# $script .= " outline: width=1\n" ;
-# $script .= " barwidthfield: 5\n" ;
-# if (@fields [4] ne "")
-# { $script .= " clickmapurl: " . &LinkToUrl ($text) . "\n" ; }
-# if (@fields [5] ne "")
-# { $script .= " clickmaplabel: $text\n" ; }
- $script .= " clickmapurl: \@\@5\n" ;
- $script .= " clickmaplabel: \@\@6\n" ;
- $script .= "\n" ;
-
- @PlotBarsNow = @PlotBarsLater ;
- }
-}
-
-sub PlotScale
-{
- my $scale = shift ;
- my $grid = shift ;
- my ($color, $from, $till, $start) ;
-
- %x = %Period ;
-# if (($DateFormat =~ /\//) && ($grid))
-# { return ; }
-
-# if (($DateFormat =~ /\//)
-# {
-# }
-
-# if (! $grid) # redefine area, scale linear for time axis, showl whole years always, Ploticus bug
-# {
- # $from = @Period {"from"} ;
- # $till = @Period {"till"} ;
- $from = &DateToFloat (@Period {"from"}) ;
- $till = &DateToFloat (@Period {"till"}) ;
- # $from =~ s/.*\///g ; # delete dd mm if present
- # $till =~ s/.*\///g ;
- #proc areadef
- $script .= "#proc areadef\n" ;
- $script .= " #clone: A\n" ;
- $script .= " " . @Axis {"time"} . "scaletype: linear\n" ; # date yyyy
-
- if (@Axis {"order"} !~ /reverse/i)
- { $script .= " " . @Axis {"time"} . "range: $from $till\n" ; }
- else
- { $script .= " " . @Axis {"time"} . "range: " . (-$till) . " " . (-$from) . "\n" ; }
-
- $script .= "\n" ;
-# }
-
- $script .= "#proc " . @Axis {"time"} . "axis\n" ;
-
- if (($scale eq "Major") && (! $grid))
- {
-# $script .= " stubs: incremental " . @Scales {"Major inc"} . " " . @Scales {"Major unit"} . "\n" ;
-# if ($DateFormat =~ /\//)
-# { $script .= " stubformat: " . @Axis {"format"} . "\n" ; }
-# temp always show whole years (Ploticus autorange bug)
- if (@Scales {"Major stubs"} eq "") # ($DateFormat !~ /\//)
- { $script .= " stubs: incremental " . @Scales {"Major inc"} . "\n" ; }
- else
- { $script .= " stubs: list " . @Scales {"Major stubs"} . "\n" ; }
- }
- else
- { $script .= " stubs: none\n" ; }
-
- if ($DateFormat !~ /\//)
-# { $script .= " ticincrement: " . @Scales {"$scale inc"} . " " . @Scales {"$scale unit"} . "\n" ; }
- { $script .= " ticincrement: " . @Scales {"$scale inc"} . "\n" ; }
- else
- {
- my $unit = 1 ;
- if (@Scales {"$scale unit"} =~ /month/i)
- { $unit = 1/12 ; }
- if (@Scales {"$scale unit"} =~ /day/i)
- { $unit = 1/365 ; }
- $script .= " ticincrement: " . @Scales {"$scale inc"} . " $unit\n" ;
- }
-
- if (defined (@Scales {"$scale start"}))
- {
- $start = @Scales {"$scale start"} ;
- # $start =~ s/.*\///g ; # delete dd mm if present
- $start = &DateToFloat ($start) ;
- if (@Axis {"order"} =~ /reverse/i)
- {
- $loop = 0 ;
- $start = -$start ;
- while ($start - @Scales {"$scale inc"} >= - @Period {"till"})
- {
- $start -= @Scales {"$scale inc"} ;
- if (++$loop > 1000) { last ; } # precaution
- }
- }
- $script .= " stubrange: $start\n" ;
- }
-
- if ($scale eq "Major")
- {
- $script .= " ticlen: 0.05\n" ;
- if (@Axis {"time"} eq "y")
- { $script .= " stubdetails: adjust=0.05,0\n" ; }
- if (@Axis {"order"} =~ /reverse/i)
- { $script .= " signreverse: yes\n" ; }
- }
- else
- { $script .= " ticlen: 0.02\n" ; }
-# $script .= " location: 4\n" ; test
-
- $color .= @Scales {"$scale grid"} ;
-
- if (defined (@Colors {$color}))
- { $color = @Colors {$color} ; }
-
- if ($grid)
- { $script .= " grid: color=$color\n" ; }
-
- $script .= "\n" ;
-
- if ($grid) # restore areadef
- {
- #proc areadef
- $script .= "#proc areadef\n" ;
- $script .= " #clone: A\n" ;
- $script .= "\n" ;
- }
-}
-
-sub PlotLines
-{
- my $layer = shift ;
-
- if ($#DrawLines < 0)
- { return ; }
-
- undef (@DrawLinesNow) ;
-
- foreach $line (@DrawLines)
- {
- if ($line =~ /\|$layer\n/)
- { push @DrawLinesNow, $line ; }
- }
-
- if ($#DrawLinesNow < 0)
- { return ; }
-
- foreach $entry (@DrawLinesNow)
- {
- chomp ($entry) ;
- $script .= "#proc line\n" ;
-# $script .= " notation: scaled\n" ;
- if ($entry =~ /^[12]/)
- { ($mode, $at, $from, $till, $color, $width) = split ('\|', $entry) ; }
- else
- { ($mode, $points, $color, $width) = split ('\|', $entry) ; }
-
- $script .= " linedetails: width=$width color=$color style=0\n" ;
-
- if ($mode == 1) # draw perpendicular to time axis
- {
- if (@Axis {"order"} =~ /reverse/i)
- { $at = -$at ; }
-
- if (@Axis {"time"} eq "x")
- {
- if ($from eq "")
- { $from = @PlotArea {"bottom"} }
- if ($till eq "")
- { $till = @PlotArea {"bottom"} + @PlotArea {"height"} }
- $from += ($width/200) ; # compensate for overstrechting of thick lines
- $till -= ($width/200) ;
- if ($from > @Image {"height"})
- { $from = @Image {"height"} ; }
- if ($till > @Image {"height"})
- { $till = @Image {"height"} ; }
- $script .= " points: $at(s) $from $at(s) $till\n" ;
- }
- else
- {
- if ($from eq "")
- { $from = @PlotArea {"left"} }
- if ($till eq "")
- { $till = @PlotArea {"left"} + @PlotArea {"width"} }
- $from += ($width/200) ;
- $till -= ($width/200) ;
- if ($from > @Image {"width"})
- { $from = @Image {"width"} ; }
- if ($till > @Image {"width"})
- { $till = @Image {"width"} ; }
- $script .= " points: $from $at(s) $till $at(s)\n" ;
- }
- }
-
- if ($mode == 2) # draw parralel to time axis
- {
- if (@Axis {"order"} =~ /reverse/i)
- {
- $from = -$from ;
- $till = -$till ;
- }
-
- $from .= "(s)+" .($width/200) ;
- $till .= "(s)-" .($width/200) ;
- if (@Axis {"time"} eq "x")
- {
- if ($at eq "")
- { $at = @PlotArea {"bottom"} ; }
- if ($at > @Image {"height"})
- { $at = @Image {"height"} ; }
- $script .= " points: $from $at $till $at\n" ;
- }
- else
- {
- if ($at eq "")
- { $at = @PlotArea {"left"} ; }
- if ($at > @Image {"width"})
- { $at = @Image {"width"} ; }
- $script .= " points: $at $from $at $till\n" ;
- }
- }
-
- if ($mode == 3) # draw free line
- {
- @Points = split (",", $points) ;
- foreach $point (@Points)
- { $point = &Normalize ($point) ; }
- if ((@Points [0] > @Image {"width"}) ||
- (@Points [1] > @Image {"height"}) ||
- (@Points [2] > @Image {"width"}) ||
- (@Points [3] > @Image {"height"}))
- { &Error2 ("Linedata attribute 'points' invalid.\n" .
- sprintf ("(%d,%d)(%d,%d)", @Points[0]*100, @Points[1]*100, @Points[2]*100, @Points[3]*100) . " does not fit in image\n") ;
- return ; }
- $script .= " points: @Points[0] @Points[1] @Points[2] @Points[3]\n" ;
- }
- }
-
-
- $script .= "\n" ;
-}
-
-sub ColorPredefined
-{
- my $color = shift ;
- if ($color =~ /^(?:black|white|tan1|tan2|red|magenta|claret|coral|pink|orange|
- redorange|lightorange|yellow|yellow2|dullyellow|yelloworange|
- brightgreen|green|kelleygreen|teal|drabgreen|yellowgreen|
- limegreen|brightblue|darkblue|blue|oceanblue|skyblue|
- purple|lavender|lightpurple|powderblue|powderblue2)$/xi)
- {
- if (! defined (@Colors {lc ($color)}))
- { &StoreColor ($color, $color, "", $command) ; }
- return ($true) ;
- }
- else
- { return ($false) ; }
-}
-
-sub ValidAbs
-{
- $value = shift ;
- if ($value =~ /^ \d+ \.? \d* (?:px|in|cm)? $/xi)
- { return ($true) ; }
- else
- { return ($false) ; }
-}
-
-sub ValidAbsRel
-{
- $value = shift ;
- if ($value =~ /^ \d+ \.? \d* (?:px|in|cm|$hPerc)? $/xi)
- { return ($true) ; }
- else
- { return ($false) ; }
-}
-
-sub ValidDateFormat
-{
- my $date = shift ;
- my ($day, $month, $year) ;
-
-# if ($date=~ /^\-?\d+$/) # for now full years are always allowed
-# { return ($true) ; }
-
- if ($DateFormat eq "yyyy")
- {
- if (! ($date=~ /^\-?\d+$/))
- { return ($false) ; }
- return ($true) ;
- }
-
- if ($DateFormat eq "x.y")
- {
- if (! ($date=~ /^\-?\d+(?:\.\d+)?$/))
- { return ($false) ; }
- return ($true) ;
- }
-
- if (! ($date=~ /^\d\d\/\d\d\/\d\d\d\d$/))
- { return ($false) ; }
-
- if ($DateFormat eq "dd/mm/yyyy")
- {
- $day = substr ($date,0,2) ;
- $month = substr ($date,3,2) ;
- $year = substr ($date,6,4) ;
- }
- else
- {
- $day = substr ($date,3,2) ;
- $month = substr ($date,0,2) ;
- $year = substr ($date,6,4) ;
- }
-
- if ($month =~ /^(?:01|03|05|07|08|10|12)$/)
- { if ($day > 31) { return ($false) ; }}
- elsif ($month =~ /^(?:04|06|09|11)$/)
- { if ($day > 30) { return ($false) ; }}
- elsif ($month =~ /^02$/)
- {
- if (($year % 4 == 0) && ($year % 100 != 0))
- { if ($day > 29) { return ($false) ; }}
- else
- { if ($day > 28) { return ($false) ; }}
- }
- else { return ($false) ; }
- return ($true) ;
-}
-
-sub ValidDateRange
-{
- my $date = shift ;
- my ($day, $month, $year,
- $dayf, $monthf, $yearf,
- $dayt, $montht, $yeart) ;
-
- my $from = @Period {"from"} ;
- my $till = @Period {"till"} ;
-
- if (($DateFormat eq "yyyy") || ($DateFormat eq "x.y"))
- {
- if (($date < $from) || ($date > $till))
- { return ($false) ; }
- return ($true) ;
- }
-
- if ($DateFormat eq "dd/mm/yyyy")
- {
- $day = substr ($date,0,2) ;
- $month = substr ($date,3,2) ;
- $year = substr ($date,6,4) ;
- $dayf = substr ($from,0,2) ;
- $monthf = substr ($from,3,2) ;
- $yearf = substr ($from,6,4) ;
- $dayt = substr ($till,0,2) ;
- $montht = substr ($till,3,2) ;
- $yeart = substr ($till,6,4) ;
- }
- if ($DateFormat eq "mm/dd/yyyy")
- {
- $day = substr ($date,3,2) ;
- $month = substr ($date,0,2) ;
- $year = substr ($date,6,4) ;
- $dayf = substr ($from,3,2) ;
- $monthf = substr ($from,0,2) ;
- $yearf = substr ($from,6,4) ;
- $dayt = substr ($till,3,2) ;
- $montht = substr ($till,0,2) ;
- $yeart = substr ($till,6,4) ;
- }
-
- if (($year < $yearf) ||
- (($year == $yearf) &&
- (($month < $monthf) ||
- (($month == $monthf) && ($day < $dayf))
- )))
- { return ($false) }
-
- if (($year > $yeart) ||
- (($year == $yeart) &&
- (($month > $montht) ||
- (($month == $montht) && ($day > $dayt))
- )))
- { return ($false) }
-
- return ($true) ;
-}
-
-sub DateMedium
-{
- my $from = shift ;
- my $till = shift ;
-
- if (($DateFormat eq "yyyy") || ($DateFormat eq "x.y"))
- { return (sprintf ("%.3f", ($from + $till) / 2)) ; }
-
- $from2 = &DaysFrom1800 ($from) ;
- $till2 = &DaysFrom1800 ($till) ;
- my $date = &DateFrom1800 (int (($from2 + $till2) / 2)) ;
- return ($date) ;
-}
-
-sub DaysFrom1800
-{
- @mmm = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) ;
- my $date = shift ;
- if ($DateFormat eq "dd/mm/yyyy")
- {
- $day = substr ($date,0,2) ;
- $month = substr ($date,3,2) ;
- $year = substr ($date,6,4) ;
- }
- else
- {
- $day = substr ($date,3,2) ;
- $month = substr ($date,0,2) ;
- $year = substr ($date,6,4) ;
- }
- if ($year < 1800)
- { &Error2 ("Function 'DaysFrom1800' expects year >= 1800, not '$year'.") ; return ; }
-
- $days = ($year - 1800) * 365 ;
- $days += int (($year -1 - 1800) / 4) ;
- $days -= int (($year -1 - 1800) / 100) ;
- if ($month > 1)
- {
- for ($m = $month - 2 ; $m >= 0 ; $m--)
- {
- $days += @mmm [$m] ;
- if ($m == 1)
- {
- if ((($year % 4) == 0) && (($year % 100) != 0))
- { $days ++ ; }
- }
- }
- }
- $days += $day ;
-
- return ($days) ;
-}
-
-sub DateToFloat
-{
- my $date = shift ;
- if ($DateFormat !~ /\//)
- { return ($date) ; }
- my $year = $date ;
- $year =~ s/.*\///g ; # delete dd mm/mm dd
- my $fraction = (&DaysFrom1800 ($date) - &DaysFrom1800 ("01/01/" . $year)) / 365.25 ;
- return ($year + $fraction) ;
-}
-
-sub DateFrom1800
-{
- my $days = shift ;
-
- @mmm = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) ;
-
- $year = 1800 ;
- while ($days > 365 + (($year % 4) == 0))
- {
- if ((($year % 4) == 0) && (($year % 100) != 0))
- { $days -= 366 ; }
- else
- { $days -= 365 ; }
- $year ++ ;
- }
-
- $month = 0 ;
- while ($days > @mmm [$month])
- {
- $days -= @mmm [$month] ;
- if ($month == 1)
- {
- if ((($year % 4) == 0) && (($year % 100) != 0))
- { $days -- ; } ;
- }
- $month++ ;
- }
- $day = $days ;
-
- $month ++ ;
- if ($DateFormat eq "dd/mm/yyyy")
- { $date = sprintf ("%02d/%02d/%04d", $day, $month, $year) ; }
- else
- { $date = sprintf ("%02d/%02d/%04d", $month, $day, $year) ; }
-
- return ($date) ;
-}
-
-sub ExtractText
-{
- my $data = shift ;
- my $data2 = $data ;
- my $text = "" ;
-
- # special case: allow embedded spaces when 'text' is last attribute
-# $data2 =~ s/\:\:/\@\#\!/g ;
- if ($data2 =~ /text\:[^\:]+$/)
- {
- $text = $data2 ;
- $text =~ s/^.*?text\:// ;
-# $text =~ s/^\s(.*?)\s*$/$1/ ; ?? ->
- $text =~ s/^(.*?)\s*$/$1/ ;
- $text =~ s/\\n/\n/g ;
- $text =~ s/\"\"/\@\#\$/g ;
- $text =~ s/\"//g ;
- $text =~ s/\@\#\$/"/g ;
- $data2 =~ s/text\:.*$// ;
- }
-
- # extract text between double quotes
- $data2 =~ s/\"\"/\@\#\$/g ;
- if ($data2 =~ /text\:\s*\"/)
- {
- $text = $data2 ;
- $text =~ s/^.*?text\:\s*\"// ;
-
- if (! ($text =~ /\"/))
- { &Error ("PlotData invalid. Attribute 'text': no closing \" found.") ;
- return ("x", "x") ; }
-
- $text =~ s/\".*$//;
- $text =~ s/\@\#\$/"/g ;
- $text =~ s/\\n/\n/g ;
- }
- $data2 =~ s/text\:\s*\"[^\"]*\"// ;
- $data2 =~ s/\@\#\$/"/g ;
- return ($data2, $text) ;
-}
-
-sub ParseText
-{
- my $text = shift ;
- $text =~ s/\_\_/\@\#\$/g ;
- $text =~ s/\_/ /g ;
- $text =~ s/\@\#\$/_/g ;
-
- $text =~ s/\~\~/\@\#\$/g ;
- $text =~ s/\~/\\n/g ;
- $text =~ s/\@\#\$/~/g ;
-
- return ($text) ;
-}
-
-sub BarDefined
-{
- my $bar = shift ;
- foreach $bar2 (@Bars)
- {
- if (lc ($bar2) eq lc ($bar))
- { return ($true) ; }
- }
-
-# not part of barset ? return
- if ($bar != /\#\d+$/)
- { return ($false) ; }
-
-# find previous bar in barset
- my $barcnt = $bar ;
- my $barid = $bar ;
- $barcnt =~ s/.*\#(\d+$)/$1/ ;
- $barid =~ s/(.*\#)\d+$/$1/ ;
- $barcnt -- ;
- $a = $#Bars ;
- for (my $b = 0 ; $b <= $#Bars ; $b++)
- {
- if (lc (@Bars [$b]) eq lc ($barid . $barcnt))
- {
- $b++ ;
- for (my $b2 = $#Bars + 1 ; $b2 > $b ; $b2--)
- { @Bars [$b2] = @Bars [$b2-1]; }
- @Bars [$b] = lc ($bar) ;
- @BarLegend {lc ($bar)} = " " ;
- return ($true) ;
- }
- }
- return ($false) ;
-}
-
-sub ValidAttributes
-{
- my $command = shift ;
-
- if ($command =~ /^BackgroundColors$/i)
- { return (CheckAttributes ($command, "", "canvas,bars")) ; }
-
- if ($command =~ /^BarData$/i)
-# { return (CheckAttributes ($command, "", "bar,barset,barcount,link,text")) ; }
- { return (CheckAttributes ($command, "", "bar,barset,link,text")) ; }
-
- if ($command =~ /^Colors$/i)
- { return (CheckAttributes ($command, "id,value", "legend")) ; }
-
- if ($command =~ /^ImageSize$/i)
- { return (CheckAttributes ($command, "", "width,height,barincrement")) ; }
-
- if ($command =~ /^Legend$/i)
- { return (CheckAttributes ($command, "", "columns,columnwidth,orientation,position,left,top")) ; }
-
- if ($command =~ /^LineData$/i)
- { return (CheckAttributes ($command, "", "at,from,till,atpos,frompos,tillpos,points,color,layer,width")) ; }
-
- if ($command =~ /^Period$/i)
- { return (CheckAttributes ($command, "from,till", "")) ; }
-
- if ($command =~ /^PlotArea$/i)
- { return (CheckAttributes ($command, "", "left,bottom,width,height,right,top")) ; }
-
- if ($command =~ /^PlotData$/i)
- { return (CheckAttributes ($command, "", "align,anchor,at,bar,barset,color,fontsize,from,link,mark,shift,text,textcolor,till,width")) ; }
-
- if ($command =~ /^Scale/i)
- { return (CheckAttributes ($command, "increment,start", "unit,grid,gridcolor,text")) ; }
-
- if ($command =~ /^TextData$/i)
- { return (CheckAttributes ($command, "", "fontsize,lineheight,link,pos,tabs,text,textcolor")) ; }
-
- if ($command =~ /^TimeAxis$/i)
- { return (CheckAttributes ($command, "", "orientation,format,order")) ; }
-
- return ($true) ;
-}
-
-sub CheckAttributes
-{
- my $name = shift ;
- my @Required = split (",", shift) ;
- my @Allowed = split (",", shift) ;
-
- my $attribute ;
- my %Attributes2 = %Attributes ;
-
- $hint = "\nSyntax: '$name =" ;
- foreach $attribute (@Required)
- { $hint .= " $attribute:.." ; }
- foreach $attribute (@Allowed)
- { $hint .= " [$attribute:..]" ; }
- $hint .= "'" ;
-
- foreach $attribute (@Required)
- {
- if ((! defined (@Attributes {$attribute})) || (@Attributes {$attribute} eq ""))
- { &Error ("$name definition incomplete. $hint") ;
- undef (@Attributes) ; return ($false) ; }
- delete (@Attributes2 {$attribute}) ;
- }
- foreach $attribute (@Allowed)
- { delete (@Attributes2 {$attribute}) ; }
-
- @AttrKeys = keys %Attributes2 ;
- if ($#AttrKeys >= 0)
- {
- if (@AttrKeys [0] eq "single")
- { &Error ("$name definition invalid. Specify all attributes as name:value pairs.") ; }
- else
- { &Error ("$name definition invalid. Invalid attribute '" . @AttrKeys [0] . "' found. $hint") ; }
- undef (@Attributes) ; return ($false) ; }
-
- return ($true) ;
-}
-
-sub CheckPreset
-{
- my $command = shift ;
- my ($preset, $action, $attrname, $attrvalue) ;
-
- my $newcommand = $true ;
- my $addvalue = $true ;
- if ($command =~ /^$prevcommand$/i)
- { $newcommand = $false ; }
- if ((! $newcommand) && ($command =~ /^(?:DrawLines|PlotData|TextData)$/i))
- { $addvalue = $false ; }
- $prevcommand = $command ;
-
- foreach $preset (@PresetList)
- {
- if ($preset =~ /^$command\|/i)
- {
- ($command, $action, $attrname, $attrpreset) = split ('\|', $preset) ;
- if ($attrname eq "")
- { $attrname = "single" ; }
-
- $attrvalue = @Attributes {$attrname} ;
-
- if (($action eq "-") && ($attrvalue ne ""))
- {
- if ($attrname eq "single")
- { &Error ("Chosen preset makes this command redundant.\n" .
- " Please remove this command.") ; }
- else
- { &Error ("Chosen preset conflicts with '$attrname:...'.\n" .
- " Please remove this attribute.") ; }
- @Attributes {$attrname} = "" ;
- }
-
- if (($action eq "+") && ($attrvalue eq ""))
- {
- if ($addvalue)
- { @Attributes {$attrname} = $attrpreset ; }
- }
-
- if (($action eq "=") && ($attrvalue eq ""))
- { @Attributes {$attrname} = $attrpreset ; }
-
- if (($action eq "=") && ($attrvalue ne "") &&
- ($attrvalue !~ /$attrpreset/i))
- {
- if ($attrname eq "single")
- { &Error ("Conflicting settings.\nPreset defines '$attrpreset'.") ; }
- else
- { &Error ("Conflicting settings.\nPreset defines '$attrname:$attrpreset'.") ; }
- @Attributes {$attrname} = $attrpreset ;
- }
- }
- }
-}
-
-sub ShiftOnePixelForSVG
-{
- my $line = shift ;
- $line =~ s/location:\s*// ;
- my ($posx, $posy) = split (" ", $line) ;
-
- if ($posy =~ /\+/)
- { ($posy1, $posy2) = split ('\+', $posy) ; }
- elsif ($posy =~ /.+\-/)
- {
- if ($posy =~ /^\-/)
- {
- ($sign, $posy1, $posy2) = split ('\-', $posy) ; $posy2 = - $posy2 ;
- $posy1 = "-" . $posy1 ;
- }
- else
- { ($posy1, $posy2) = split ('\-', $posy) ; $posy2 = - $posy2 }
- }
- else
- { $posy1 = $posy ; $posy2 = 0 ; }
-
- if ($posy1 !~ /(s)/)
- { $posy += 0.01 ; }
- else
- {
- $posy2 += 0.01 ;
- if ($posy2 == 0)
- { $posy = $posy1 ; }
- elsif ($posy2 < 0)
- { $posy = $posy1 . "$posy2" ; }
- else
- { $posy = $posy1 . "+" . $posy2 ; }
- }
-
- $line = "\n location: $posx $posy" ;
- return ($line) ;
-}
-
-sub NormalizeURL
-{
- my $url = shift ;
- $url =~ s/(https?)\:?\/?\/?/$1:\/\// ; # add possibly missing special characters
- $url =~ s/ /%20/g ;
- return ($url) ;
-}
-
-# wiki style link may include linebreak characters -> split into several wiki links
-sub NormalizeWikiLink
-{
- my $text = shift ;
-
- my $brdouble = $false ;
- if ($text =~ /\[\[.*\]\]/)
- { $brdouble = $true ; }
-
- $text =~ s/\[\[?// ;
- $text =~ s/\]?\]// ;
-
- my ($hide,$show) = split ('\|', $text) ;
- if ($show eq "")
- { $show = $hide ; }
- $hide =~ s/\s*\n\s*/ /g ;
-
- my @Show = split ("\n", $show) ;
- $text = "" ;
- foreach $part (@Show)
- {
- if ($brdouble)
- { $part = "[[" . $hide . "|" . $part . "]]" ; }
- else
- { $part = "[" . $hide . "|" . $part . "]" ; }
- }
- $text = join ("\n", @Show) ;
-
- return ($text) ;
-}
-
-sub ProcessWikiLink
-{
- my $text = shift ;
- my $link = shift ;
- my $hint = shift ;
- my $wikilink = $false ;
-
- chomp ($text) ;
- chomp ($link) ;
- chomp ($hint) ;
-
- my ($wiki, $title) ;
- if ($link ne "") # ignore wiki brackets in text when explicit link is specified
- {
- $text =~ s/\[\[ [^\|]+ \| (.*) \]\]/$1/gx ;
- $text =~ s/\[\[ [^\:]+ \: (.*) \]\]/$1/gx ;
-# $text =~ s/\[\[ (.*) \]\]/$1/gx ;
- }
- else
- {
- if ($text =~ /\[.+\]/) # keep first link in text segment, remove others
- {
- $link = $text ;
- $link =~ s/\n//g ;
- $link =~ s/^[^\[\]]*\[/[/x ;
-
- if ($link =~ /^\[\[/)
- { $wikilink = $true ; }
-
- $link =~ s/^ [^\[]* \[+ ([^\[\]]*) \].*$/$1/x ;
- $link =~ s/\|.*$// ;
- if ($wikilink)
- { $link = "[[" . $link . "]]" ; }
-
- $text =~ s/(\[+) [^\|\]]+ \| ([^\]]*) (\]+)/$1$2$3/gx ;
- $text =~ s/(https?)\:/$1colon/gx ;
-# $text =~ s/(\[+) [^\:\]]+ \: ([^\]]*) (\]+)/$1$2$3/gx ; #???
-
- # remove interwiki link prefix
- $text =~ s/(\[+) (?:.{2,3}|(?:zh\-.*)|simple|minnan|tokipona) \: ([^\]]*) (\]+)/$1$2$3/gxi ; #???
-
- $text =~ s/\[+ ([^\]]+) \]+/{{{$1}}}/x ;
- $text =~ s/\[+ ([^\]]+) \]+/$1/gx ;
- $text =~ s/\{\{\{ ([^\}]*) \}\}\}/[[$1]]/x ;
- }
-# if ($text =~ /\[\[.+\]\]/)
-# {
-# $wikilink = $true ;
-# $link = $text ;
-# $link =~ s/\n//g ;
-# $link =~ s/^.*?\[\[/[[/x ;
-# $link =~ s/\| .*? \]\].*$/]]/x ;
-# $link =~ s/\]\].*$/]]/x ;
-# $text =~ s/\[\[ [^\|\]]+ \| (.*?) \]\]/[[$1]]/x ;
-# $text =~ s/\[\[ [^\:\]]+ \: (.*?) \]\]/[[$1]]/x ;
-
-# # remove remaining links
-# $text =~ s/\[\[ ([^\]]+) \]\]/^%#$1#%^/x ;
-# $text =~ s/\[+ ([^\]]+) \]+/$1/gx ;
-# $text =~ s/\^$hPerc\# (.*?) \#$hPerc\^/[[$1]]/x ;
-# }
-# elsif ($text =~ /\[.+\]/)
-# {
-# $link = $text ;
-# $link =~ s/\n//g ;
-# $link =~ s/^.*?\[/[/x ;
-# $link =~ s/\| .*? \].*$/]/x ;
-# $link =~ s/\].*$/]/x ;
-# $link =~ s/\[ ([^\]]+) \]/$1/x ;
-# $text =~ s/\[ [^\|\]]+ \| (.*?) \]/[[$1]]/x ;
-
-# # remove remaining links
-# $text =~ s/\[\[ ([^\]]+) \]\]/^%#$1#%^/x ;
-# $text =~ s/\[+ ([^\]]+) \]+/$1/gx ;
-# $text =~ s/\^$hPerc\# (.*?) \#$hPerc\^/[[$1]]/x ;
-## $text =~ s/\[\[ (.*) \]\]/$1/gx ;
-# }
-
- }
-
- if ($wikilink)
- {
-# if ($link =~ /^\[\[.+\:.+\]\]$/) # has a colon in its name
- if ($link =~ /^\[\[ (?:.{2,3}|(?:zh\-.*)|simple|minnan|tokipona) \: .+\]\]$/xi) # has a interwiki link prefix
- {
- # This will fail for all interwiki links other than Wikipedia.
- $wiki = lc ($link) ;
- $title = $link ;
- $wiki =~ s/\[\[([^\:]+)\:.*$/$1/x ;
- $title =~ s/^[^\:]+\:(.*)\]\]$/$1/x ;
- $title =~ s/ /_/g ;
- $link = "http://$wiki.wikipedia.org/wiki/$title" ;
- $link = &EncodeURL ($title) ;
- if (($hint eq "") && ($title ne ""))
- { $hint = "$wiki: $title" ; }
- }
- else
- {
- # $wiki = "en" ;
- $title = $link ;
- $title =~ s/^\[\[(.*)\]\]$/$1/x ;
- $title =~ s/ /_/g ;
- $link = $articlepath ;
- $urlpart = &EncodeURL ($title) ;
- $link =~ s/\$1/$urlpart/ ;
- if (($hint eq "") && ($title ne ""))
- { $hint = "$title" ; }
- }
- $hint =~ s/_/ /g ;
- }
- else
- {
- if ($link ne "")
- { $hint = &ExternalLinkToHint ($link) ; }
- }
-
- if (($link ne "") && ($text !~ /\[\[/) && ($text !~ /\]\]/))
- { $text = "[[" . $text . "]]" ; }
-
- $hint = &EncodeHtml ($hint) ;
- return ($text, $link, $hint) ;
-}
-
-sub ExternalLinkToHint
-{
- my $hint = shift ;
- $hint =~ s/^https?\:?\/?\/?// ;
- $hint =~ s/\/.*$// ;
- return (&EncodeHtml ($hint . "/..")) ;
-}
-
-sub EncodeInput
-{
- my $text = shift ;
- # revert encoding of '<' & '>' by MediaWiki
- $text =~ s/\&lt\;/\</g ;
- $text =~ s/\&gt\;/\>/g ;
- $text =~ s/([\`\{\}\%\&\@\$\(\)\;\=])/"%" . sprintf ("%X", ord($1)) . "%";/ge ;
- return ($text) ;
-}
-
-sub DecodeInput
-{
- my $text = shift ;
- $text =~ s/\%([0-9A-F]{2})\%/chr(hex($1))/ge ;
- return ($text) ;
-}
-
-sub EncodeHtml
-{
- my $text = shift ;
- $text =~ s/([\<\>\&\'\"])/"\&\#" . ord($1) . "\;"/ge ;
- $text =~ s/\n/<br>/g ;
- return ($text) ;
-}
-
-sub EncodeURL
-{
- my $url = shift ;
- # For some reason everything gets run through this weird internal
- # encoding that's similar to URL-encoding. Armor against this as well,
- # or else adjacent encoded bytes will be corrupted.
- $url =~ s/([^0-9a-zA-Z\%\:\/\._])/"%25%".sprintf ("%02X",ord($1))/ge ;
- return ($url) ;
-}
-
-sub Error
-{
- my $msg = &DecodeInput(shift) ;
- $msg =~ s/\n\s*/\n /g ; # indent consecutive lines
-
- $CntErrors++ ;
- if (! $listinput)
- { push @Errors, "Line $LineNo: " . &DecodeInput($Line) . "\n" ; }
- push @Errors, "- $msg\n\n" ;
- if ($CntErrors > 10)
- { &Abort ("More than 10 errors found") ; }
-}
-
-sub Error2
-{
- my $msg = &DecodeInput(shift) ;
- $msg =~ s/\n\s*/\n /g ; # indent consecutive lines
- $CntErrors++ ;
- push @Errors, "- $msg\n" ;
-}
-
-sub Warning
-{
- my $msg = &DecodeInput(shift) ;
- $msg =~ s/\n\s*/\n /g ; # indent consecutive lines
- if (! $listinput)
- { push @Warnings, "Line $LineNo: " . &DecodeInput ($Line) . "\n" ; }
- push @Warnings, "- $msg\n\n" ;
-}
-
-sub Warning2
-{
- my $msg = &DecodeInput(shift) ;
- $msg =~ s/\n\s*/\n /g ; # indent consecutive lines
- push @Warnings, "- $msg\n" ;
-}
-
-sub Info
-{
- my $msg = &DecodeInput(shift) ;
- $msg =~ s/\n\s*/\n /g ; # indent consecutive lines
- if (! $listinput)
- { push @Info, "Line $LineNo: " . &DecodeInput ($Line) . "\n" ; }
- push @Info, "- $msg\n\n" ;
-}
-
-sub Info2
-{
- my $msg = &DecodeInput(shift) ;
- $msg =~ s/\n\s*/\n /g ; # indent consecutive lines
- push @Info, "- $msg\n" ;
-}
-
-sub Abort
-{
- my $msg = &DecodeInput(shift) ;
-
- print "\n\n***** " . $msg . " *****\n\n" ;
- print @Errors ;
- print "Execution aborted.\n" ;
-
- open "FILE_OUT", ">", $file_errors ;
- print FILE_OUT "<p>EasyTimeline $version</p><p><b>Timeline generation failed: " . &EncodeHtml ($msg) ."</b></p>\n" ;
- foreach $line (@Errors)
- { print FILE_OUT &EncodeHtml ($line) . "\n" ; }
- close "FILE_OUT" ;
-
- if ($makehtml) # generate html test file, which would normally contain png + svg (+ image map)
- {
- open "FILE_IN", "<", $file_errors ;
- open "FILE_OUT", ">", $file_html ;
- print FILE_OUT "<html><head>\n<title>Graphical Timelines - HTML test file</title>\n</head>\n" .
- "<body><h1><font color='green'>EasyTimeline</font> - Test Page</h1>\n\n" .
- "<code>\n" ;
- print FILE_OUT <FILE_IN> ;
- print FILE_OUT "</code>\n\n</body>\n</html>" ;
- close "FILE_IN" ;
- close "FILE_OUT" ;
- }
- exit ;
-}
-
-sub EscapeShellArg
-{
- my $arg = shift;
- if ($env eq "Linux") {
- $arg =~ s/'/\\'/;
- $arg = "'$arg'";
- } else {
- $arg =~ s/"/\\"/;
- $arg = "\"$arg\"";
- }
- return $arg;
-}
-
-# vim: set sts=2 ts=2 sw=2 et :
-
-sub UnicodeToAscii {
- my $unicode = shift ;
- my $char = substr ($unicode,0,1) ;
- my $ord = ord ($char) ;
-
- if ($ord < 128) # plain ascii character
- { return ($unicode) ; } # (will not occur in this script)
- else
- {
- # for completeness sake complete routine, only 2 byte unicodes sent here
- if ($ord >= 252)
- { $value = $ord - 252 ; }
- elsif ($ord >= 248)
- { $value = $ord - 248 ; }
- elsif ($ord >= 240)
- { $value = $ord - 240 ; }
- elsif ($ord >= 224)
- { $value = $ord - 224 ; }
- else
- { $value = $ord - 192 ; }
- for ($c = 1 ; $c < length ($unicode) ; $c++)
- { $value = $value * 64 + ord (substr ($unicode, $c,1)) - 128 ; }
-
-# $html = "\&\#" . $value . ";" ; any unicode can be specified as html char
-
- if (($value >= 128) && ($value <= 255))
- { return (chr ($value)) ; }
- else
- { return "?" ; }
- }
-}
-
diff --git a/mwlib/Makefile b/mwlib/Makefile
deleted file mode 100644
index 6f244ef..0000000
--- a/mwlib/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-RE2C = re2c -w --no-generation-date
-
-all: _expander.cc _mwscan.cc _mwscan.so _expander.so
-
-_expander.so: _expander.cc
- (cd .. && python ./setup.py build_ext --inplace build)
-
-_mwscan.so: _mwscan.cc
- (cd .. && python ./setup.py build_ext --inplace build)
-
-_expander.cc: _expander.re
- $(RE2C) -o _expander.cc _expander.re
-
-_mwscan.cc: _mwscan.re
- $(RE2C) -o _mwscan.cc _mwscan.re
-
-clean::
- rm -rf *.pyc *~ *.so build a.out
-
-
diff --git a/mwlib/__init__.py b/mwlib/__init__.py
deleted file mode 100755
index 8088807..0000000
--- a/mwlib/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-#import pkg_resources
-#pkg_resources.declare_namespace("mwlib")
diff --git a/mwlib/_expander.cc b/mwlib/_expander.cc
deleted file mode 100644
index 9641ae1..0000000
--- a/mwlib/_expander.cc
+++ /dev/null
@@ -1,826 +0,0 @@
-/* Generated by re2c 0.13.4 */
-#line 1 "_expander.re"
-// -*- mode: c++ -*-
-// Copyright (c) 2007-2008 PediaPress GmbH
-// See README.txt for additional licensing information.
-
-#include <Python.h>
-
-#include <iostream>
-#include <assert.h>
-#include <vector>
-
-using namespace std;
-
-#define RET(x) {found(x); return x;}
-
-struct Token
-{
- int type;
- int start;
- int len;
-};
-
-
-class MacroScanner
-{
-public:
-
- MacroScanner(Py_UNICODE *_start, Py_UNICODE *_end) {
- source = start = _start;
- end = _end;
- cursor = start;
- }
-
- int found(int val) {
- if (val==5 && tokens.size()) {
- Token &previous_token (tokens[tokens.size()-1]);
- if (previous_token.type==val) {
- previous_token.len += cursor-start;
- return tokens.size()-1;
- }
- }
- Token t;
- t.type = val;
- t.start = (start-source);
- t.len = cursor-start;
- tokens.push_back(t);
- return tokens.size()-1;
- }
-
- inline int scan();
-
- Py_UNICODE *source;
-
- Py_UNICODE *start;
- Py_UNICODE *cursor;
- Py_UNICODE *end;
- vector<Token> tokens;
-};
-
-
-int MacroScanner::scan()
-{
-
-std:
-
- start=cursor;
-
- Py_UNICODE *marker=cursor;
-
- Py_UNICODE *save_cursor = cursor;
-
-
-#define YYCTYPE Py_UNICODE
-#define YYCURSOR cursor
-#define YYMARKER marker
-#define YYLIMIT (end)
-// #define YYFILL(n) return 0;
-
-#line 80 "_expander.re"
-
-
-
-
-
-#line 87 "_expander.cc"
-{
- YYCTYPE yych;
-
- yych = *YYCURSOR;
- if (yych <= '\\') {
- if (yych <= '<') {
- if (yych <= 0x0000) goto yy10;
- if (yych <= ';') goto yy12;
- goto yy9;
- } else {
- if (yych == '[') goto yy5;
- goto yy12;
- }
- } else {
- if (yych <= '{') {
- if (yych <= ']') goto yy6;
- if (yych <= 'z') goto yy12;
- } else {
- if (yych <= '|') goto yy7;
- if (yych <= '}') goto yy4;
- goto yy12;
- }
- }
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '{') goto yy78;
-yy3:
-#line 99 "_expander.re"
- {RET(5);}
-#line 116 "_expander.cc"
-yy4:
- yych = *++YYCURSOR;
- if (yych == '}') goto yy75;
- goto yy3;
-yy5:
- yych = *++YYCURSOR;
- if (yych == '[') goto yy73;
- goto yy3;
-yy6:
- yych = *++YYCURSOR;
- if (yych == ']') goto yy73;
- goto yy3;
-yy7:
- ++YYCURSOR;
-#line 88 "_expander.re"
- {RET(6);}
-#line 133 "_expander.cc"
-yy9:
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= 'M') {
- if (yych <= 'G') {
- if (yych == '!') goto yy13;
- if (yych <= 'F') goto yy3;
- goto yy15;
- } else {
- if (yych == 'I') goto yy17;
- if (yych <= 'L') goto yy3;
- goto yy16;
- }
- } else {
- if (yych <= 'h') {
- if (yych <= 'N') goto yy18;
- if (yych == 'g') goto yy15;
- goto yy3;
- } else {
- if (yych <= 'l') {
- if (yych <= 'i') goto yy17;
- goto yy3;
- } else {
- if (yych <= 'm') goto yy16;
- if (yych <= 'n') goto yy18;
- goto yy3;
- }
- }
- }
-yy10:
- ++YYCURSOR;
-#line 98 "_expander.re"
- {RET(0);}
-#line 166 "_expander.cc"
-yy12:
- yych = *++YYCURSOR;
- goto yy3;
-yy13:
- yych = *++YYCURSOR;
- if (yych == '-') goto yy60;
-yy14:
- YYCURSOR = YYMARKER;
- goto yy3;
-yy15:
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy51;
- if (yych == 'a') goto yy51;
- goto yy14;
-yy16:
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy45;
- if (yych == 'a') goto yy45;
- goto yy14;
-yy17:
- yych = *++YYCURSOR;
- if (yych == 'M') goto yy35;
- if (yych == 'm') goto yy35;
- goto yy14;
-yy18:
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy19;
- if (yych != 'o') goto yy14;
-yy19:
- yych = *++YYCURSOR;
- if (yych <= 'W') {
- if (yych == 'I') goto yy21;
- if (yych <= 'V') goto yy14;
- } else {
- if (yych <= 'i') {
- if (yych <= 'h') goto yy14;
- goto yy21;
- } else {
- if (yych != 'w') goto yy14;
- }
- }
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy30;
- if (yych == 'i') goto yy30;
- goto yy14;
-yy21:
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy22;
- if (yych != 'n') goto yy14;
-yy22:
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy23;
- if (yych != 'c') goto yy14;
-yy23:
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy24;
- if (yych != 'l') goto yy14;
-yy24:
- yych = *++YYCURSOR;
- if (yych == 'U') goto yy25;
- if (yych != 'u') goto yy14;
-yy25:
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy26;
- if (yych != 'd') goto yy14;
-yy26:
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy27;
- if (yych != 'e') goto yy14;
-yy27:
- yych = *++YYCURSOR;
- if (yych != '>') goto yy14;
- ++YYCURSOR;
-#line 90 "_expander.re"
- {goto noinclude;}
-#line 242 "_expander.cc"
-yy30:
- yych = *++YYCURSOR;
- if (yych == 'K') goto yy31;
- if (yych != 'k') goto yy14;
-yy31:
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy32;
- if (yych != 'i') goto yy14;
-yy32:
- yych = *++YYCURSOR;
- if (yych != '>') goto yy14;
- ++YYCURSOR;
-#line 91 "_expander.re"
- {goto nowiki;}
-#line 257 "_expander.cc"
-yy35:
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy36;
- if (yych != 'a') goto yy14;
-yy36:
- yych = *++YYCURSOR;
- if (yych == 'G') goto yy37;
- if (yych != 'g') goto yy14;
-yy37:
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy38;
- if (yych != 'e') goto yy14;
-yy38:
- yych = *++YYCURSOR;
- if (yych == 'M') goto yy39;
- if (yych != 'm') goto yy14;
-yy39:
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy40;
- if (yych != 'a') goto yy14;
-yy40:
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy41;
- if (yych != 'p') goto yy14;
-yy41:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '<') {
- if (yych <= 0x0000) goto yy14;
- if (yych <= ';') goto yy41;
- goto yy14;
- } else {
- if (yych != '>') goto yy41;
- }
- ++YYCURSOR;
-#line 92 "_expander.re"
- {goto imagemap;}
-#line 295 "_expander.cc"
-yy45:
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy46;
- if (yych != 't') goto yy14;
-yy46:
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy47;
- if (yych != 'h') goto yy14;
-yy47:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '<') {
- if (yych <= 0x0000) goto yy14;
- if (yych <= ';') goto yy47;
- goto yy14;
- } else {
- if (yych != '>') goto yy47;
- }
- ++YYCURSOR;
-#line 93 "_expander.re"
- {goto math;}
-#line 317 "_expander.cc"
-yy51:
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy52;
- if (yych != 'l') goto yy14;
-yy52:
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy53;
- if (yych != 'l') goto yy14;
-yy53:
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy54;
- if (yych != 'e') goto yy14;
-yy54:
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy55;
- if (yych != 'r') goto yy14;
-yy55:
- yych = *++YYCURSOR;
- if (yych == 'Y') goto yy56;
- if (yych != 'y') goto yy14;
-yy56:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '<') {
- if (yych <= 0x0000) goto yy14;
- if (yych <= ';') goto yy56;
- goto yy14;
- } else {
- if (yych != '>') goto yy56;
- }
- ++YYCURSOR;
-#line 94 "_expander.re"
- {goto gallery;}
-#line 351 "_expander.cc"
-yy60:
- yych = *++YYCURSOR;
- if (yych != '-') goto yy14;
- yych = *++YYCURSOR;
- if (yych != '[') goto yy14;
- yych = *++YYCURSOR;
- if (yych != '^') goto yy14;
- yych = *++YYCURSOR;
- if (yych >= 0x0001) goto yy14;
- yych = *++YYCURSOR;
- if (yych != '<') goto yy14;
- yych = *++YYCURSOR;
- if (yych != '>') goto yy14;
- yych = *++YYCURSOR;
- if (yych != ']') goto yy14;
- yych = *++YYCURSOR;
- if (yych != '*') goto yy14;
- yych = *++YYCURSOR;
- if (yych != '-') goto yy14;
- yych = *++YYCURSOR;
- if (yych != '-') goto yy14;
- yych = *++YYCURSOR;
- if (yych != '>') goto yy14;
- ++YYCURSOR;
-#line 96 "_expander.re"
- {RET(5);}
-#line 378 "_expander.cc"
-yy73:
- ++YYCURSOR;
-#line 87 "_expander.re"
- {RET(3);}
-#line 383 "_expander.cc"
-yy75:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych == '}') goto yy75;
-#line 86 "_expander.re"
- {RET(2);}
-#line 390 "_expander.cc"
-yy78:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych == '{') goto yy78;
-#line 85 "_expander.re"
- {RET(1);}
-#line 397 "_expander.cc"
-}
-#line 101 "_expander.re"
-
-
-
-
-noinclude:
-
-#line 406 "_expander.cc"
-{
- YYCTYPE yych;
- yych = *YYCURSOR;
- if (yych <= 0x0000) goto yy86;
- if (yych != '<') goto yy85;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '/') goto yy88;
-yy84:
-#line 108 "_expander.re"
- {goto noinclude;}
-#line 417 "_expander.cc"
-yy85:
- yych = *++YYCURSOR;
- goto yy84;
-yy86:
- ++YYCURSOR;
-#line 109 "_expander.re"
- {cursor=start+11; RET(5);}
-#line 425 "_expander.cc"
-yy88:
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy90;
- if (yych == 'n') goto yy90;
-yy89:
- YYCURSOR = YYMARKER;
- goto yy84;
-yy90:
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy91;
- if (yych != 'o') goto yy89;
-yy91:
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy92;
- if (yych != 'i') goto yy89;
-yy92:
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy93;
- if (yych != 'n') goto yy89;
-yy93:
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy94;
- if (yych != 'c') goto yy89;
-yy94:
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy95;
- if (yych != 'l') goto yy89;
-yy95:
- yych = *++YYCURSOR;
- if (yych == 'U') goto yy96;
- if (yych != 'u') goto yy89;
-yy96:
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy97;
- if (yych != 'd') goto yy89;
-yy97:
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy98;
- if (yych != 'e') goto yy89;
-yy98:
- yych = *++YYCURSOR;
- if (yych != '>') goto yy89;
- ++YYCURSOR;
-#line 107 "_expander.re"
- {goto std;}
-#line 471 "_expander.cc"
-}
-#line 110 "_expander.re"
-
-
-nowiki:
-
-#line 478 "_expander.cc"
-{
- YYCTYPE yych;
- yych = *YYCURSOR;
- if (yych <= 0x0000) goto yy106;
- if (yych != '<') goto yy105;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '/') goto yy108;
-yy104:
-#line 115 "_expander.re"
- {goto nowiki;}
-#line 489 "_expander.cc"
-yy105:
- yych = *++YYCURSOR;
- goto yy104;
-yy106:
- ++YYCURSOR;
-#line 116 "_expander.re"
- {RET(0);}
-#line 497 "_expander.cc"
-yy108:
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy110;
- if (yych == 'n') goto yy110;
-yy109:
- YYCURSOR = YYMARKER;
- goto yy104;
-yy110:
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy111;
- if (yych != 'o') goto yy109;
-yy111:
- yych = *++YYCURSOR;
- if (yych == 'W') goto yy112;
- if (yych != 'w') goto yy109;
-yy112:
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy113;
- if (yych != 'i') goto yy109;
-yy113:
- yych = *++YYCURSOR;
- if (yych == 'K') goto yy114;
- if (yych != 'k') goto yy109;
-yy114:
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy115;
- if (yych != 'i') goto yy109;
-yy115:
- yych = *++YYCURSOR;
- if (yych != '>') goto yy109;
- ++YYCURSOR;
-#line 114 "_expander.re"
- {RET(5);}
-#line 531 "_expander.cc"
-}
-#line 117 "_expander.re"
-
-
-math:
-
-#line 538 "_expander.cc"
-{
- YYCTYPE yych;
- yych = *YYCURSOR;
- if (yych <= 0x0000) goto yy123;
- if (yych != '<') goto yy122;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '/') goto yy125;
-yy121:
-#line 122 "_expander.re"
- {goto math;}
-#line 549 "_expander.cc"
-yy122:
- yych = *++YYCURSOR;
- goto yy121;
-yy123:
- ++YYCURSOR;
-#line 123 "_expander.re"
- {RET(0);}
-#line 557 "_expander.cc"
-yy125:
- yych = *++YYCURSOR;
- if (yych == 'M') goto yy127;
- if (yych == 'm') goto yy127;
-yy126:
- YYCURSOR = YYMARKER;
- goto yy121;
-yy127:
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy128;
- if (yych != 'a') goto yy126;
-yy128:
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy129;
- if (yych != 't') goto yy126;
-yy129:
- yych = *++YYCURSOR;
- if (yych == 'H') goto yy130;
- if (yych != 'h') goto yy126;
-yy130:
- yych = *++YYCURSOR;
- if (yych != '>') goto yy126;
- ++YYCURSOR;
-#line 121 "_expander.re"
- {RET(5);}
-#line 583 "_expander.cc"
-}
-#line 124 "_expander.re"
-
-
-gallery:
-
-#line 590 "_expander.cc"
-{
- YYCTYPE yych;
- yych = *YYCURSOR;
- if (yych <= 0x0000) goto yy138;
- if (yych != '<') goto yy137;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '/') goto yy140;
-yy136:
-#line 129 "_expander.re"
- {goto gallery;}
-#line 601 "_expander.cc"
-yy137:
- yych = *++YYCURSOR;
- goto yy136;
-yy138:
- ++YYCURSOR;
-#line 130 "_expander.re"
- {RET(0);}
-#line 609 "_expander.cc"
-yy140:
- yych = *++YYCURSOR;
- if (yych == 'G') goto yy142;
- if (yych == 'g') goto yy142;
-yy141:
- YYCURSOR = YYMARKER;
- goto yy136;
-yy142:
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy143;
- if (yych != 'a') goto yy141;
-yy143:
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy144;
- if (yych != 'l') goto yy141;
-yy144:
- yych = *++YYCURSOR;
- if (yych == 'L') goto yy145;
- if (yych != 'l') goto yy141;
-yy145:
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy146;
- if (yych != 'e') goto yy141;
-yy146:
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy147;
- if (yych != 'r') goto yy141;
-yy147:
- yych = *++YYCURSOR;
- if (yych == 'Y') goto yy148;
- if (yych != 'y') goto yy141;
-yy148:
- yych = *++YYCURSOR;
- if (yych != '>') goto yy141;
- ++YYCURSOR;
-#line 128 "_expander.re"
- {RET(5);}
-#line 647 "_expander.cc"
-}
-#line 131 "_expander.re"
-
-
-imagemap:
-
-#line 654 "_expander.cc"
-{
- YYCTYPE yych;
- yych = *YYCURSOR;
- if (yych <= 0x0000) goto yy156;
- if (yych != '<') goto yy155;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '/') goto yy158;
-yy154:
-#line 136 "_expander.re"
- {goto imagemap;}
-#line 665 "_expander.cc"
-yy155:
- yych = *++YYCURSOR;
- goto yy154;
-yy156:
- ++YYCURSOR;
-#line 137 "_expander.re"
- {RET(0);}
-#line 673 "_expander.cc"
-yy158:
- yych = *++YYCURSOR;
- if (yych == 'I') goto yy160;
- if (yych == 'i') goto yy160;
-yy159:
- YYCURSOR = YYMARKER;
- goto yy154;
-yy160:
- yych = *++YYCURSOR;
- if (yych == 'M') goto yy161;
- if (yych != 'm') goto yy159;
-yy161:
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy162;
- if (yych != 'a') goto yy159;
-yy162:
- yych = *++YYCURSOR;
- if (yych == 'G') goto yy163;
- if (yych != 'g') goto yy159;
-yy163:
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy164;
- if (yych != 'e') goto yy159;
-yy164:
- yych = *++YYCURSOR;
- if (yych == 'M') goto yy165;
- if (yych != 'm') goto yy159;
-yy165:
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy166;
- if (yych != 'a') goto yy159;
-yy166:
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy167;
- if (yych != 'p') goto yy159;
-yy167:
- yych = *++YYCURSOR;
- if (yych != '>') goto yy159;
- ++YYCURSOR;
-#line 135 "_expander.re"
- {RET(5);}
-#line 715 "_expander.cc"
-}
-#line 138 "_expander.re"
-
-
-pre:
-
-#line 722 "_expander.cc"
-{
- YYCTYPE yych;
- yych = *YYCURSOR;
- if (yych <= 0x0000) goto yy175;
- if (yych != '<') goto yy174;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '/') goto yy177;
-yy173:
-#line 143 "_expander.re"
- {goto pre;}
-#line 733 "_expander.cc"
-yy174:
- yych = *++YYCURSOR;
- goto yy173;
-yy175:
- ++YYCURSOR;
-#line 144 "_expander.re"
- {RET(0);}
-#line 741 "_expander.cc"
-yy177:
- yych = *++YYCURSOR;
- if (yych == 'P') goto yy179;
- if (yych == 'p') goto yy179;
-yy178:
- YYCURSOR = YYMARKER;
- goto yy173;
-yy179:
- yych = *++YYCURSOR;
- if (yych == 'R') goto yy180;
- if (yych != 'r') goto yy178;
-yy180:
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy181;
- if (yych != 'e') goto yy178;
-yy181:
- yych = *++YYCURSOR;
- if (yych != '>') goto yy178;
- ++YYCURSOR;
-#line 142 "_expander.re"
- {RET(5);}
-#line 763 "_expander.cc"
-}
-#line 145 "_expander.re"
-
-
-}
-
-
-PyObject *py_scan(PyObject *self, PyObject *args)
-{
- PyObject *arg1;
- if (!PyArg_ParseTuple(args, "O:_expander.scan", &arg1)) {
- return 0;
- }
- PyUnicodeObject *unistr = (PyUnicodeObject*)PyUnicode_FromObject(arg1);
- if (unistr == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "parameter cannot be converted to unicode in _expander.scan");
- return 0;
- }
-
- Py_UNICODE *start = unistr->str;
- Py_UNICODE *end = start+unistr->length;
-
-
- MacroScanner scanner (start, end);
- Py_BEGIN_ALLOW_THREADS
- while (scanner.scan()) {
- }
- Py_END_ALLOW_THREADS
- Py_XDECREF(unistr);
-
- // return PyList_New(0); // uncomment to see timings for scanning
-
- int size = scanner.tokens.size();
- PyObject *result = PyList_New(size);
- if (!result) {
- return 0;
- }
-
- for (int i=0; i<size; i++) {
- Token t = scanner.tokens[i];
- PyList_SET_ITEM(result, i, Py_BuildValue("iii", t.type, t.start, t.len));
- }
-
- return result;
-}
-
-
-
-static PyMethodDef module_functions[] = {
- {"scan", (PyCFunction)py_scan, METH_VARARGS, "scan(text)"},
- {0, 0},
-};
-
-
-
-extern "C" {
- DL_EXPORT(void) init_expander();
-}
-
-DL_EXPORT(void) init_expander()
-{
- /*PyObject *m =*/ Py_InitModule("_expander", module_functions);
-}
diff --git a/mwlib/_expander.re b/mwlib/_expander.re
deleted file mode 100644
index 7abb2ac..0000000
--- a/mwlib/_expander.re
+++ /dev/null
@@ -1,206 +0,0 @@
-// -*- mode: c++ -*-
-// Copyright (c) 2007-2008 PediaPress GmbH
-// See README.txt for additional licensing information.
-
-#include <Python.h>
-
-#include <iostream>
-#include <assert.h>
-#include <vector>
-
-using namespace std;
-
-#define RET(x) {found(x); return x;}
-
-struct Token
-{
- int type;
- int start;
- int len;
-};
-
-
-class MacroScanner
-{
-public:
-
- MacroScanner(Py_UNICODE *_start, Py_UNICODE *_end) {
- source = start = _start;
- end = _end;
- cursor = start;
- }
-
- int found(int val) {
- if (val==5 && tokens.size()) {
- Token &previous_token (tokens[tokens.size()-1]);
- if (previous_token.type==val) {
- previous_token.len += cursor-start;
- return tokens.size()-1;
- }
- }
- Token t;
- t.type = val;
- t.start = (start-source);
- t.len = cursor-start;
- tokens.push_back(t);
- return tokens.size()-1;
- }
-
- inline int scan();
-
- Py_UNICODE *source;
-
- Py_UNICODE *start;
- Py_UNICODE *cursor;
- Py_UNICODE *end;
- vector<Token> tokens;
-};
-
-
-int MacroScanner::scan()
-{
-
-std:
-
- start=cursor;
-
- Py_UNICODE *marker=cursor;
-
- Py_UNICODE *save_cursor = cursor;
-
-
-#define YYCTYPE Py_UNICODE
-#define YYCURSOR cursor
-#define YYMARKER marker
-#define YYLIMIT (end)
-// #define YYFILL(n) return 0;
-
-/*!re2c
-re2c:yyfill:enable = 0 ;
-*/
-
-
-
-/*!re2c
- "{"{2,} {RET(1);}
- "}"{2,} {RET(2);}
- "[[" | "]]" {RET(3);}
- "|" {RET(6);}
-
- '<noinclude>' {goto noinclude;}
- '<nowiki>' {goto nowiki;}
- '<imagemap' [^<>\000]* '>' {goto imagemap;}
- '<math' [^<>\000]* '>' {goto math;}
- '<gallery' [^<>\000]* '>' {goto gallery;}
-
- "<!--[^\000<>]*-->" {RET(5);}
-
- "\000" {RET(0);}
- [^\000] {RET(5);}
-
- */
-
-
-
-noinclude:
-/*!re2c
- '</noinclude>' {goto std;}
- [^\000] {goto noinclude;}
- "\000" {cursor=start+11; RET(5);}
- */
-
-nowiki:
-/*!re2c
- '</nowiki>' {RET(5);}
- [^\000] {goto nowiki;}
- "\000" {RET(0);}
- */
-
-math:
-/*!re2c
- '</math>' {RET(5);}
- [^\000] {goto math;}
- "\000" {RET(0);}
- */
-
-gallery:
-/*!re2c
- '</gallery>' {RET(5);}
- [^\000] {goto gallery;}
- "\000" {RET(0);}
- */
-
-imagemap:
-/*!re2c
- '</imagemap>' {RET(5);}
- [^\000] {goto imagemap;}
- "\000" {RET(0);}
- */
-
-pre:
-/*!re2c
- '</pre>' {RET(5);}
- [^\000] {goto pre;}
- "\000" {RET(0);}
- */
-
-}
-
-
-PyObject *py_scan(PyObject *self, PyObject *args)
-{
- PyObject *arg1;
- if (!PyArg_ParseTuple(args, "O:_expander.scan", &arg1)) {
- return 0;
- }
- PyUnicodeObject *unistr = (PyUnicodeObject*)PyUnicode_FromObject(arg1);
- if (unistr == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "parameter cannot be converted to unicode in _expander.scan");
- return 0;
- }
-
- Py_UNICODE *start = unistr->str;
- Py_UNICODE *end = start+unistr->length;
-
-
- MacroScanner scanner (start, end);
- Py_BEGIN_ALLOW_THREADS
- while (scanner.scan()) {
- }
- Py_END_ALLOW_THREADS
- Py_XDECREF(unistr);
-
- // return PyList_New(0); // uncomment to see timings for scanning
-
- int size = scanner.tokens.size();
- PyObject *result = PyList_New(size);
- if (!result) {
- return 0;
- }
-
- for (int i=0; i<size; i++) {
- Token t = scanner.tokens[i];
- PyList_SET_ITEM(result, i, Py_BuildValue("iii", t.type, t.start, t.len));
- }
-
- return result;
-}
-
-
-
-static PyMethodDef module_functions[] = {
- {"scan", (PyCFunction)py_scan, METH_VARARGS, "scan(text)"},
- {0, 0},
-};
-
-
-
-extern "C" {
- DL_EXPORT(void) init_expander();
-}
-
-DL_EXPORT(void) init_expander()
-{
- /*PyObject *m =*/ Py_InitModule("_expander", module_functions);
-}
diff --git a/mwlib/_expander.so b/mwlib/_expander.so
deleted file mode 100755
index be09917..0000000
--- a/mwlib/_expander.so
+++ /dev/null
Binary files differ
diff --git a/mwlib/_mwscan.cc b/mwlib/_mwscan.cc
deleted file mode 100644
index f673880..0000000
--- a/mwlib/_mwscan.cc
+++ /dev/null
@@ -1,1699 +0,0 @@
-/* Generated by re2c 0.13.4 */
-#line 1 "_mwscan.re"
-// -*- mode: c++ -*-
-// Copyright (c) 2007-2008 PediaPress GmbH
-// See README.txt for additional licensing information.
-
-#include <Python.h>
-
-#include <iostream>
-#include <assert.h>
-#include <vector>
-using namespace std;
-
-#define RET(x) {found(x); return x;}
-
-typedef enum {
- t_end,
- t_text,
- t_entity,
- t_special,
- t_magicword,
- t_comment,
- t_2box_open, // [[
- t_2box_close, // ]]
- t_http_url,
- t_break,
- t_begin_table,
- t_end_table,
- t_html_tag,
- t_style,
- t_pre,
- t_section,
- t_section_end,
- t_item,
- t_colon,
- t_semicolon,
- t_hrule,
- t_newline,
- t_column,
- t_row,
- t_tablecaption,
- t_urllink,
-} mwtok;
-
-struct Token
-{
- int type;
- int start;
- int len;
-};
-
-class Scanner
-{
-public:
-
- Scanner(Py_UNICODE *_start, Py_UNICODE *_end) {
- source = start = _start;
- end = _end;
- cursor = start;
- line_startswith_section = -1;
- tablemode=0;
- }
-
- int found(mwtok val) {
- if (val==t_text && tokens.size()) {
- Token &previous_token (tokens[tokens.size()-1]);
- if (previous_token.type==val) {
- previous_token.len += cursor-start;
- return tokens.size()-1;
- }
- }
- Token t;
- t.type = val;
- t.start = (start-source);
- t.len = cursor-start;
- tokens.push_back(t);
- return tokens.size()-1;
- }
-
- bool bol() const {
- return (start==source) || (start[-1]=='\n');
- }
-
- bool eol() const {
- return *cursor=='\n' || *cursor==0;
- }
-
- void newline() {
- if (line_startswith_section>=0) {
- tokens[line_startswith_section].type = t_text;
- }
- line_startswith_section = -1;
- }
-
- inline int scan();
-
- Py_UNICODE *source;
-
- Py_UNICODE *start;
- Py_UNICODE *cursor;
- Py_UNICODE *end;
- vector<Token> tokens;
-
- int line_startswith_section;
- int tablemode;
-};
-
-
-int Scanner::scan()
-{
- start=cursor;
-
- Py_UNICODE *marker=cursor;
-
- Py_UNICODE *save_cursor = cursor;
-
-
-#define YYCTYPE Py_UNICODE
-#define YYCURSOR cursor
-#define YYMARKER marker
-#define YYLIMIT (end)
-// #define YYFILL(n) return 0;
-
-#line 124 "_mwscan.re"
-
-
-/*
- the re2c manpage says:
- "The user must arrange for a sentinel token to appear at the end of input"
- \000 is our sentinel token.
-*/
-
-#line 157 "_mwscan.re"
-
- if (!bol()) {
- goto not_bol;
- }
-
-#line 140 "_mwscan.cc"
-{
- YYCTYPE yych;
- unsigned int yyaccept = 0;
-
- yych = *YYCURSOR;
- if (yych <= '-') {
- if (yych <= '"') {
- if (yych <= 0x001F) goto yy18;
- if (yych <= ' ') goto yy2;
- if (yych <= '!') goto yy8;
- goto yy18;
- } else {
- if (yych <= ')') {
- if (yych <= '#') goto yy13;
- goto yy18;
- } else {
- if (yych <= '*') goto yy13;
- if (yych <= ',') goto yy18;
- goto yy17;
- }
- }
- } else {
- if (yych <= '<') {
- if (yych <= '9') goto yy18;
- if (yych <= ':') goto yy11;
- if (yych <= ';') goto yy15;
- goto yy18;
- } else {
- if (yych <= 'z') {
- if (yych <= '=') goto yy9;
- goto yy18;
- } else {
- if (yych <= '{') goto yy4;
- if (yych <= '|') goto yy6;
- goto yy18;
- }
- }
- }
-yy2:
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= 0x001F) goto yy3;
- if (yych <= '!') goto yy47;
- if (yych <= 'z') goto yy3;
- if (yych <= '|') goto yy47;
-yy3:
-#line 199 "_mwscan.re"
- {RET(t_pre);}
-#line 189 "_mwscan.cc"
-yy4:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '|') goto yy43;
-yy5:
-#line 209 "_mwscan.re"
- {goto not_bol;}
-#line 196 "_mwscan.cc"
-yy6:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= ',') {
- if (yych == '+') goto yy35;
- } else {
- if (yych <= '-') goto yy38;
- if (yych == '}') goto yy41;
- }
-yy7:
-#line 177 "_mwscan.re"
- {
- if (tablemode)
- RET(t_column);
-
- if (*start==' ') {
- cursor = start+1;
- RET(t_pre);
- }
- RET(t_text);
- }
-#line 217 "_mwscan.cc"
-yy8:
- yych = *++YYCURSOR;
- goto yy7;
-yy9:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '=') goto yy33;
- goto yy32;
-yy10:
-#line 200 "_mwscan.re"
- {
- line_startswith_section = found(t_section);
- return t_section;
- }
-#line 231 "_mwscan.cc"
-yy11:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= ')') {
- if (yych == '#') goto yy27;
- } else {
- if (yych <= '*') goto yy27;
- if (yych == ':') goto yy29;
- }
-yy12:
-#line 205 "_mwscan.re"
- {RET(t_colon);}
-#line 243 "_mwscan.cc"
-yy13:
- ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy28;
-yy14:
-#line 204 "_mwscan.re"
- {RET(t_item);}
-#line 251 "_mwscan.cc"
-yy15:
- ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy26;
-yy16:
-#line 206 "_mwscan.re"
- {RET(t_semicolon);}
-#line 259 "_mwscan.cc"
-yy17:
- yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '-') goto yy19;
- goto yy5;
-yy18:
- yych = *++YYCURSOR;
- goto yy5;
-yy19:
- yych = *++YYCURSOR;
- if (yych == '-') goto yy21;
-yy20:
- YYCURSOR = YYMARKER;
- if (yyaccept <= 0) {
- goto yy3;
- } else {
- goto yy5;
- }
-yy21:
- yych = *++YYCURSOR;
- if (yych != '-') goto yy20;
-yy22:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych == '-') goto yy22;
-#line 207 "_mwscan.re"
- {RET(t_hrule);}
-#line 287 "_mwscan.cc"
-yy25:
- ++YYCURSOR;
- yych = *YYCURSOR;
-yy26:
- if (yych == ';') goto yy25;
- goto yy16;
-yy27:
- ++YYCURSOR;
- yych = *YYCURSOR;
-yy28:
- if (yych == '#') goto yy27;
- if (yych == '*') goto yy27;
- goto yy14;
-yy29:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= ')') {
- if (yych == '#') goto yy27;
- goto yy12;
- } else {
- if (yych <= '*') goto yy27;
- if (yych == ':') goto yy29;
- goto yy12;
- }
-yy31:
- ++YYCURSOR;
- yych = *YYCURSOR;
-yy32:
- if (yych == '\t') goto yy31;
- if (yych == ' ') goto yy31;
- goto yy10;
-yy33:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= 0x001F) {
- if (yych == '\t') goto yy31;
- goto yy10;
- } else {
- if (yych <= ' ') goto yy31;
- if (yych == '=') goto yy33;
- goto yy10;
- }
-yy35:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych == '+') goto yy35;
-#line 189 "_mwscan.re"
- {
- if (tablemode)
- RET(t_tablecaption);
- if (*start==' ') {
- cursor = start+1;
- RET(t_pre);
- }
- RET(t_text);
- }
-#line 344 "_mwscan.cc"
-yy38:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych == '-') goto yy38;
-#line 166 "_mwscan.re"
- {
- if (tablemode)
- RET(t_row);
- if (*start==' ') {
- cursor = start+1;
- RET(t_pre);
- }
- RET(t_text);
- }
-#line 359 "_mwscan.cc"
-yy41:
- ++YYCURSOR;
-#line 163 "_mwscan.re"
- {--tablemode; RET(t_end_table);}
-#line 364 "_mwscan.cc"
-yy43:
- ++YYCURSOR;
-#line 162 "_mwscan.re"
- {++tablemode; RET(t_begin_table);}
-#line 369 "_mwscan.cc"
-yy45:
- yych = *++YYCURSOR;
- if (yych <= ',') {
- if (yych == '+') goto yy35;
- goto yy7;
- } else {
- if (yych <= '-') goto yy38;
- if (yych == '}') goto yy41;
- goto yy7;
- }
-yy46:
- ++YYCURSOR;
- yych = *YYCURSOR;
-yy47:
- if (yych <= '!') {
- if (yych <= 0x001F) goto yy20;
- if (yych <= ' ') goto yy46;
- } else {
- if (yych <= 'z') goto yy20;
- if (yych <= '{') goto yy49;
- if (yych <= '|') goto yy45;
- goto yy20;
- }
- yych = *++YYCURSOR;
- goto yy7;
-yy49:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '|') goto yy43;
- goto yy20;
-}
-#line 210 "_mwscan.re"
-
-
-
-not_bol:
- cursor = save_cursor;
- marker = cursor;
-
-
-#line 409 "_mwscan.cc"
-{
- YYCTYPE yych;
- unsigned int yyaccept = 0;
- yych = *YYCURSOR;
- if (yych <= 'Z') {
- if (yych <= '\'') {
- if (yych <= ' ') {
- if (yych <= 0x0000) goto yy72;
- if (yych == '\n') goto yy63;
- goto yy74;
- } else {
- if (yych <= '!') goto yy66;
- if (yych <= '%') goto yy74;
- if (yych <= '&') goto yy71;
- goto yy69;
- }
- } else {
- if (yych <= ';') {
- if (yych <= '/') goto yy74;
- if (yych <= '9') goto yy59;
- if (yych <= ':') goto yy68;
- goto yy74;
- } else {
- if (yych <= '<') goto yy70;
- if (yych <= '=') goto yy61;
- if (yych <= '@') goto yy74;
- goto yy59;
- }
- }
- } else {
- if (yych <= 'f') {
- if (yych <= '^') {
- if (yych <= '[') goto yy52;
- if (yych == ']') goto yy60;
- goto yy74;
- } else {
- if (yych <= '_') goto yy58;
- if (yych <= '`') goto yy74;
- if (yych <= 'e') goto yy59;
- goto yy56;
- }
- } else {
- if (yych <= 'm') {
- if (yych == 'h') goto yy57;
- if (yych <= 'l') goto yy59;
- goto yy54;
- } else {
- if (yych <= 'z') goto yy59;
- if (yych == '|') goto yy65;
- goto yy74;
- }
- }
- }
-yy52:
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch (yych) {
- case '[': goto yy249;
- case 'f': goto yy252;
- case 'h': goto yy251;
- case 'm': goto yy253;
- default: goto yy53;
- }
-yy53:
-#line 256 "_mwscan.re"
- {RET(t_special);}
-#line 476 "_mwscan.cc"
-yy54:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == 'a') goto yy237;
- goto yy121;
-yy55:
-#line 225 "_mwscan.re"
- {RET(t_text);}
-#line 484 "_mwscan.cc"
-yy56:
- yych = *++YYCURSOR;
- if (yych == 't') goto yy229;
- goto yy121;
-yy57:
- yych = *++YYCURSOR;
- if (yych == 't') goto yy219;
- goto yy121;
-yy58:
- yych = *++YYCURSOR;
- if (yych == '_') goto yy122;
- goto yy121;
-yy59:
- yych = *++YYCURSOR;
- goto yy121;
-yy60:
- yych = *++YYCURSOR;
- if (yych == ']') goto yy118;
- goto yy53;
-yy61:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '=') goto yy116;
- goto yy115;
-yy62:
-#line 228 "_mwscan.re"
- {
- if (eol()) {
- if (line_startswith_section>=0) {
- line_startswith_section=-1;
- RET(t_section_end);
- } else {
- RET(t_text);
- }
- } else {
- RET(t_text);
- }
- }
-#line 522 "_mwscan.cc"
-yy63:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '\n') goto yy111;
-#line 241 "_mwscan.re"
- {newline(); RET(t_newline);}
-#line 528 "_mwscan.cc"
-yy65:
- yych = *++YYCURSOR;
- if (yych <= '*') {
- if (yych == '!') goto yy107;
- goto yy53;
- } else {
- if (yych <= '+') goto yy109;
- if (yych == '|') goto yy107;
- goto yy53;
- }
-yy66:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '!') goto yy107;
-yy67:
-#line 266 "_mwscan.re"
- {RET(t_text);}
-#line 545 "_mwscan.cc"
-yy68:
- yych = *++YYCURSOR;
- goto yy53;
-yy69:
- yych = *++YYCURSOR;
- if (yych == '\'') goto yy102;
- goto yy67;
-yy70:
- yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '/') {
- if (yych == '!') goto yy86;
- if (yych <= '.') goto yy67;
- goto yy87;
- } else {
- if (yych <= 'Z') {
- if (yych <= '@') goto yy67;
- goto yy88;
- } else {
- if (yych <= '`') goto yy67;
- if (yych <= 'z') goto yy88;
- goto yy67;
- }
- }
-yy71:
- yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '9') {
- if (yych == '#') goto yy75;
- if (yych <= '/') goto yy67;
- goto yy77;
- } else {
- if (yych <= 'Z') {
- if (yych <= '@') goto yy67;
- goto yy77;
- } else {
- if (yych <= '`') goto yy67;
- if (yych <= 'z') goto yy77;
- goto yy67;
- }
- }
-yy72:
- ++YYCURSOR;
-#line 265 "_mwscan.re"
- {newline(); return t_end;}
-#line 591 "_mwscan.cc"
-yy74:
- yych = *++YYCURSOR;
- goto yy67;
-yy75:
- yych = *++YYCURSOR;
- if (yych <= 'W') {
- if (yych <= '/') goto yy76;
- if (yych <= '9') goto yy82;
- } else {
- if (yych <= 'X') goto yy81;
- if (yych == 'x') goto yy81;
- }
-yy76:
- YYCURSOR = YYMARKER;
- if (yyaccept <= 1) {
- if (yyaccept <= 0) {
- goto yy53;
- } else {
- goto yy67;
- }
- } else {
- if (yyaccept <= 2) {
- goto yy103;
- } else {
- goto yy55;
- }
- }
-yy77:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= ';') {
- if (yych <= '/') goto yy76;
- if (yych <= '9') goto yy77;
- if (yych <= ':') goto yy76;
- } else {
- if (yych <= 'Z') {
- if (yych <= '@') goto yy76;
- goto yy77;
- } else {
- if (yych <= '`') goto yy76;
- if (yych <= 'z') goto yy77;
- goto yy76;
- }
- }
-yy79:
- ++YYCURSOR;
-#line 263 "_mwscan.re"
- {RET(t_entity);}
-#line 640 "_mwscan.cc"
-yy81:
- yych = *++YYCURSOR;
- if (yych == ';') goto yy76;
- goto yy85;
-yy82:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '/') goto yy76;
- if (yych <= '9') goto yy82;
- if (yych == ';') goto yy79;
- goto yy76;
-yy84:
- ++YYCURSOR;
- yych = *YYCURSOR;
-yy85:
- if (yych <= ';') {
- if (yych <= '/') goto yy76;
- if (yych <= '9') goto yy84;
- if (yych <= ':') goto yy76;
- goto yy79;
- } else {
- if (yych <= 'F') {
- if (yych <= '@') goto yy76;
- goto yy84;
- } else {
- if (yych <= '`') goto yy76;
- if (yych <= 'f') goto yy84;
- goto yy76;
- }
- }
-yy86:
- yych = *++YYCURSOR;
- if (yych == '-') goto yy94;
- goto yy76;
-yy87:
- yych = *++YYCURSOR;
- if (yych <= '@') goto yy76;
- if (yych <= 'Z') goto yy88;
- if (yych <= '`') goto yy76;
- if (yych >= '{') goto yy76;
-yy88:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '>') {
- if (yych <= ';') {
- if (yych <= 0x0000) goto yy76;
- } else {
- if (yych <= '<') goto yy76;
- if (yych >= '>') goto yy92;
- }
- } else {
- if (yych <= 'Z') {
- if (yych >= 'A') goto yy88;
- } else {
- if (yych <= '`') goto yy90;
- if (yych <= 'z') goto yy88;
- }
- }
-yy90:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '<') {
- if (yych <= 0x0000) goto yy76;
- if (yych <= ';') goto yy90;
- goto yy76;
- } else {
- if (yych != '>') goto yy90;
- }
-yy92:
- ++YYCURSOR;
-#line 259 "_mwscan.re"
- {RET(t_html_tag);}
-#line 713 "_mwscan.cc"
-yy94:
- yych = *++YYCURSOR;
- if (yych != '-') goto yy76;
-yy95:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= ';') {
- if (yych <= 0x0000) goto yy76;
- if (yych != '-') goto yy95;
- } else {
- if (yych == '=') goto yy95;
- if (yych <= '>') goto yy76;
- goto yy95;
- }
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= ';') {
- if (yych <= 0x0000) goto yy76;
- if (yych != '-') goto yy95;
- } else {
- if (yych == '=') goto yy95;
- if (yych <= '>') goto yy76;
- goto yy95;
- }
-yy98:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= ';') {
- if (yych <= 0x0000) goto yy76;
- if (yych == '-') goto yy98;
- goto yy95;
- } else {
- if (yych <= '<') goto yy76;
- if (yych != '>') goto yy95;
- }
- ++YYCURSOR;
-#line 262 "_mwscan.re"
- {RET(t_comment);}
-#line 752 "_mwscan.cc"
-yy102:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) == '\'') goto yy104;
-yy103:
-#line 257 "_mwscan.re"
- {RET(t_style);}
-#line 759 "_mwscan.cc"
-yy104:
- yyaccept = 2;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych != '\'') goto yy103;
- yych = *++YYCURSOR;
- if (yych != '\'') goto yy76;
- yych = *++YYCURSOR;
- goto yy103;
-yy107:
- ++YYCURSOR;
-#line 243 "_mwscan.re"
- {
- if (tablemode)
- RET(t_column);
- cursor = start+1;
- RET(t_special);
- }
-#line 777 "_mwscan.cc"
-yy109:
- ++YYCURSOR;
-#line 250 "_mwscan.re"
- {
- if (tablemode)
- RET(t_tablecaption);
- cursor = start+1;
- RET(t_special);
- }
-#line 787 "_mwscan.cc"
-yy111:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych == '\n') goto yy111;
-#line 240 "_mwscan.re"
- {newline(); RET(t_break);}
-#line 794 "_mwscan.cc"
-yy114:
- ++YYCURSOR;
- yych = *YYCURSOR;
-yy115:
- if (yych == '\t') goto yy114;
- if (yych == ' ') goto yy114;
- goto yy62;
-yy116:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= 0x001F) {
- if (yych == '\t') goto yy114;
- goto yy62;
- } else {
- if (yych <= ' ') goto yy114;
- if (yych == '=') goto yy116;
- goto yy62;
- }
-yy118:
- ++YYCURSOR;
-#line 227 "_mwscan.re"
- {RET(t_2box_close);}
-#line 817 "_mwscan.cc"
-yy120:
- ++YYCURSOR;
- yych = *YYCURSOR;
-yy121:
- if (yych <= 'Z') {
- if (yych <= '/') goto yy55;
- if (yych <= '9') goto yy120;
- if (yych <= '@') goto yy55;
- goto yy120;
- } else {
- if (yych <= '_') {
- if (yych <= '^') goto yy55;
- goto yy120;
- } else {
- if (yych <= '`') goto yy55;
- if (yych <= 'z') goto yy120;
- goto yy55;
- }
- }
-yy122:
- yych = *++YYCURSOR;
- switch (yych) {
- case 'E': goto yy126;
- case 'F': goto yy125;
- case 'N': goto yy124;
- case 'S': goto yy127;
- case 'T': goto yy123;
- default: goto yy121;
- }
-yy123:
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy216;
- goto yy121;
-yy124:
- yych = *++YYCURSOR;
- if (yych == 'E') goto yy146;
- if (yych == 'O') goto yy147;
- goto yy121;
-yy125:
- yych = *++YYCURSOR;
- if (yych == 'O') goto yy138;
- goto yy121;
-yy126:
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy135;
- goto yy121;
-yy127:
- yych = *++YYCURSOR;
- if (yych != 'T') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'A') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'R') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'T') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
-yy133:
- ++YYCURSOR;
- if ((yych = *YYCURSOR) <= 'Z') {
- if (yych <= '/') goto yy134;
- if (yych <= '9') goto yy120;
- if (yych >= 'A') goto yy120;
- } else {
- if (yych <= '_') {
- if (yych >= '_') goto yy120;
- } else {
- if (yych <= '`') goto yy134;
- if (yych <= 'z') goto yy120;
- }
- }
-yy134:
-#line 224 "_mwscan.re"
- {RET(t_magicword);}
-#line 894 "_mwscan.cc"
-yy135:
- yych = *++YYCURSOR;
- if (yych != 'D') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy138:
- yych = *++YYCURSOR;
- if (yych != 'R') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'C') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'E') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'T') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'O') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'C') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy146:
- yych = *++YYCURSOR;
- if (yych == 'W') goto yy203;
- goto yy121;
-yy147:
- yych = *++YYCURSOR;
- switch (yych) {
- case 'C': goto yy150;
- case 'E': goto yy149;
- case 'G': goto yy151;
- case 'T': goto yy148;
- default: goto yy121;
- }
-yy148:
- yych = *++YYCURSOR;
- if (yych <= 'H') {
- if (yych == 'C') goto yy186;
- goto yy121;
- } else {
- if (yych <= 'I') goto yy187;
- if (yych == 'O') goto yy188;
- goto yy121;
- }
-yy149:
- yych = *++YYCURSOR;
- if (yych == 'D') goto yy175;
- goto yy121;
-yy150:
- yych = *++YYCURSOR;
- if (yych == 'C') goto yy159;
- if (yych == 'O') goto yy160;
- goto yy121;
-yy151:
- yych = *++YYCURSOR;
- if (yych != 'A') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'L') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'L') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'E') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'R') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'Y') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy159:
- yych = *++YYCURSOR;
- if (yych == '_') goto yy174;
- goto yy121;
-yy160:
- yych = *++YYCURSOR;
- if (yych != 'N') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'T') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'E') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'N') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'T') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'C') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'O') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'N') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'V') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'E') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'R') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'T') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy174:
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy175:
- yych = *++YYCURSOR;
- if (yych != 'I') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'T') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'S') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'E') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'C') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'T') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'I') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'O') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'N') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy186:
- yych = *++YYCURSOR;
- if (yych == '_') goto yy202;
- goto yy121;
-yy187:
- yych = *++YYCURSOR;
- if (yych == 'T') goto yy191;
- goto yy121;
-yy188:
- yych = *++YYCURSOR;
- if (yych != 'C') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy191:
- yych = *++YYCURSOR;
- if (yych != 'L') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'E') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'C') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'O') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'N') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'V') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'E') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'R') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'T') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy202:
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy203:
- yych = *++YYCURSOR;
- if (yych != 'S') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'E') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'C') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'T') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'I') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'O') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'N') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'L') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'I') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'N') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'K') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy216:
- yych = *++YYCURSOR;
- if (yych != 'C') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '_') goto yy121;
- yych = *++YYCURSOR;
- if (yych == '_') goto yy133;
- goto yy121;
-yy219:
- yych = *++YYCURSOR;
- if (yych != 't') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'p') goto yy121;
- yyaccept = 3;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy223;
- if (yych != 's') goto yy121;
- yyaccept = 3;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych != ':') goto yy121;
-yy223:
- yych = *++YYCURSOR;
- if (yych != '/') goto yy76;
- yych = *++YYCURSOR;
- if (yych != '/') goto yy76;
- yych = *++YYCURSOR;
- if (yych <= '_') {
- if (yych <= ':') {
- if (yych <= '&') {
- if (yych == '#') goto yy226;
- if (yych <= '$') goto yy76;
- } else {
- if (yych <= '\'') goto yy76;
- if (yych == '*') goto yy76;
- }
- } else {
- if (yych <= '?') {
- if (yych == '=') goto yy226;
- if (yych <= '>') goto yy76;
- } else {
- if (yych <= '@') goto yy76;
- if (yych <= 'Z') goto yy226;
- if (yych <= '^') goto yy76;
- }
- }
- } else {
- if (yych <= 0x00D6) {
- if (yych <= '~') {
- if (yych <= '`') goto yy76;
- if (yych <= 'z') goto yy226;
- if (yych <= '}') goto yy76;
- } else {
- if (yych == 0x00C4) goto yy226;
- if (yych <= 0x00D5) goto yy76;
- }
- } else {
- if (yych <= 0x00E4) {
- if (yych == 0x00DC) goto yy226;
- if (yych <= 0x00E3) goto yy76;
- } else {
- if (yych <= 0x00F6) {
- if (yych <= 0x00F5) goto yy76;
- } else {
- if (yych != 0x00FC) goto yy76;
- }
- }
- }
- }
-yy226:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '_') {
- if (yych <= ':') {
- if (yych <= '&') {
- if (yych == '#') goto yy226;
- if (yych >= '%') goto yy226;
- } else {
- if (yych <= '\'') goto yy228;
- if (yych != '*') goto yy226;
- }
- } else {
- if (yych <= '?') {
- if (yych == '=') goto yy226;
- if (yych >= '?') goto yy226;
- } else {
- if (yych <= '@') goto yy228;
- if (yych <= 'Z') goto yy226;
- if (yych >= '_') goto yy226;
- }
- }
- } else {
- if (yych <= 0x00D6) {
- if (yych <= '~') {
- if (yych <= '`') goto yy228;
- if (yych <= 'z') goto yy226;
- if (yych >= '~') goto yy226;
- } else {
- if (yych == 0x00C4) goto yy226;
- if (yych >= 0x00D6) goto yy226;
- }
- } else {
- if (yych <= 0x00E4) {
- if (yych == 0x00DC) goto yy226;
- if (yych >= 0x00E4) goto yy226;
- } else {
- if (yych <= 0x00F6) {
- if (yych >= 0x00F6) goto yy226;
- } else {
- if (yych == 0x00FC) goto yy226;
- }
- }
- }
- }
-yy228:
-#line 223 "_mwscan.re"
- {RET(t_http_url);}
-#line 1221 "_mwscan.cc"
-yy229:
- yych = *++YYCURSOR;
- if (yych != 'p') goto yy121;
- yyaccept = 3;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych != ':') goto yy121;
- yych = *++YYCURSOR;
- if (yych != '/') goto yy76;
- yych = *++YYCURSOR;
- if (yych != '/') goto yy76;
- yych = *++YYCURSOR;
- if (yych <= '=') {
- if (yych <= '&') {
- if (yych <= '"') goto yy76;
- if (yych == '%') goto yy76;
- } else {
- if (yych <= '\'') goto yy76;
- if (yych <= ':') goto yy234;
- if (yych <= '<') goto yy76;
- }
- } else {
- if (yych <= '_') {
- if (yych <= '>') goto yy76;
- if (yych <= 'Z') goto yy234;
- if (yych <= '^') goto yy76;
- } else {
- if (yych <= '{') {
- if (yych <= '`') goto yy76;
- } else {
- if (yych <= '|') goto yy76;
- if (yych >= 0x007F) goto yy76;
- }
- }
- }
-yy234:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '=') {
- if (yych <= '&') {
- if (yych <= '"') goto yy236;
- if (yych != '%') goto yy234;
- } else {
- if (yych <= '\'') goto yy236;
- if (yych <= ':') goto yy234;
- if (yych >= '=') goto yy234;
- }
- } else {
- if (yych <= '_') {
- if (yych <= '>') goto yy236;
- if (yych <= 'Z') goto yy234;
- if (yych >= '_') goto yy234;
- } else {
- if (yych <= '{') {
- if (yych >= 'a') goto yy234;
- } else {
- if (yych <= '|') goto yy236;
- if (yych <= '~') goto yy234;
- }
- }
- }
-yy236:
-#line 221 "_mwscan.re"
- {RET(t_http_url);}
-#line 1285 "_mwscan.cc"
-yy237:
- yych = *++YYCURSOR;
- if (yych != 'i') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'l') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 't') goto yy121;
- yych = *++YYCURSOR;
- if (yych != 'o') goto yy121;
- yyaccept = 3;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych != ':') goto yy121;
- yych = *++YYCURSOR;
- if (yych == '@') goto yy76;
- goto yy244;
-yy243:
- ++YYCURSOR;
- yych = *YYCURSOR;
-yy244:
- if (yych <= '9') {
- if (yych <= '\'') {
- if (yych == '!') goto yy243;
- if (yych <= '"') goto yy76;
- goto yy243;
- } else {
- if (yych <= ')') goto yy76;
- if (yych == ',') goto yy76;
- goto yy243;
- }
- } else {
- if (yych <= '?') {
- if (yych == '=') goto yy243;
- if (yych <= '>') goto yy76;
- goto yy243;
- } else {
- if (yych <= 'Z') {
- if (yych >= 'A') goto yy243;
- } else {
- if (yych <= ']') goto yy76;
- if (yych <= '~') goto yy243;
- goto yy76;
- }
- }
- }
- yych = *++YYCURSOR;
- if (yych <= '@') {
- if (yych <= '.') {
- if (yych <= ',') goto yy76;
- } else {
- if (yych <= '/') goto yy76;
- if (yych >= ':') goto yy76;
- }
- } else {
- if (yych <= '_') {
- if (yych <= 'Z') goto yy246;
- if (yych <= '^') goto yy76;
- } else {
- if (yych <= '`') goto yy76;
- if (yych >= '{') goto yy76;
- }
- }
-yy246:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '@') {
- if (yych <= '.') {
- if (yych >= '-') goto yy246;
- } else {
- if (yych <= '/') goto yy248;
- if (yych <= '9') goto yy246;
- }
- } else {
- if (yych <= '_') {
- if (yych <= 'Z') goto yy246;
- if (yych >= '_') goto yy246;
- } else {
- if (yych <= '`') goto yy248;
- if (yych <= 'z') goto yy246;
- }
- }
-yy248:
-#line 219 "_mwscan.re"
- {RET(t_http_url);}
-#line 1369 "_mwscan.cc"
-yy249:
- ++YYCURSOR;
-#line 226 "_mwscan.re"
- {RET(t_2box_open);}
-#line 1374 "_mwscan.cc"
-yy251:
- yych = *++YYCURSOR;
- if (yych == 't') goto yy274;
- goto yy76;
-yy252:
- yych = *++YYCURSOR;
- if (yych == 't') goto yy266;
- goto yy76;
-yy253:
- yych = *++YYCURSOR;
- if (yych != 'a') goto yy76;
- yych = *++YYCURSOR;
- if (yych != 'i') goto yy76;
- yych = *++YYCURSOR;
- if (yych != 'l') goto yy76;
- yych = *++YYCURSOR;
- if (yych != 't') goto yy76;
- yych = *++YYCURSOR;
- if (yych != 'o') goto yy76;
- yych = *++YYCURSOR;
- if (yych != ':') goto yy76;
- yych = *++YYCURSOR;
- if (yych == '@') goto yy76;
- goto yy261;
-yy260:
- ++YYCURSOR;
- yych = *YYCURSOR;
-yy261:
- if (yych <= '9') {
- if (yych <= '\'') {
- if (yych == '!') goto yy260;
- if (yych <= '"') goto yy76;
- goto yy260;
- } else {
- if (yych <= ')') goto yy76;
- if (yych == ',') goto yy76;
- goto yy260;
- }
- } else {
- if (yych <= '?') {
- if (yych == '=') goto yy260;
- if (yych <= '>') goto yy76;
- goto yy260;
- } else {
- if (yych <= 'Z') {
- if (yych >= 'A') goto yy260;
- } else {
- if (yych <= ']') goto yy76;
- if (yych <= '~') goto yy260;
- goto yy76;
- }
- }
- }
- yych = *++YYCURSOR;
- if (yych <= '@') {
- if (yych <= '.') {
- if (yych <= ',') goto yy76;
- } else {
- if (yych <= '/') goto yy76;
- if (yych >= ':') goto yy76;
- }
- } else {
- if (yych <= '_') {
- if (yych <= 'Z') goto yy263;
- if (yych <= '^') goto yy76;
- } else {
- if (yych <= '`') goto yy76;
- if (yych >= '{') goto yy76;
- }
- }
-yy263:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '@') {
- if (yych <= '.') {
- if (yych >= '-') goto yy263;
- } else {
- if (yych <= '/') goto yy265;
- if (yych <= '9') goto yy263;
- }
- } else {
- if (yych <= '_') {
- if (yych <= 'Z') goto yy263;
- if (yych >= '_') goto yy263;
- } else {
- if (yych <= '`') goto yy265;
- if (yych <= 'z') goto yy263;
- }
- }
-yy265:
-#line 218 "_mwscan.re"
- {RET(t_urllink);}
-#line 1467 "_mwscan.cc"
-yy266:
- yych = *++YYCURSOR;
- if (yych != 'p') goto yy76;
- yych = *++YYCURSOR;
- if (yych != ':') goto yy76;
- yych = *++YYCURSOR;
- if (yych != '/') goto yy76;
- yych = *++YYCURSOR;
- if (yych != '/') goto yy76;
- yych = *++YYCURSOR;
- if (yych <= '=') {
- if (yych <= '&') {
- if (yych <= '"') goto yy76;
- if (yych == '%') goto yy76;
- } else {
- if (yych <= '\'') goto yy76;
- if (yych <= ':') goto yy271;
- if (yych <= '<') goto yy76;
- }
- } else {
- if (yych <= '_') {
- if (yych <= '>') goto yy76;
- if (yych <= 'Z') goto yy271;
- if (yych <= '^') goto yy76;
- } else {
- if (yych <= '{') {
- if (yych <= '`') goto yy76;
- } else {
- if (yych <= '|') goto yy76;
- if (yych >= 0x007F) goto yy76;
- }
- }
- }
-yy271:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '=') {
- if (yych <= '&') {
- if (yych <= '"') goto yy273;
- if (yych != '%') goto yy271;
- } else {
- if (yych <= '\'') goto yy273;
- if (yych <= ':') goto yy271;
- if (yych >= '=') goto yy271;
- }
- } else {
- if (yych <= '_') {
- if (yych <= '>') goto yy273;
- if (yych <= 'Z') goto yy271;
- if (yych >= '_') goto yy271;
- } else {
- if (yych <= '{') {
- if (yych >= 'a') goto yy271;
- } else {
- if (yych <= '|') goto yy273;
- if (yych <= '~') goto yy271;
- }
- }
- }
-yy273:
-#line 220 "_mwscan.re"
- {RET(t_urllink);}
-#line 1530 "_mwscan.cc"
-yy274:
- yych = *++YYCURSOR;
- if (yych != 't') goto yy76;
- yych = *++YYCURSOR;
- if (yych != 'p') goto yy76;
- yych = *++YYCURSOR;
- if (yych == ':') goto yy278;
- if (yych != 's') goto yy76;
- yych = *++YYCURSOR;
- if (yych != ':') goto yy76;
-yy278:
- yych = *++YYCURSOR;
- if (yych != '/') goto yy76;
- yych = *++YYCURSOR;
- if (yych != '/') goto yy76;
- yych = *++YYCURSOR;
- if (yych <= '_') {
- if (yych <= ':') {
- if (yych <= '&') {
- if (yych == '#') goto yy281;
- if (yych <= '$') goto yy76;
- } else {
- if (yych <= '\'') goto yy76;
- if (yych == '*') goto yy76;
- }
- } else {
- if (yych <= '?') {
- if (yych == '=') goto yy281;
- if (yych <= '>') goto yy76;
- } else {
- if (yych <= '@') goto yy76;
- if (yych <= 'Z') goto yy281;
- if (yych <= '^') goto yy76;
- }
- }
- } else {
- if (yych <= 0x00D6) {
- if (yych <= '~') {
- if (yych <= '`') goto yy76;
- if (yych <= 'z') goto yy281;
- if (yych <= '}') goto yy76;
- } else {
- if (yych == 0x00C4) goto yy281;
- if (yych <= 0x00D5) goto yy76;
- }
- } else {
- if (yych <= 0x00E4) {
- if (yych == 0x00DC) goto yy281;
- if (yych <= 0x00E3) goto yy76;
- } else {
- if (yych <= 0x00F6) {
- if (yych <= 0x00F5) goto yy76;
- } else {
- if (yych != 0x00FC) goto yy76;
- }
- }
- }
- }
-yy281:
- ++YYCURSOR;
- yych = *YYCURSOR;
- if (yych <= '_') {
- if (yych <= ':') {
- if (yych <= '&') {
- if (yych == '#') goto yy281;
- if (yych >= '%') goto yy281;
- } else {
- if (yych <= '\'') goto yy283;
- if (yych != '*') goto yy281;
- }
- } else {
- if (yych <= '?') {
- if (yych == '=') goto yy281;
- if (yych >= '?') goto yy281;
- } else {
- if (yych <= '@') goto yy283;
- if (yych <= 'Z') goto yy281;
- if (yych >= '_') goto yy281;
- }
- }
- } else {
- if (yych <= 0x00D6) {
- if (yych <= '~') {
- if (yych <= '`') goto yy283;
- if (yych <= 'z') goto yy281;
- if (yych >= '~') goto yy281;
- } else {
- if (yych == 0x00C4) goto yy281;
- if (yych >= 0x00D6) goto yy281;
- }
- } else {
- if (yych <= 0x00E4) {
- if (yych == 0x00DC) goto yy281;
- if (yych >= 0x00E4) goto yy281;
- } else {
- if (yych <= 0x00F6) {
- if (yych >= 0x00F6) goto yy281;
- } else {
- if (yych == 0x00FC) goto yy281;
- }
- }
- }
- }
-yy283:
-#line 222 "_mwscan.re"
- {RET(t_urllink);}
-#line 1637 "_mwscan.cc"
-}
-#line 267 "_mwscan.re"
-
-}
-
-
-PyObject *py_scan(PyObject *self, PyObject *args)
-{
- PyObject *arg1;
- if (!PyArg_ParseTuple(args, "O:mwscan.scan", &arg1)) {
- return 0;
- }
- PyUnicodeObject *unistr = (PyUnicodeObject*)PyUnicode_FromObject(arg1);
- if (unistr == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "parameter cannot be converted to unicode in mwscan.scan");
- return 0;
- }
-
- Py_UNICODE *start = unistr->str;
- Py_UNICODE *end = start+unistr->length;
-
-
- Scanner scanner (start, end);
- Py_BEGIN_ALLOW_THREADS
- while (scanner.scan()) {
- }
- Py_END_ALLOW_THREADS
- Py_XDECREF(unistr);
-
- // return PyList_New(0); // uncomment to see timings for scanning
-
- int size = scanner.tokens.size();
- PyObject *result = PyList_New(size);
- if (!result) {
- return 0;
- }
-
- for (int i=0; i<size; i++) {
- Token t = scanner.tokens[i];
- PyList_SET_ITEM(result, i, Py_BuildValue("iii", t.type, t.start, t.len));
- }
-
- return result;
-}
-
-
-
-static PyMethodDef module_functions[] = {
- {"scan", (PyCFunction)py_scan, METH_VARARGS, "scan(text)"},
- {0, 0},
-};
-
-
-
-extern "C" {
- DL_EXPORT(void) init_mwscan();
-}
-
-DL_EXPORT(void) init_mwscan()
-{
- /*PyObject *m =*/ Py_InitModule("_mwscan", module_functions);
-}
diff --git a/mwlib/_mwscan.re b/mwlib/_mwscan.re
deleted file mode 100644
index 99ffe95..0000000
--- a/mwlib/_mwscan.re
+++ /dev/null
@@ -1,327 +0,0 @@
-// -*- mode: c++ -*-
-// Copyright (c) 2007-2008 PediaPress GmbH
-// See README.txt for additional licensing information.
-
-#include <Python.h>
-
-#include <iostream>
-#include <assert.h>
-#include <vector>
-using namespace std;
-
-#define RET(x) {found(x); return x;}
-
-typedef enum {
- t_end,
- t_text,
- t_entity,
- t_special,
- t_magicword,
- t_comment,
- t_2box_open, // [[
- t_2box_close, // ]]
- t_http_url,
- t_break,
- t_begin_table,
- t_end_table,
- t_html_tag,
- t_style,
- t_pre,
- t_section,
- t_section_end,
- t_item,
- t_colon,
- t_semicolon,
- t_hrule,
- t_newline,
- t_column,
- t_row,
- t_tablecaption,
- t_urllink,
-} mwtok;
-
-struct Token
-{
- int type;
- int start;
- int len;
-};
-
-class Scanner
-{
-public:
-
- Scanner(Py_UNICODE *_start, Py_UNICODE *_end) {
- source = start = _start;
- end = _end;
- cursor = start;
- line_startswith_section = -1;
- tablemode=0;
- }
-
- int found(mwtok val) {
- if (val==t_text && tokens.size()) {
- Token &previous_token (tokens[tokens.size()-1]);
- if (previous_token.type==val) {
- previous_token.len += cursor-start;
- return tokens.size()-1;
- }
- }
- Token t;
- t.type = val;
- t.start = (start-source);
- t.len = cursor-start;
- tokens.push_back(t);
- return tokens.size()-1;
- }
-
- bool bol() const {
- return (start==source) || (start[-1]=='\n');
- }
-
- bool eol() const {
- return *cursor=='\n' || *cursor==0;
- }
-
- void newline() {
- if (line_startswith_section>=0) {
- tokens[line_startswith_section].type = t_text;
- }
- line_startswith_section = -1;
- }
-
- inline int scan();
-
- Py_UNICODE *source;
-
- Py_UNICODE *start;
- Py_UNICODE *cursor;
- Py_UNICODE *end;
- vector<Token> tokens;
-
- int line_startswith_section;
- int tablemode;
-};
-
-
-int Scanner::scan()
-{
- start=cursor;
-
- Py_UNICODE *marker=cursor;
-
- Py_UNICODE *save_cursor = cursor;
-
-
-#define YYCTYPE Py_UNICODE
-#define YYCURSOR cursor
-#define YYMARKER marker
-#define YYLIMIT (end)
-// #define YYFILL(n) return 0;
-
-/*!re2c
-re2c:yyfill:enable = 0 ;
-*/
-
-/*
- the re2c manpage says:
- "The user must arrange for a sentinel token to appear at the end of input"
- \000 is our sentinel token.
-*/
-
-/*!re2c
- any = [^\000];
- ftp = "ftp://" [-a-zA-Z0-9_+${}~?=/@#&*(),:.]+ ;
- mailto = "mailto:" [-a-zA-Z0-9_!#$%*./?|^{}`~&'+=]+ "@" [-a-zA-Z0-9_.]+ ;
- url = "http" "s"? "://" [-\xe4\xc4\xf6\xd6\xfc\xdca-zA-Z_0-9./?=&:%:~()#+,]+ ;
- entity_name = "&" [a-zA-Z0-9]+ ";";
- entity_hex = "&#" 'x' [a-fA-F0-9]+ ";";
- entity_dec = "&#" [0-9]+ ";";
-
- entity = (entity_name | entity_hex | entity_dec);
-
-
- magicword = ( "__TOC__"
- | "__NOTOC__"
- | "__FORCETOC__"
- | "__NOEDITSECTION__"
- | "__NEWSECTIONLINK__"
- | "__NOCONTENTCONVERT__"
- | "__NOCC__"
- | "__NOGALLERY__"
- | "__NOTITLECONVERT__"
- | "__NOTC__"
- | "__END__"
- | "__START__"
- );
-*/
- if (!bol()) {
- goto not_bol;
- }
-/*!re2c
- " "* "{|" {++tablemode; RET(t_begin_table);}
- " "* "|}" {--tablemode; RET(t_end_table);}
-
- " "* "|" "-"+
- {
- if (tablemode)
- RET(t_row);
- if (*start==' ') {
- cursor = start+1;
- RET(t_pre);
- }
- RET(t_text);
- }
-
- " "* ("|" | "!")
- {
- if (tablemode)
- RET(t_column);
-
- if (*start==' ') {
- cursor = start+1;
- RET(t_pre);
- }
- RET(t_text);
- }
-
- " "* "|" "+"+
- {
- if (tablemode)
- RET(t_tablecaption);
- if (*start==' ') {
- cursor = start+1;
- RET(t_pre);
- }
- RET(t_text);
- }
-
- " " {RET(t_pre);}
- "="+ [ \t]* {
- line_startswith_section = found(t_section);
- return t_section;
- }
- ":"* [#*]+ {RET(t_item);}
- ":"+ {RET(t_colon);}
- ";"+ {RET(t_semicolon);}
- "-"{4,} {RET(t_hrule);}
-
- [^] {goto not_bol;}
- */
-
-
-not_bol:
- cursor = save_cursor;
- marker = cursor;
-
-/*!re2c
- "[" mailto {RET(t_urllink);}
- mailto {RET(t_http_url);}
- "[" ftp {RET(t_urllink);}
- ftp {RET(t_http_url);}
- "[" url {RET(t_urllink);}
- url {RET(t_http_url);}
- magicword {RET(t_magicword);}
- [a-zA-Z0-9_]+ {RET(t_text);}
- "[[" {RET(t_2box_open);}
- "]]" {RET(t_2box_close);}
- "="+ [ \t]* {
- if (eol()) {
- if (line_startswith_section>=0) {
- line_startswith_section=-1;
- RET(t_section_end);
- } else {
- RET(t_text);
- }
- } else {
- RET(t_text);
- }
- }
- "\n"{2,} {newline(); RET(t_break);}
- "\n" {newline(); RET(t_newline);}
- "||" | "|!" | "!!"
- {
- if (tablemode)
- RET(t_column);
- cursor = start+1;
- RET(t_special);
- }
- "|+"
- {
- if (tablemode)
- RET(t_tablecaption);
- cursor = start+1;
- RET(t_special);
- }
- [:|\[\]] {RET(t_special);}
- "'''''" | "'''" | "''" {RET(t_style);}
- "<" "/"? [a-zA-Z]+ [^\000<>]* "/"? ">"
- {RET(t_html_tag);}
-
- "<!--"[^\000<>]*"-->"
- {RET(t_comment);}
- entity {RET(t_entity);}
-
- "\000" {newline(); return t_end;}
- . {RET(t_text);}
-*/
-}
-
-
-PyObject *py_scan(PyObject *self, PyObject *args)
-{
- PyObject *arg1;
- if (!PyArg_ParseTuple(args, "O:mwscan.scan", &arg1)) {
- return 0;
- }
- PyUnicodeObject *unistr = (PyUnicodeObject*)PyUnicode_FromObject(arg1);
- if (unistr == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "parameter cannot be converted to unicode in mwscan.scan");
- return 0;
- }
-
- Py_UNICODE *start = unistr->str;
- Py_UNICODE *end = start+unistr->length;
-
-
- Scanner scanner (start, end);
- Py_BEGIN_ALLOW_THREADS
- while (scanner.scan()) {
- }
- Py_END_ALLOW_THREADS
- Py_XDECREF(unistr);
-
- // return PyList_New(0); // uncomment to see timings for scanning
-
- int size = scanner.tokens.size();
- PyObject *result = PyList_New(size);
- if (!result) {
- return 0;
- }
-
- for (int i=0; i<size; i++) {
- Token t = scanner.tokens[i];
- PyList_SET_ITEM(result, i, Py_BuildValue("iii", t.type, t.start, t.len));
- }
-
- return result;
-}
-
-
-
-static PyMethodDef module_functions[] = {
- {"scan", (PyCFunction)py_scan, METH_VARARGS, "scan(text)"},
- {0, 0},
-};
-
-
-
-extern "C" {
- DL_EXPORT(void) init_mwscan();
-}
-
-DL_EXPORT(void) init_mwscan()
-{
- /*PyObject *m =*/ Py_InitModule("_mwscan", module_functions);
-}
diff --git a/mwlib/_mwscan.so b/mwlib/_mwscan.so
deleted file mode 100755
index 50feae0..0000000
--- a/mwlib/_mwscan.so
+++ /dev/null
Binary files differ
diff --git a/mwlib/_version.py b/mwlib/_version.py
deleted file mode 100644
index 9e73d4f..0000000
--- a/mwlib/_version.py
+++ /dev/null
@@ -1,9 +0,0 @@
-class _Version(tuple):
- """internal version object, subclass of C{tuple},
- but implements a fancier __str__ representation
- """
- def __str__(self):
- return '.'.join([str(x) for x in self])
-
-version = _Version((0,6,1))
-del _Version
diff --git a/mwlib/advtree.py b/mwlib/advtree.py
deleted file mode 100644
index 52d57e5..0000000
--- a/mwlib/advtree.py
+++ /dev/null
@@ -1,545 +0,0 @@
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-"""
-The parse tree generated by the parser is a 1:1 representation of the mw-markup.
-Unfortunally these trees have some flaws if used to geenerate derived documents.
-
-This module seeks to rebuild the parstree
-to be:
- * more logical markup
- * clean up the parse tree
- * make it more accessible
- * allow for validity checks
- * implement rebuilding strategies
-
-Usefull Documentation:
-http://en.wikipedia.org/wiki/Wikipedia:Don%27t_use_line_breaks
-http://meta.wikimedia.org/wiki/Help:Advanced_editing
-"""
-
-import weakref
-from mwlib.parser import Magic, Math, _VListNode, Ref, Link, URL, NamedURL # not used but imported
-from mwlib.parser import CategoryLink, SpecialLink, Caption, LangLink # not used but imported
-from mwlib.parser import Item, ItemList, Node, Table, Row, Cell, Paragraph, PreFormatted
-from mwlib.parser import Section, Style, TagNode, Text, Timeline
-from mwlib.parser import ImageLink, Article, Book, Chapter
-import copy
-from mwlib.log import Log
-
-log = Log("advtree")
-
-
-def _idIndex(lst, el):
- # return first appeareance of element in list
- for i, e in enumerate(lst):
- if e is el:
- return i
- return -1
-
-class AdvancedNode:
- """
- MixIn Class that extends Nodes so they become easier accessible
-
- allows to traverse the tree in any direction and
- build derived convinience functions
- """
- _parentref = None # weak referece to parent element
- isblocknode = False
-
- def copy(self):
- "return a copy of this node and all its children"
- n = copy.copy(self)
- n.children = []
- n._parentref = None
- for c in self:
- n.appendChild(c.copy())
- return n
-
-
- def moveto(self, targetnode, prefix=False):
- """
- moves this node after target node
- if prefix is true, move in front of target node
- """
- if self.parent:
- self.parent.removeChild(self)
- tp = targetnode.parent
- idx = _idIndex(tp.children, targetnode)
- if not prefix:
- idx+=1
- tp.children = tp.children[:idx] + [self] + tp.children[idx:]
- self._parentref = weakref.ref(tp)
-
- def appendChild(self, c):
- self.children.append(c)
- c._parentref = weakref.ref(self)
-
- def remove(self):
- if self.parent:
- for (idx, n) in enumerate(self.parent.children):
- if n is self:
- self.parent.children = self.parent.children[:idx] + self.parent.children[idx+1:]
- return 0
- else:
- return 1
-
- def removeChild(self, c):
- self.replaceChild(c, [])
-
- def replaceChild(self, c, newchildren = []):
- idx = _idIndex(self.children, c)
- self.children.remove(c)
- c._parentref = None
- if newchildren:
- self.children = self.children[:idx] + newchildren + self.children[idx:]
- for nc in newchildren:
- nc._parentref = weakref.ref(self)
-
- def getParents(self):
- if self.parent:
- return self.parent.getParents() + [self.parent]
- else:
- return []
-
- def getParent(self):
- if not self._parentref:
- return None
- x = self._parentref()
- if not x:
- raise weakref.ReferenceError
- return x
-
- def getLevel(self):
- "returns the number of nodes of same class in parents"
- return [p.__class__ for p in self.getParents()].count(self.__class__)
-
-
- def getParentNodesByClass(self, klass):
- "returns parents w/ klass"
- return [p for p in self.parents if p.__class__ == klass]
-
- def getChildNodesByClass(self, klass):
- "returns all children w/ klass"
- return [p for p in self.getAllChildren() if p.__class__ == klass]
-
- def getAllChildren(self):
- "don't confuse w/ Node.allchildren() which returns allchildren + self"
- for c in self.children:
- yield c
- for x in c.getAllChildren():
- yield x
-
- def getSiblings(self):
- return [c for c in self.getAllSiblings() if c is not self]
-
- def getAllSiblings(self):
- "all siblings plus me my self and i"
- if self.parent:
- return self.parent.children
- return []
-
- def getPrevious(self):
- "return previous sibling"
- s = self.getAllSiblings()
- try:
- idx = _idIndex(s,self)
- except ValueError:
- return None
- if idx -1 <0:
- return None
- else:
- return s[idx-1]
-
- def getNext(self):
- "return next sibling"
- s = self.getAllSiblings()
- try:
- idx = _idIndex(s,self)
- except ValueError:
- return None
- if idx+1 >= len(s):
- return None
- else:
- return s[idx+1]
-
- def getLast(self):
- "return last sibling"
- s = self.getAllSiblings()
- if s:
- return s[-1]
-
- def getFirst(self):
- "return first sibling"
- s = self.getAllSiblings()
- if s:
- return s[0]
-
- def getLastChild(self):
- "return last child of this node"
- if self.children:
- return self.children[-1]
-
- def getFirstChild(self):
- "return first child of this node"
- if self.children:
- return self.children[0]
-
- def getAllDisplayText(self, amap = None):
- "return all text that is intended for display"
- text = []
- if not amap:
- amap = {Text:"caption", Link:"target", URL:"caption", Math:"caption", ImageLink:"caption" }
- for n in self.allchildren():
- access = amap.get(n.__class__, "")
- if access:
- text.append( getattr(n, access) )
- alltext = [t for t in text if t]
- if alltext:
- return u''.join(alltext)
- else:
- return ''
-
- parent = property(getParent)
- parents = property(getParents)
- next = property(getNext)
- previous = property(getPrevious)
- siblings = property(getSiblings)
- last = property(getLast)
- first = property(getFirst)
- lastchild = property(getLastChild)
- firstchild = property(getFirstChild)
-
-
-
-# --------------------------------------------------------------------------
-# MixinClasses w/ special behaviour
-# -------------------------------------------------------------------------
-
-class AdvancedTable(AdvancedNode):
- @property
- def rows(self):
- return [r for r in self if r.__class__ == Row]
-
- @property
- def numcols(self):
- cols = [[n.__class__ for n in row].count(Cell) for row in self.rows]
- if cols:
- return max(cols)
- else:
- return 0
-
-class AdvancedRow(AdvancedNode):
- @property
- def cells(self):
- return [c for c in self if c.__class__ == Cell]
-
-
-class AdvancedSection(AdvancedNode):
- h_level = 0 # this is set if it originates from an H1, H2, ... TagNode
- def getSectionLevel(self):
- return 1 + self.getLevel()
-
-class AdvancedImageLink(AdvancedNode):
- isblocknode = property ( lambda s: not s.isInline() )
-
-class AdvancedMath(AdvancedNode):
- @property
- def isblocknode(self):
- if self.caption.strip().startswith("\\begin{align}") or \
- self.caption.strip().startswith("\\begin{alignat}"):
- return True
- return False
-
-
-
-# --------------------------------------------------------------------------
-# Missing as Classes derived from parser.Style
-# -------------------------------------------------------------------------
-
-
-class Emphasized(Style, AdvancedNode):
- "EM"
- pass
-
-class Strong(Style, AdvancedNode):
- pass
-
-class DefinitionList(Style, AdvancedNode):
- "DL"
- pass
-
-class DefinitionTerm(Style, AdvancedNode):
- "DT"
- pass
-
-class DefinitionDescription(Style, AdvancedNode):
- "DD"
- pass
-
-class Blockquote(Style, AdvancedNode):
- "margins to left & right"
- pass
-
-class Indented(Style, AdvancedNode):
- "margin to the left"
-
-class Overline(Style, AdvancedNode):
- _style = "overline"
-
-class Underline(Style, AdvancedNode):
- _style = "u"
-
-class Sub(Style, AdvancedNode):
- _style = "sub"
-
-class Sup(Style, AdvancedNode):
- _style = "sup"
-
-class Small(Style, AdvancedNode):
- _style = "small"
-
-class Big(Style, AdvancedNode):
- _style = "big"
-
-class Cite(Style, AdvancedNode):
- _style = "cite"
-
-
-_styleNodeMap = dict( (k._style,k) for k in [Overline, Underline, Sub, Sup, Small, Big, Cite] )
-
-# --------------------------------------------------------------------------
-# Missing as Classes derived from parser.TagNode
-# -------------------------------------------------------------------------
-
-class Source(TagNode, AdvancedNode):
- _tag = "source"
-
-class Code(TagNode, AdvancedNode):
- _tag = "code"
-
-class BreakingReturn(TagNode, AdvancedNode):
- _tag = "br"
-
-class HorizontalRule(TagNode, AdvancedNode):
- _tag = "hr"
-
-class Index(TagNode, AdvancedNode):
- _tag = "index"
-
-class Teletyped(TagNode, AdvancedNode):
- _tag = "tt"
-
-class Reference(TagNode, AdvancedNode):
- _tag = "ref"
-
-class ReferenceList(TagNode, AdvancedNode):
- _tag = "references"
-
-class Gallery(TagNode, AdvancedNode):
- _tag = "gallery"
-
-class Center(TagNode, AdvancedNode):
- _tag = "center"
-
-class Div(TagNode, AdvancedNode):
- _tag = "div"
-
-class Span(TagNode, AdvancedNode): # span is defined as inline node which is in theory correct.
- _tag = "span"
-
-class Strike(TagNode,AdvancedNode):
- _tag = "strike"
-
-class ImageMap(TagNode, AdvancedNode): # defined as block node, maybe incorrect
- _tag = "imagemap"
-
-_tagNodeMap = dict( (k._tag,k) for k in [Source, Code, BreakingReturn, HorizontalRule, Index, Teletyped, Reference, ReferenceList, Gallery, Center, Div, Span, Strike, ImageMap] )
-_styleNodeMap["s"] = Strike # Special Handling for deprecated s style
-
-
-# --------------------------------------------------------------------------
-# BlockNode separation for AdvancedNode.isblocknode
-# -------------------------------------------------------------------------
-
-"""
-For writers it is usefull to know whether elements are inline (within a paragraph) or not.
-We define list for blocknodes, which are used in AdvancedNode as:
-
-AdvancedNode.isblocknode
-
-Image depends on result of Image.isInline() see above
-
-Open Issues: Math, Magic, (unknown) TagNode
-
-"""
-_blockNodesMap = (Book, Chapter, Article, Section, Paragraph, Div,
- PreFormatted, Cell, Row, Table, Item, BreakingReturn,
- ItemList, Timeline, Cite, HorizontalRule, Gallery, Indented,
- DefinitionList, DefinitionTerm, DefinitionDescription, ReferenceList, Source)
-
-for k in _blockNodesMap:
- k.isblocknode = True
-
-
-
-# --------------------------------------------------------------------------
-# funcs for extending the nodes
-# -------------------------------------------------------------------------
-
-def MixIn(pyClass, mixInClass, makeFirst=False):
- if mixInClass not in pyClass.__bases__:
- if makeFirst:
- pyClass.__bases__ = (mixInClass,) + pyClass.__bases__
- else:
- pyClass.__bases__ += (mixInClass,)
-
-def extendClasses(node):
- for c in node.children[:]:
- extendClasses(c)
- c._parentref = weakref.ref(node)
-
-# Nodes we defined above and that are separetly handled in extendClasses
-_advancedNodesMap = {Section: AdvancedSection, ImageLink:AdvancedImageLink,
- Math:AdvancedMath, Row:AdvancedRow, Table:AdvancedTable}
-MixIn(Node, AdvancedNode)
-for k, v in _advancedNodesMap.items():
- MixIn(k,v)
-
-# --------------------------------------------------------------------------
-# funcs for repairing the tree
-# -------------------------------------------------------------------------
-
-
-def fixTagNodes(node):
- """
- detect known TagNode(s) and associate appropriate Nodes
- """
- for c in node.children:
- if c.__class__ == TagNode:
- if c.caption in _tagNodeMap:
- c.__class__ = _tagNodeMap[c.caption]
- elif c.caption in ("h1", "h2", "h3", "h4", "h5", "h6"): # FIXME
- # NEED TO MOVE NODE IF IT REALLY STARTS A SECTION
- c.__class__ = Section
- MixIn(c.__class__, AdvancedSection)
- c.level = int(c.caption[1])
- c.caption = ""
- else:
- log.warn("fixTagNodes, unknowntagnode %r" % c)
- #raise Exception, "unknown tag %s" % c.caption # FIXME
- fixTagNodes(c)
-
-
-def fixStyle(node):
- """
- parser.Style Nodes are mapped to logical markup
- detection of DefinitionList depends on removeNodes
- and removeNewlines
- """
- if not node.__class__ == Style:
- return
- # replace this node by a more apporiate
- if node.caption == "''":
- node.__class__ = Emphasized
- node.caption = ""
- elif node.caption=="'''''":
- node.__class__ = Strong
- node.caption = ""
- em = Emphasized("''")
- for c in node.children:
- em.appendChild(c)
- node.children = []
- node.appendChild(em)
- elif node.caption == "'''":
- node.__class__ = Strong
- node.caption = ""
- elif node.caption == ";":
- # this starts a definition list ? DL [DT->DD, ...]
- # check if previous node is DefinitionList, if not create one
- if node.previous.__class__ == DefinitionList:
- node.__class__ = DefinitionTerm
- node.moveto(node.previous.lastchild)
- else:
- node.__class__ = DefinitionList
- dt = DefinitionTerm()
- for c in node.children:
- dt.appendChild(c)
- node.children = []
- node.appendChild(dt)
- elif node.caption.startswith(":"):
- if node.previous.__class__ == DefinitionList:
- node.__class__ = DefinitionDescription
- node.moveto(node.previous.lastchild)
- node.caption = ""
- else:
- node.__class__ = Indented
- elif node.caption in _styleNodeMap:
- node.__class__ = _styleNodeMap[node.caption]
- node.caption = ""
- else:
- log.warn("fixStyle, unknownstyle %r" % node)
- #raise Exception, "unknown style %s" % node.caption # FIXME
- pass
- return node
-
-def fixStyles(node):
- if node.__class__ == Style:
- fixStyle(node)
- for c in node.children[:]:
- fixStyles(c)
-
-
-def removeNodes(node):
- """
- the parser generates empty Node elements that do
- nothing but group other nodes. we remove them here
- """
- if node.__class__ == Node:
- # first child of section groups heading text - grouping Node must not be removed
- if not (node.previous == None and node.parent.__class__ == Section):
- node.parent.replaceChild(node, node.children)
- for c in node.children[:]:
- removeNodes(c)
-
-def removeNewlines(node):
- """
- remove newlines, tabs, spaces if we are next to a blockNode
- """
- if node.__class__ == Text and not node.getParentNodesByClass(PreFormatted) and not node.getParentNodesByClass(Source):
- if node.caption.strip() == u"":
- prev = node.previous or node.parent # previous sibling node or parentnode
- next = node.next or node.parent.next
- if not next or next.isblocknode or not prev or prev.isblocknode:
- node.parent.removeChild(node)
- node.caption = node.caption.replace("\n", " ")
-
- for c in node.children[:]:
- removeNewlines(c)
-
-
-
-
-def buildAdvancedTree(root): # USE WITH CARE
- """
- extends and cleans parse trees
- do not use this funcs without knowing whether these
- Node modifications fit your problem
- """
- extendClasses(root)
- fixTagNodes(root)
- removeNodes(root)
- removeNewlines(root)
- fixStyles(root)
-
-def getAdvTree(fn):
- from mwlib.dummydb import DummyDB
- from mwlib.uparser import parseString
- db = DummyDB()
- input = unicode(open(fn).read(), 'utf8')
- r = parseString(title=fn, raw=input, wikidb=db)
- buildAdvancedTree(r)
- return r
-
-
-
diff --git a/mwlib/allnodes.py b/mwlib/allnodes.py
deleted file mode 100644
index ebd6d3b..0000000
--- a/mwlib/allnodes.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import mwlib.parser
-import mwlib.advtree
-
-import types
-
-def allnodes():
- all = set()
- names = set()
- for m in (mwlib.parser, mwlib.advtree):
- for x in dir(m):
- if x in names:
- continue
- k = getattr(m, x)
- if type(k) == types.TypeType:
- if issubclass(k, mwlib.parser.Node):
- all.add(k)
- names.add(x)
- return all
-
-
-if __name__ == '__main__':
- # EXAMPLE THAT SHOWS HOW TO IDENTIFY MISSING NODES
- from mwlib.parser import Control, Chapter
- my = set((Control, Chapter))
- missing = allnodes() - my
- assert len(missing) == len(allnodes()) -2
- #print missing
diff --git a/mwlib/apps.py b/mwlib/apps.py
deleted file mode 100644
index 55a427e..0000000
--- a/mwlib/apps.py
+++ /dev/null
@@ -1,378 +0,0 @@
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-"""main programs - installed via setuptools' entry_points"""
-
-import optparse
-
-def buildcdb():
- parser = optparse.OptionParser(usage="%prog --input XMLDUMP --output OUTPUT")
- parser.add_option("-i", "--input", help="input file")
- parser.add_option("-o", "--output", help="write output to OUTPUT")
- options, args = parser.parse_args()
-
- if args:
- parser.error("too many arguments.")
-
-
- input = options.input
- output = options.output
-
- if not (input and output):
- parser.error("missing argument.")
-
- import os
- from mwlib import cdbwiki
-
- cdbwiki.BuildWiki(input, output)()
- open(os.path.join(output, "wikiconf.txt"), "w").write("""
-[wiki]
-type = cdb
-path = %s
-
-[images]
-type = download
-url = http://upload.wikimedia.org/wikipedia/commons/
-localpath = ~/images
-""" % (os.path.abspath(output),))
-
-def show():
- parser = optparse.OptionParser(usage="%prog [-e|--expand] --conf CONF ARTICLE [...]")
- parser.add_option("-c", "--conf", help="config file")
- parser.add_option("-e", "--expand", action="store_true", help="expand templates")
- parser.add_option("-t", "--template", action="store_true", help="show template")
-
- options, args = parser.parse_args()
-
- if not args:
- parser.error("missing ARTICLE argument")
-
- articles = [unicode(x, 'utf-8') for x in args]
-
- conf = options.conf
- if not conf:
- parser.error("missing --conf argument")
-
- from mwlib import wiki, expander
-
- db = wiki.makewiki(conf)['wiki']
-
- for a in articles:
- if options.template:
- raw=db.getTemplate(a)
- else:
- raw=db.getRawArticle(a)
-
- if raw:
- if options.expand:
- te = expander.Expander(raw, pagename=a, wikidb=db)
- raw = te.expandTemplates()
-
- print raw.encode("utf-8")
-
-
-def buildzip():
- parser = optparse.OptionParser(usage="%prog [OPTIONS] [ARTICLE ...]")
- parser.add_option("-c", "--conf", help="config file (required unless --baseurl is given)")
- parser.add_option("-b", "--baseurl", help="base URL for mwapidb backend")
- parser.add_option("-s", "--shared-baseurl", help="base URL for shared images for mwapidb backend")
- parser.add_option("-m", "--metabook", help="JSON encoded text file with book structure")
- parser.add_option('--collectionpage', help='Title of a collection page')
- parser.add_option("-x", "--noimages", action="store_true", help="exclude images")
- parser.add_option("-o", "--output", help="write output to OUTPUT")
- parser.add_option("-p", "--posturl", help="http post to POSTURL")
- parser.add_option("-i", "--imagesize",
- help="max. pixel size (width or height) for images (default: 800)")
- parser.add_option("-d", "--daemonize", action="store_true",
- help='become daemon after collection articles (before POST request)')
- parser.add_option("-l", "--logfile", help="log to logfile")
- parser.add_option("--license", help="Title of article containing full license text")
- parser.add_option("--template-blacklist", help="Title of article containing blacklisted templates")
- options, args = parser.parse_args()
-
- import tempfile
- import os
- import zipfile
-
- from mwlib import utils
- from mwlib.utils import daemonize
-
- articles = [unicode(x, 'utf-8') for x in args]
-
- baseurl = options.baseurl
- conf = options.conf
- if not baseurl and not options.conf:
- parser.error("neither --conf nor --baseurl specified\nuse --help for all options")
-
- posturl = None
- def post_status(status):
- print 'status:', status
- if not posturl:
- return
- try:
- return urllib2.urlopen(posturl, urllib.urlencode({'status': status})).read()
- except Exception, e:
- print 'ERROR posting status %r to %r' % (status, posturl)
-
- def post_progress(progress):
- print 'progress', progress
- if not posturl:
- return
- try:
- return urllib2.urlopen(posturl, urllib.urlencode({'progress': int(progress)})).read()
- except Exception, e:
- print 'ERROR posting progress %r to %r' % (progress, posturl)
-
- try:
- if options.logfile:
- utils.start_logging(options.logfile)
-
- output = options.output
-
- from mwlib import wiki, recorddb, metabook
-
- mb = metabook.MetaBook()
- if conf:
- from ConfigParser import ConfigParser
-
- w = wiki.makewiki(conf)
- cp = ConfigParser()
- cp.read(conf)
- license = {
- 'name': cp.get('wiki', 'defaultarticlelicense')
- }
- if license['name'] is not None:
- license['wikitext'] = w['wiki'].getRawArticle(license['name'])
- mb.source = {
- 'name': cp.get('wiki', 'name'),
- 'url': cp.get('wiki', 'url'),
- 'defaultarticlelicense': license,
- }
- else:
- w = {
- 'wiki': wiki.wiki_mwapi(baseurl, options.license, options.template_blacklist),
- 'images': wiki.image_mwapi(baseurl, shared_base_url=options.shared_baseurl)
- }
- metadata = w['wiki'].getMetaData()
- mb.source = {
- 'name': metadata['name'],
- 'url': metadata['url'],
- 'defaultarticlelicense': metadata['license'],
- }
-
- if options.noimages:
- w['images'] = None
- else:
- if options.imagesize:
- imagesize = int(options.imagesize)
- else:
- imagesize = 800
-
- if output:
- zipfilename = output
- else:
- fd, zipfilename = tempfile.mkstemp()
- os.close(fd)
-
- if options.collectionpage:
- mwcollection = w['wiki'].getRawArticle(options.collectionpage)
- mb.loadCollectionPage(mwcollection)
- elif options.metabook:
- mb.readJsonFile(options.metabook)
-
- # do not daemonize earlier: Collection extension deletes input metabook file!
- if options.daemonize:
- daemonize()
-
- posturl = options.posturl
- if posturl:
- posturl = posturl.encode('utf-8')
-
- from mwlib.utils import get_multipart
- import urllib
- import urllib2
-
- zf = zipfile.ZipFile(zipfilename, 'w')
- z = recorddb.ZipfileCreator(zf, w['wiki'], w['images'])
-
- post_status('parsing')
-
- for x in articles:
- z.addArticle(x)
- mb.addArticles(articles)
-
- z.addObject('metabook.json', mb.dumpJson())
- articles = list(mb.getArticles())
- if articles:
- inc = 70/len(articles)
- else:
- inc = 0
- p = 0
- for title, revision in articles:
- post_progress(p)
- z.addArticle(title, revision=revision)
- p += inc
-
- post_status('packaging')
-
- if not options.noimages:
- z.writeImages(size=imagesize)
-
- post_progress(80)
-
- z.writeContent()
- zf.close()
-
- post_progress(90)
-
- if posturl:
- post_status('uploading')
- zf = open(zipfilename, "rb")
- ct, data = get_multipart('collection.zip', zf.read(), 'collection')
- zf.close()
- req = urllib2.Request(posturl, data=data, headers={"Content-Type": ct})
- result = urllib2.urlopen(req).read()
-
- if w['images']:
- w['images'].clear()
-
- if not output:
- os.unlink(zipfilename)
-
- post_status('finished')
- post_progress(100)
- except Exception, e:
- post_status('error')
- raise
-
-
-def parse():
- parser = optparse.OptionParser(usage="%prog [-a|--all] --conf CONF [ARTICLE1 ...]")
- parser.add_option("-a", "--all", action="store_true", help="parse all articles")
- parser.add_option("--tb", action="store_true", help="show traceback on error")
-
- parser.add_option("-c", "--conf", help="config file")
-
- options, args = parser.parse_args()
-
- if not args and not options.all:
- parser.error("missing option.")
-
- if not options.conf:
- parser.error("missing --conf argument")
-
- articles = [unicode(x, 'utf-8') for x in args]
-
- conf = options.conf
-
- import traceback
- from mwlib import wiki, uparser
-
- w = wiki.makewiki(conf)
-
- db = w['wiki']
-
- if options.all:
- if not hasattr(db, "articles"):
- raise RuntimeError("%s does not support iterating over all articles" % (db, ))
- articles = db.articles()
-
-
- import time
- for x in articles:
- try:
- raw = db.getRawArticle(x)
- # yes, raw can be None, when we have a redirect to a non-existing article.
- if raw is None:
- continue
- stime=time.time()
- a=uparser.parseString(x, raw=raw, wikidb=db)
- except Exception, err:
- print "F", repr(x), err
- if options.tb:
- traceback.print_exc()
- else:
- print "G", time.time()-stime, repr(x)
-
-def serve():
- parser = optparse.OptionParser(usage="%prog --conf CONF ARTICLE [...]")
- parser.add_option("-c", "--conf", help="config file")
-
- options, args = parser.parse_args()
-
-
- conf = options.conf
- if not options.conf:
- parser.error("missing --conf argument")
-
- from mwlib import wiki, web
-
- res = wiki.makewiki(conf)
- db = res['wiki']
- images = res['images']
- from wsgiref.simple_server import make_server, WSGIServer
-
- from SocketServer import ForkingMixIn
- class MyServer(ForkingMixIn, WSGIServer):
- pass
-
- iface, port = '0.0.0.0', 8080
- print "serving on %s:%s" % (iface, port)
- http = make_server(iface, port, web.Serve(db, res['images']), server_class=MyServer)
- http.serve_forever()
-
-
-
-def html():
- parser = optparse.OptionParser(usage="%prog --conf CONF ARTICLE [...]")
- parser.add_option("-c", "--conf", help="config file")
-
- options, args = parser.parse_args()
-
- if not args:
- parser.error("missing ARTICLE argument")
-
- articles = [unicode(x, 'utf-8') for x in args]
-
- conf = options.conf
- if not options.conf:
- parser.error("missing --conf argument")
-
- import StringIO
- import tempfile
- import os
- import webbrowser
- from mwlib import wiki, uparser, htmlwriter
-
- res = wiki.makewiki(conf)
- db = res['wiki']
- images = res['images']
-
- for a in articles:
- raw=db.getRawArticle(a)
- if not raw:
- continue
-
- out=StringIO.StringIO()
- out.write("""<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="content-type" content="text/html; charset="utf-8"></meta>
-<link rel="stylesheet" href="pedia.css" />
-</head>
-<body>
-
-""")
-
- a=uparser.parseString(x, raw=raw, wikidb=db)
- w=htmlwriter.HTMLWriter(out, images)
- w.write(a)
-
- fd, htmlfile = tempfile.mkstemp(".html")
- os.close(fd)
- open(htmlfile, "wb").write(out.getvalue().encode('utf-8'))
- webbrowser.open("file://"+htmlfile)
-
-
diff --git a/mwlib/caller.py b/mwlib/caller.py
deleted file mode 100755
index 583a123..0000000
--- a/mwlib/caller.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import sys
-import os
-
-def caller(n=2):
- """return caller as string"""
- f = sys._getframe(n)
- return "%s:%s" % (f.f_code.co_filename, f.f_lineno)
-
-def short(n=2):
- """return caller as string"""
- f = sys._getframe(n)
- return "%s:%s" % (os.path.basename(f.f_code.co_filename), f.f_lineno)
-
-def callerframe(n=2):
- return sys._getframe(n)
diff --git a/mwlib/cdb.py b/mwlib/cdb.py
deleted file mode 100755
index 9aa2a65..0000000
--- a/mwlib/cdb.py
+++ /dev/null
@@ -1,262 +0,0 @@
-#! /usr/bin/env python
-"""
-Dan Bernstein's CDB implemented in Python
-
-see http://cr.yp.to/cdb.html
-
-"""
-
-from __future__ import generators
-
-import os
-import struct
-import mmap
-
-def uint32_unpack(buf):
- return struct.unpack('<L', buf)[0]
-
-def uint32_pack(n):
- return struct.pack('<L', n)
-
-CDB_HASHSTART = 5381
-
-def cdb_hash(buf):
- h = CDB_HASHSTART
- for c in buf:
- h = (h + (h << 5)) & 0xffffffffL
- h ^= ord(c)
- return h
-
-class Cdb(object):
-
- def __init__(self, fp):
- self.fp = fp
- fd = fp.fileno()
- self.size = os.fstat(fd).st_size
- self.map = mmap.mmap(fd, self.size, access=mmap.ACCESS_READ)
- self.eod = uint32_unpack(self.map[:4])
- self.findstart()
- self.loop = 0 # number of hash slots searched under this key
- # initialized if loop is nonzero
- self.khash = 0
- self.hpos = 0
- self.hslots = 0
- # initialized if findnext() returns 1
- self.dpos = 0
- self.dlen = 0
-
- def close(self):
- self.map.close()
-
- def __iter__(self, fn=None):
- len = 2048
- while len < self.eod:
- klen, vlen = struct.unpack("<LL", self.map[len:len+8])
- len += 8
- key = self.map[len:len+klen]
- len += klen
- val = self.map[len:len+vlen]
- len += vlen
- if fn:
- yield fn(key, val)
- else:
- yield (key, val)
-
- def iteritems(self):
- return self.__iter__()
-
- def iterkeys(self):
- return self.__iter__(lambda k,v: k)
-
- def itervalues(self):
- return self.__iter__(lambda k,v: v)
-
- def items(self):
- ret = []
- for i in self.iteritems():
- ret.append(i)
- return ret
-
- def keys(self):
- ret = []
- for i in self.iterkeys():
- ret.append(i)
- return ret
-
- def values(self):
- ret = []
- for i in self.itervalues():
- ret.append(i)
- return ret
-
- def findstart(self):
- self.loop = 0
-
- def read(self, n, pos):
- # XXX add code for platforms without mmap
- return self.map[pos:pos+n]
-
- def match(self, key, pos):
- if key == self.read(len(key), pos):
- return 1
- else:
- return 0
-
- def findnext(self, key):
- if not self.loop:
- u = cdb_hash(key)
- buf = self.read(8, u << 3 & 2047)
- self.hslots = uint32_unpack(buf[4:])
- if not self.hslots:
- raise KeyError
- self.hpos = uint32_unpack(buf[:4])
- self.khash = u
- u >>= 8
- u %= self.hslots
- u <<= 3
- self.kpos = self.hpos + u
-
- while self.loop < self.hslots:
- buf = self.read(8, self.kpos)
- pos = uint32_unpack(buf[4:])
- if not pos:
- raise KeyError
- self.loop += 1
- self.kpos += 8
- if self.kpos == self.hpos + (self.hslots << 3):
- self.kpos = self.hpos
- u = uint32_unpack(buf[:4])
- if u == self.khash:
- buf = self.read(8, pos)
- u = uint32_unpack(buf[:4])
- if u == len(key):
- if self.match(key, pos + 8):
- dlen = uint32_unpack(buf[4:])
- dpos = pos + 8 + len(key)
- return self.read(dlen, dpos)
- raise KeyError
-
- def __getitem__(self, key):
- self.findstart()
- return self.findnext(key)
-
- def get(self, key, default=None):
- self.findstart()
- try:
- return self.findnext(key)
- except KeyError:
- return default
-
-def cdb_dump(infile):
- """dump a database in djb's cdbdump format"""
- db = Cdb(infile)
- for key,value in db.iteritems():
- print "+%d,%d:%s->%s" % (len(key), len(value), key, value)
- print
-
-def cdb_make(outfile, items):
- pos = 2048
- tables = {} # { h & 255 : [(h, p)] }
-
- # write keys and data
- outfile.seek(pos)
- for key, value in items:
- outfile.write(uint32_pack(len(key)) + uint32_pack(len(value)))
- h = cdb_hash(key)
- outfile.write(key)
- outfile.write(value)
- tables.setdefault(h & 255, []).append((h, pos))
- pos += 8 + len(key) + len(value)
-
- final = ''
- # write hash tables
- for i in range(256):
- entries = tables.get(i, [])
- nslots = 2*len(entries)
- final += uint32_pack(pos) + uint32_pack(nslots)
- null = (0, 0)
- table = [null] * nslots
- for h, p in entries:
- n = (h >> 8) % nslots
- while table[n] is not null:
- n = (n + 1) % nslots
- table[n] = (h, p)
- for h, p in table:
- outfile.write(uint32_pack(h) + uint32_pack(p))
- pos += 8
-
- # write header (pointers to tables and their lengths)
- outfile.flush()
- outfile.seek(0)
- outfile.write(final)
-
-class CdbMake(object):
- def __init__(self, outfile):
- self.pos = 2048
- self.outfile = outfile
- self.outfile.seek(self.pos)
- self.tables = {}
-
- def add(self, key, value):
- outfile = self.outfile
- outfile.write(uint32_pack(len(key)) + uint32_pack(len(value)))
- h = cdb_hash(key)
- outfile.write(key)
- outfile.write(value)
- self.tables.setdefault(h & 255, []).append((h, self.pos))
- self.pos += 8 + len(key) + len(value)
-
- def finish(self):
- final = ''
- tables = self.tables
- pos = self.pos
- outfile = self.outfile
-
- # write hash tables
- for i in range(256):
- entries = tables.get(i, [])
- nslots = 2*len(entries)
- final += uint32_pack(pos) + uint32_pack(nslots)
- null = (0, 0)
- table = [null] * nslots
- for h, p in entries:
- n = (h >> 8) % nslots
- while table[n] is not null:
- n = (n + 1) % nslots
- table[n] = (h, p)
- for h, p in table:
- outfile.write(uint32_pack(h) + uint32_pack(p))
- pos += 8
-
- # write header (pointers to tables and their lengths)
- outfile.flush()
- outfile.seek(0)
- outfile.write(final)
-
-
-def test():
- #db = Cdb(open("t"))
- #print db['one']
- #print db['two']
- #print db['foo']
- #print db['us']
- #print db.get('ec')
- #print db.get('notthere')
- db = open('test.cdb', 'wb')
- cdb_make(db,
- [('one', 'Hello'),
- ('two', 'Goodbye'),
- ('foo', 'Bar'),
- ('us', 'United States'),
- ])
- db.close()
- db = Cdb(open("test.cdb", 'rb'))
- print db['one']
- print db['two']
- print db['foo']
- print db['us']
- print db.get('ec')
- print db.get('notthere')
-
-if __name__ == '__main__':
- test()
diff --git a/mwlib/cdbwiki.py b/mwlib/cdbwiki.py
deleted file mode 100755
index 98bb6a7..0000000
--- a/mwlib/cdbwiki.py
+++ /dev/null
@@ -1,243 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import sys
-import os
-import zlib
-import re
-
-from mwlib import cdb
-
-try:
- from xml.etree import cElementTree
-except ImportError:
- import cElementTree
-
-ns = '{http://www.mediawiki.org/xml/export-0.3/}'
-
-wikiindex = "wikiidx"
-wikidata = "wikidata.bin"
-
-
-
-def normname(name):
- name = name.strip().replace("_", " ")
- name = name[:1].upper()+name[1:]
- return name
-
-class Tags:
- page = ns + 'page'
-
- # <title> inside <page>
- title = ns + 'title'
-
- # <revision> inside <page>
- revision = ns + 'revision'
-
- # <id> inside <revision>
- revid = ns + 'id'
-
- # <contributor><username> inside <revision>
- username = ns + 'contributor/' + ns + 'username'
-
- # <text> inside <revision>
- text = ns + 'text'
-
- # <timestamp> inside <revision>
- timestamp = ns + 'timestamp'
-
- # <revision><text> inside <page>
- revision_text = ns + 'revision/' + ns + 'text'
-
- siteinfo = ns + "siteinfo"
-
-class DumpParser(object):
- category_ns = set(['category', 'kategorie'])
- image_ns = set(['image', 'bild'])
- template_ns = set(['template', 'vorlage'])
- wikipedia_ns = set(['wikipedia'])
-
- tags = Tags()
-
-
- def __init__(self, xmlfilename):
- self.xmlfilename = xmlfilename
-
- def _write(self, msg):
- sys.stdout.write(msg)
- sys.stdout.flush()
-
- def openInputStream(self):
- if self.xmlfilename.lower().endswith(".bz2"):
- f = os.popen("bunzip2 -c %s" % self.xmlfilename, "r")
- elif self.xmlfilename.lower().endswith(".7z"):
- f = os.popen("7z -so x %s" % self.xmlfilename, "r")
- else:
- f = open(self.xmlfilename, "r")
-
- return f
-
- def __call__(self):
- f = self.openInputStream()
-
- count = 0
- for event, elem in cElementTree.iterparse(f):
- if elem.tag != self.tags.page:
- continue
- self.handlePageElement(elem)
- elem.clear()
- count += 1
-
- if count % 5000 == 0:
- self._write(" %s\n" % count)
- elif count % 100 == 0:
- self._write(".")
-
-
- def handlePageElement(self, page):
- title = page.find(self.tags.title).text
- revisions = page.findall(self.tags.revision)
- if not revisions:
- return
- revision = revisions[-1]
-
- texttag = revision.find(self.tags.text)
- timestamptag = revision.find(self.tags.timestamp)
- revision.clear()
-
- if texttag is not None:
- text = texttag.text
- texttag.clear()
- else:
- text = None
-
- if timestamptag is not None:
- timestamp = timestamptag.text
- timestamptag.clear()
- else:
- timestamp = None
-
- if not text:
- return
-
- if isinstance(title, str):
- title = unicode(title)
- if isinstance(text, str):
- text = unicode(text)
-
-
- if ':' in title:
- ns, rest = title.split(':', 1)
- ns = ns.lower()
- if ns not in self.template_ns:
- return
- self.handleTemplate(rest, text, timestamp)
- else:
- self.handleArticle(title, text, timestamp)
-
- def handleArticle(self, title, text, timestamp):
- print "ART:", repr(title), len(text), timestamp
-
- def handleTemplate(self, title, text, timestamp):
- print "TEMPL:", repr(title), len(text), timestamp
-
-class BuildWiki(DumpParser):
- def __init__(self, xmlfilename, outputdir):
- DumpParser.__init__(self, xmlfilename)
- self.outputdir = outputdir
-
- def __call__(self):
- if not os.path.exists(self.outputdir):
- os.makedirs(self.outputdir)
-
- n = os.path.join(self.outputdir, wikiindex)
- out = open(os.path.join(self.outputdir, wikidata), "wb")
- self.out = out
- f = open(n+'.cdb', 'wb')
- c = cdb.CdbMake(f)
- self.cdb = c
-
- DumpParser.__call__(self)
- c.finish()
- f.close()
-
-
- def _writeobj(self, key, val):
- key = key.encode("utf-8")
- val = zlib.compress(val)
- pos = self.out.tell()
- self.out.write(val)
- self.cdb.add(key, "%s %s" % (pos, len(val)))
-
- def handleArticle(self, title, text, timestamp):
- self._writeobj(u":"+title, text.encode("utf-8"))
-
- def handleTemplate(self, title, text, timestamp):
- self._writeobj(u"T:"+title, text.encode("utf-8"))
-
-
-
-class WikiDB(object):
- redirect_rex = re.compile(r'^#Redirect:?\s*?\[\[(?P<redirect>.*?)\]\]', re.IGNORECASE)
-
- def __init__(self, dir):
- self.dir = dir
- self.obj2pos_path = os.path.join(self.dir, wikidata)
- self.cdb = cdb.Cdb(open(os.path.join(self.dir, wikiindex+'.cdb'), 'rb'))
-
- def _readobj(self, key):
- key = key.encode("utf-8")
-
- try:
- data = self.cdb[key]
- except KeyError:
- return None
-
- pos, len = map(int, data.split())
-
- f=open(self.obj2pos_path, "rb")
- f.seek(pos)
- d=f.read(len)
- f.close()
- return zlib.decompress(d)
-
- def getRawArticle(self, title, raw=None, revision=None):
- title = normname(title)
- res = self._readobj(":"+title)
- if res is None:
- return None
-
- res = unicode(res, 'utf-8')
- mo = self.redirect_rex.search(res)
- if mo:
- redirect = mo.group('redirect')
- redirect = normname(redirect.split("|", 1)[0].split("#", 1)[0])
-
- return self.getRawArticle(redirect)
-
- return res
-
- def getTemplate(self, title, followRedirects=False):
- if ":" in title:
- title = title.split(':', 1)[1]
-
- title = normname(title)
- res = unicode(self._readobj(u"T:"+title) or "", 'utf-8')
- if not res:
- return res
-
- mo = self.redirect_rex.search(res)
- if mo:
- redirect = mo.group('redirect')
- redirect = normname(redirect.split("|", 1)[0].split("#", 1)[0])
- return self.getTemplate(redirect)
- return res
-
-
- def articles(self):
- for k, v in self.cdb:
- if k[0]==':':
- k = unicode(k[1:], "utf-8")
- yield k
diff --git a/mwlib/dummydb.py b/mwlib/dummydb.py
deleted file mode 100644
index e17a90f..0000000
--- a/mwlib/dummydb.py
+++ /dev/null
@@ -1,10 +0,0 @@
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-class DummyDB(object):
- def getRawArticle(self, name):
- return None
-
- def getTemplate(self, name, followRedirects=False):
- return None
diff --git a/mwlib/expander.py b/mwlib/expander.py
deleted file mode 100755
index 6298c7f..0000000
--- a/mwlib/expander.py
+++ /dev/null
@@ -1,587 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-from __future__ import with_statement
-import sys
-import re
-import os
-from mwlib import magics
-import mwlib.log
-
-DEBUG = "DEBUG_EXPANDER" in os.environ
-
-
-log = mwlib.log.Log("expander")
-
-splitpattern = """
-({{+) # opening braces
-|(}}+) # closing braces
-|(\[\[|\]\]) # link
-|((?:<noinclude>.*?</noinclude>)|(?:</?includeonly>)) # noinclude, comments: usually ignore
-|(?P<text>(?:<nowiki>.*?</nowiki>) # nowiki
-|(?:<math>.*?</math>)
-|(?:<imagemap[^<>]*>.*?</imagemap>)
-|(?:<gallery[^<>]*>.*?</gallery>)
-|(?:<source[^<>]*>.*?</source>)
-|(?:<pre.*?>.*?</pre>)
-|(?:=)
-|(?:[:\[\]\|{}<]) # all special characters
-|(?:[^=\[\]\|:{}<]*)) # all others
-"""
-
-splitrx = re.compile(splitpattern, re.VERBOSE | re.DOTALL | re.IGNORECASE)
-
-onlyincluderx = re.compile("<onlyinclude>(.*?)</onlyinclude>", re.DOTALL | re.IGNORECASE)
-
-commentrx = re.compile(r"(\n *)?<!--.*?-->( *\n)?", re.DOTALL)
-
-def remove_comments(txt):
- def repl(m):
- #print "M:", repr(txt[m.start():m.end()])
- if txt[m.start()]=='\n' and txt[m.end()-1]=='\n':
- return '\n'
- return (m.group(1) or "")+(m.group(2) or "")
- return commentrx.sub(repl, txt)
-
-def preprocess(txt):
- txt=txt.replace("\t", " ")
- txt=remove_comments(txt)
- return txt
-
-class symbols:
- bra_open = 1
- bra_close = 2
- link = 3
- noi = 4
- txt = 5
-
-def old_tokenize(txt):
- txt = preprocess(txt)
-
- if "<onlyinclude>" in txt:
- # if onlyinclude tags are used, only use text between those tags. template 'legend' is a example
- txt = "".join(onlyincluderx.findall(txt))
-
-
- tokens = []
- for (v1, v2, v3, v4, v5) in splitrx.findall(txt):
- if v5:
- tokens.append((5, v5))
- elif v4:
- tokens.append((4, v4))
- elif v3:
- tokens.append((3, v3))
- elif v2:
- tokens.append((2, v2))
- elif v1:
- tokens.append((1, v1))
-
- tokens.append((None, ''))
-
- return tokens
-
-
-def new_tokenize(txt):
- txt = preprocess(txt)
-
- import _expander
-
- if "<onlyinclude>" in txt:
- # if onlyinclude tags are used, only use text between those tags. template 'legend' is a example
- txt = "".join(onlyincluderx.findall(txt))
-
- txt=txt+u'\0'
- tokens = _expander.scan(txt)
-
- res = []
- for t in tokens:
- type,start,len=t
- if type:
- res.append((type, txt[start:start+len]))
- else:
- res.append((None, ''))
-
-
- return res
-
-tokenize = old_tokenize
-
-
-
-class Node(object):
- def __init__(self):
- self.children = []
-
- def __repr__(self):
- return "<%s %s children>" % (self.__class__.__name__, len(self.children))
-
- def __iter__(self):
- for x in self.children:
- yield x
-
- def show(self, out=None):
- show(self, out=out)
-
-class Variable(Node):
- pass
-
-class Template(Node):
- pass
-
-def show(node, indent=0, out=None):
- if out is None:
- out=sys.stdout
-
- out.write("%s%r\n" % (" "*indent, node))
- if isinstance(node, basestring):
- return
- for x in node.children:
- show(x, indent+1, out)
-
-def optimize(node):
- if isinstance(node, basestring):
- return node
-
- if type(node) is Node and len(node.children)==1:
- return optimize(node.children[0])
-
- for i, x in enumerate(node.children):
- node.children[i] = optimize(x)
- return node
-
-
-class Parser(object):
- template_ns = set([ ((5, u'Plantilla'), (5, u':')),
- ])
-
-
- def __init__(self, txt):
- self.txt = txt
- self.tokens = tokenize(txt)
- self.pos = 0
-
- def getToken(self):
- return self.tokens[self.pos]
-
- def setToken(self, tok):
- self.tokens[self.pos] = tok
-
-
- def variableFromChildren(self, children):
- v=Variable()
- name = Node()
- v.children.append(name)
-
- try:
- idx = children.index(u"|")
- except ValueError:
- name.children = children
- else:
- name.children = children[:idx]
- v.children.extend(children[idx+1:])
- return v
-
- def _eatBrace(self, num):
- ty, txt = self.getToken()
- assert ty == symbols.bra_close
- assert len(txt)>= num
- newlen = len(txt)-num
- if newlen==0:
- self.pos+=1
- return
-
- if newlen==1:
- ty = symbols.txt
-
- txt = txt[:newlen]
- self.setToken((ty, txt))
-
-
- def templateFromChildren(self, children):
- t=Template()
- # find the name
- name = Node()
- t.children.append(name)
- for idx, c in enumerate(children):
- if c==u'|':
- break
- name.children.append(c)
-
-
- # find the arguments
-
-
- arg = Node()
-
- linkcount = 0
- for idx, c in enumerate(children[idx+1:]):
- if c==u'[[':
- linkcount += 1
- elif c==']]':
- linkcount -= 1
- elif c==u'|' and linkcount==0:
- t.children.append(arg)
- arg = Node()
- continue
- arg.children.append(c)
-
-
- if arg.children:
- t.children.append(arg)
-
-
- return t
-
- def parseOpenBrace(self):
- ty, txt = self.getToken()
- n = Node()
-
- numbraces = len(txt)
- self.pos += 1
-
- while 1:
- ty, txt = self.getToken()
- if ty==symbols.bra_open:
- n.children.append(self.parseOpenBrace())
- elif ty is None:
- break
- elif ty==symbols.bra_close:
- closelen = len(txt)
- if closelen==2 or numbraces==2:
- t=self.templateFromChildren(n.children)
- n=Node()
- n.children.append(t)
- self._eatBrace(2)
- numbraces-=2
- else:
- v=self.variableFromChildren(n.children)
- n=Node()
- n.children.append(v)
- self._eatBrace(3)
- numbraces -= 3
-
- if numbraces==0:
- break
- elif numbraces==1:
- n.children.insert(0, "{")
- break
- elif ty==symbols.noi:
- self.pos += 1 # ignore <noinclude>
- else: # link, txt
- n.children.append(txt)
- self.pos += 1
-
- return n
-
- def parse(self):
- n = Node()
- while 1:
- ty, txt = self.getToken()
- if ty==symbols.bra_open:
- n.children.append(self.parseOpenBrace())
- elif ty is None:
- break
- elif ty==symbols.noi:
- self.pos += 1 # ignore <noinclude>
- else: # bra_close, link, txt
- n.children.append(txt)
- self.pos += 1
- return n
-
-def parse(txt):
- return optimize(Parser(txt).parse())
-
-class MemoryLimitError(Exception):
- pass
-
-class LazyArgument(object):
- def __init__(self, node, expander, variables):
- self.node = node
- self.expander = expander
- self._flatten = None
- self.variables = variables
- self._splitflatten = None
-
- def _flattennode(self, n):
- arg=[]
- self.expander.flatten(n, arg, self.variables)
- arg = u"".join(arg)
-
- if len(arg)>256*1024:
- raise MemoryLimitError("template argument too long: %s bytes" % (len(arg),))
- return arg
-
- def splitflatten(self):
- if self._splitflatten is None:
- try:
- idx = self.node.children.index(u'=')
- except ValueError:
- name = None
- val = self.node
- else:
- name = self.node
- val = Node()
- val.children[:] = self.node.children[idx+1:]
- oldchildren = self.node.children[:]
- del self.node.children[idx:]
-
- name = self._flattennode(name)
- self.node.children = oldchildren
-
- val = self._flattennode(val)
-
- self._splitflatten = name, val
- return self._splitflatten
-
- def flatten(self):
- if self._flatten is None:
- self._flatten = self._flattennode(self.node).strip()
- arg=[]
- self.expander.flatten(self.node, arg, self.variables)
-
- arg = u"".join(arg).strip()
- if len(arg)>256*1024:
- raise MemoryLimitError("template argument too long: %s bytes" % (len(arg),))
-
- self._flatten = arg
- return self._flatten
-
-class ArgumentList(object):
- class notfound: pass
-
- def __init__(self):
- self.args = []
- self.namedargs = {}
- def __repr__(self):
- return "<ARGLIST args=%r>" % ([x.flatten() for x in self.args],)
- def append(self, a):
- self.args.append(a)
-
- def get(self, n, default):
- return self.__getitem__(n) or default
-
- def __iter__(self):
- for x in self.args:
- yield x
-
- def __getslice__(self, i, j):
- for x in self.args[i:j]:
- yield x.flatten()
-
- def __len__(self):
- return len(self.args)
-
- def __getitem__(self, n):
- if isinstance(n, (int, long)):
- try:
- a=self.args[n]
- except IndexError:
- return u""
- return a.flatten()
-
- assert isinstance(n, basestring), "expected int or string"
-
- varcount=1
- if n not in self.namedargs:
- for x in self.args:
- name, val = x.splitflatten()
- if name is not None:
- name = name.strip()
- val = val.strip()
- self.namedargs[name] = val
- if n==name:
- return val
- else:
- name = str(varcount)
- varcount+=1
- self.namedargs[name] = val
-
- if n==name:
- return val
- self.namedargs[n] = u''
-
- val = self.namedargs[n]
-
- return val
-
-
-class Expander(object):
- def __init__(self, txt, pagename="", wikidb=None):
- assert wikidb is not None, "must supply wikidb argument in Expander.__init__"
- self.db = wikidb
- self.resolver = magics.MagicResolver(pagename=pagename)
- self.resolver.wikidb = wikidb
-
- self.parsed = Parser(txt).parse()
- #show(self.parsed)
- self.parsedTemplateCache = {}
-
- self.blacklist = set()
- with open("es_PE/template_blacklist", 'r') as f:
- for line in f.readlines():
- self.blacklist.add(line.rstrip().decode('utf8'))
-
- def getParsedTemplate(self, name):
- if name.startswith("[["):
- return None
-
- if name.startswith(":"):
- log.info("including article")
- raw = self.db.getRawArticle(name[1:])
- else:
- if len(name) > 1:
- name = name[0].capitalize() + name[1:]
- name = "Plantilla:" + name
- try:
- return self.parsedTemplateCache[name]
- except KeyError:
- pass
-
- # Check to see if this is a template in our blacklist --
- # one that we don't want to bother rendering.
- if name in self.blacklist:
- log.info("Skipping template " + name.encode('utf8'))
- raw = None
- else:
- raw = self.db.getTemplate(name, True)
-
- if raw is None:
- log.warn("no template", repr(name))
- res = None
- else:
- # add newline to templates starting with a (semi)colon, or tablemarkup
- # XXX what else? see test_implicit_newline in test_expander
- if raw.startswith(":") or raw.startswith(";") or raw.startswith("{|"):
- raw = '\n'+raw
-
- log.info("parsing template", repr(name))
- res = Parser(raw).parse()
- if DEBUG:
- print "TEMPLATE:", name, repr(raw)
- res.show()
-
- self.parsedTemplateCache[name] = res
- return res
-
-
- def flatten(self, n, res, variables):
- if isinstance(n, Template):
- name = []
- self.flatten(n.children[0], name, variables)
- name = u"".join(name).strip()
- if len(name)>256*1024:
- raise MemoryLimitError("template name too long: %s bytes" % (len(name),))
-
- remainder = None
- if ":" in name:
- try_name, try_remainder = name.split(':', 1)
- if self.resolver.has_magic(try_name):
- name=try_name
- remainder = try_remainder
-
- var = ArgumentList()
-
- varcount = 1 #unnamed vars
-
- def args():
- if remainder is not None:
- tmpnode=Node()
- tmpnode.children.append(remainder)
- yield tmpnode
- for x in n.children[1:]:
- yield x
-
- for x in args():
- var.append(LazyArgument(x, self, variables))
-
- rep = self.resolver(name, var)
-
- if rep is not None:
- res.append(rep)
- else:
- p = self.getParsedTemplate(name)
- if p:
- if DEBUG:
- msg = "EXPANDING %r %s ===> " % (name, var)
- oldidx = len(res)
- self.flatten(p, res, var)
-
- if DEBUG:
- msg += "".join(res[oldidx:])
- print msg
-
-
- elif isinstance(n, Variable):
- name = []
- self.flatten(n.children[0], name, variables)
- name = u"".join(name).strip()
- if len(name)>256*1024:
- raise MemoryLimitError("template name too long: %s bytes" % (len(name),))
-
- v = variables.get(name, None)
-
- if v is None:
- if len(n.children)>1:
- self.flatten(n.children[1:], res, variables)
- else:
- pass
- # FIXME. breaks If
- #res.append(u"{{{%s}}}" % (name,))
- else:
- res.append(v)
- else:
- for x in n:
- if isinstance(x, basestring):
- res.append(x)
- else:
- self.flatten(x, res, variables)
-
- def expandTemplates(self):
- res = []
- self.flatten(self.parsed, res, ArgumentList())
- return u"".join(res)
-
-
-class DictDB(object):
- """wikidb implementation used for testing"""
- def __init__(self, *args, **kw):
- if args:
- self.d, = args
- else:
- self.d = {}
-
- self.d.update(kw)
-
- normd = {}
- for k, v in self.d.items():
- normd[k.lower()] = v
- self.d = normd
-
- def getRawArticle(self, title):
- return self.d[title.lower()]
-
- def getTemplate(self, title, dummy):
- return self.d.get(title.lower(), u"")
-
-def expandstr(s, expected=None, wikidb=None):
- """debug function. expand templates in string s"""
- if wikidb:
- db = wikidb
- else:
- db = DictDB(dict(a=s))
-
- te = Expander(s, pagename="thispage", wikidb=db)
- res = te.expandTemplates()
- print "EXPAND: %r -> %r" % (s, res)
- if expected:
- assert res==expected, "expected %r, got %r" % (expected, res)
- return res
-
-if __name__=="__main__":
- #print splitrx.groupindex
- d=unicode(open(sys.argv[1]).read(), 'utf8')
- e = Expander(d)
- print e.expandTemplates()
diff --git a/mwlib/expr.py b/mwlib/expr.py
deleted file mode 100755
index fa11ce9..0000000
--- a/mwlib/expr.py
+++ /dev/null
@@ -1,222 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-# based on pyparsing example code (SimpleCalc.py)
-
-"""Implementation of mediawiki's #expr template.
-http://meta.wikimedia.org/wiki/ParserFunctions#.23expr:
-"""
-
-from __future__ import division
-
-import re
-import inspect
-import math
-
-class ExprError(Exception):
- pass
-
-def _myround(a,b):
- r=round(a, int(b))
- if int(r)==r:
- return int(r)
- return r
-
-
-pattern = """
-(?:\s+)
-|((?:(?:\d+)(?:\.\d+)?
- |(?:\.\d+)) (?:e(?:\+|-)?\d+)?)
-|(\+|-|\*|/|>=|<=|<>|!=|[a-zA-Z]+|.)
-"""
-
-rxpattern = re.compile(pattern, re.VERBOSE | re.DOTALL | re.IGNORECASE)
-def tokenize(s):
- res = []
- for (v1,v2) in rxpattern.findall(s):
- if not (v1 or v2):
- continue
- v2=v2.lower()
- if v2 in Expr.constants:
- res.append((v2,""))
- else:
- res.append((v1,v2))
- return res
-
- return [(v1,v2.lower()) for (v1,v2) in rxpattern.findall(s) if v1 or v2]
-
-class uminus: pass
-class uplus: pass
-
-precedence = {"(":-1, ")":-1}
-functions = {}
-
-def addop(op, prec, fun, numargs=None):
- precedence[op] = prec
- if numargs is None:
- numargs = len(inspect.getargspec(fun)[0])
-
-
- def wrap(stack):
- assert len(stack)>=numargs
- args = tuple(stack[-numargs:])
- del stack[-numargs:]
- stack.append(fun(*args))
-
- functions[op] = wrap
-
-a=addop
-a(uminus, 10, lambda x: -x)
-a(uplus, 10, lambda x: x)
-a("^", 10, math.pow, 2)
-a("not", 9, lambda x:int(not(bool(x))))
-a("abs", 9, abs, 1)
-a("sin", 9, math.sin, 1)
-a("cos", 9, math.cos, 1)
-a("asin", 9, math.asin, 1)
-a("acos", 9, math.acos, 1)
-a("tan", 9, math.tan, 1)
-a("atan", 9, math.atan, 1)
-a("exp", 9, math.exp, 1)
-a("ln", 9, math.log, 1)
-a("ceil", 9, lambda x: int(math.ceil(x)))
-a("floor", 9, lambda x: int(math.floor(x)))
-a("trunc", 9, long, 1)
-
-a("*", 8, lambda x,y: x*y)
-a("/", 8, lambda x,y: x/y)
-a("div", 8, lambda x,y: x/y)
-a("mod", 8, lambda x,y: int(x)%int(y))
-
-
-a("+", 6, lambda x,y: x+y)
-a("-", 6, lambda x,y: x-y)
-
-a("round", 5, _myround)
-
-a("<", 4, lambda x,y: int(x<y))
-a(">", 4, lambda x,y: int(x>y))
-a("<=", 4, lambda x,y: int(x<=y))
-a(">=", 4, lambda x,y: int(x>=y))
-a("!=", 4, lambda x,y: int(x!=y))
-a("<>", 4, lambda x,y: int(x!=y))
-a("=", 4, lambda x,y: int(x==y))
-
-a("and", 3, lambda x,y: int(bool(x) and bool(y)))
-a("or", 2, lambda x,y: int(bool(x) or bool(y)))
-del a
-
-class Expr(object):
- constants = dict(
- e=math.e,
- pi=math.pi)
-
- def as_float_or_int(self, s):
- try:
- return self.constants[s]
- except KeyError:
- pass
-
- if "." in s or "e" in s.lower():
- return float(s)
- return long(s)
-
- def output_operator(self, op):
- return functions[op](self.operand_stack)
-
- def output_operand(self, operand):
- self.operand_stack.append(operand)
-
- def parse_expr(self, s):
- tokens = tokenize(s)
- if not tokens:
- return ""
-
- self.operand_stack = []
- operator_stack = []
-
- seen_operand=False
-
- last_operand, last_operator = False, True
-
- for operand, operator in tokens:
- if operand:
- if last_operand:
- raise ExprError("expected operator")
- self.output_operand(self.as_float_or_int(operand))
- elif operator=="(":
- operator_stack.append("(")
- elif operator==")":
- while 1:
- if not operator_stack:
- raise ExprError("unbalanced parenthesis")
- t = operator_stack.pop()
- if t=="(":
- break
- self.output_operator(t)
- elif operator in precedence:
- if last_operator and last_operator!=")":
- if operator=='-':
- operator = uminus
- elif operator=='+':
- operator = uplus
-
- is_unary = operator in (uplus, uminus)
- prec = precedence[operator]
- while not is_unary and operator_stack and prec<=precedence[operator_stack[-1]]:
- p = operator_stack.pop()
- self.output_operator(p)
- operator_stack.append(operator)
- else:
- raise ExprError("unknown operator: %r" % (operator,))
-
- last_operand, last_operator = operand, operator
-
-
- while operator_stack:
- p=operator_stack.pop()
- if p=="(":
- raise ExprError("unbalanced parenthesis")
- self.output_operator(p)
-
- if len(self.operand_stack)!=1:
- raise ExprError("bad stack: %s" % (self.operand_stack,))
-
- return self.operand_stack[-1]
-
-def expr(s):
- return Expr().parse_expr(s)
-
-def main():
- ParseException = ExprError
- import time
- try:
- import readline # do not remove. makes raw_input use readline
- readline
- except ImportError:
- pass
-
- ep = expr
-
- while 1:
- input_string = raw_input("> ")
- if not input_string:
- continue
-
- stime = time.time()
- try:
- res=expr(input_string)
- except Exception, err:
- print "ERROR:", err
- import traceback
- traceback.print_exc()
-
- continue
- print res
- print time.time()-stime, "s"
-
-if __name__=='__main__':
- main()
-
-
diff --git a/mwlib/htmlwriter.py b/mwlib/htmlwriter.py
deleted file mode 100755
index a970c9c..0000000
--- a/mwlib/htmlwriter.py
+++ /dev/null
@@ -1,451 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import os
-from mwlib import parser, rendermath, timeline
-
-import urllib
-import cgi
-
-#from PIL import Image
-
-from mwlib.log import Log
-
-log = Log("htmlwriter")
-
-class HTMLWriter(object):
- imglevel = 0
- namedLinkCount = 1
- def __init__(self, out, images=None, math_renderer=None):
- self.out = out
- self.level = 0
- self.images = images
- # self.images = imgdb.ImageDB(os.path.expanduser("~/images"))
- self.references = []
- if math_renderer is None:
- self.math_renderer = rendermath.Renderer()
- else:
- self.math_renderer = math_renderer
-
- def _write(self, s):
- self.out.write(cgi.escape(s).encode('utf8'))
-
- def getCategoryList(self, obj):
- categories = list(set(c.target for c in obj.find(parser.CategoryLink)))
- categories.sort()
- return categories
-
- def write(self, obj):
- m = "write" + obj.__class__.__name__
- m=getattr(self, m)
- m(obj)
-
- def ignore(self, obj):
- pass
-
- def serializeVList(self,vlist):
- args = []
- styleArgs = []
- gotClass = 0
- gotExtraClass = 0
- for (key,value) in vlist.items():
- if isinstance(value, (basestring, int)):
- if key=="class":
- args.append('%s="%s"' % (key, value))
- gotClass = 1
- else:
- args.append('%s="%s"' % (key, value))
- if isinstance(value, dict) and key=="style":
- for (_key,_value) in value.items():
- styleArgs.append("%s:%s" % (_key, _value))
- args.append(' style="%s"' % ';'.join(styleArgs))
- gotExtraClass = 1
- return ' '.join(args)
-
-
- def writeMagic(self, m):
- if m.values.get('html'):
- for x in m.children:
- self.write(x)
-
- def writeCaption(self, obj):
- # todo- A table contained a Caption node, causing an exception in write.
- # Not sure what the HTML should be, if any.
- pass
-
- def writeSection(self, obj):
- header = "h%s" % (obj.level)
- self.out.write("<%s>" % header)
- self.write(obj.children[0])
- self.out.write("</%s>" % header)
-
- self.level += 1
- for x in obj.children[1:]:
- self.write(x)
- self.level -= 1
-
- def writePreFormatted(self, n):
- self.out.write("<pre>")
- for x in n:
- self.write(x)
- self.out.write("</pre>")
-
- def writeNode(self, n):
- for x in n:
- self.write(x)
-
- def writeCell(self, cell):
- svl = ""
- if cell.vlist:
- svl = self.serializeVList(cell.vlist)
-
- self.out.write('<td %s>' % svl)
- for x in cell:
- self.write(x)
- self.out.write("</td>")
-
- def writeTagNode(self, t):
- if t.caption == 'ref':
- self.references.append(t)
- self.out.write("<sup>%s</sup>" % len(self.references))
- return
- elif t.caption == 'references':
- if not self.references:
- return
-
- self.out.write("<ol>")
- for r in self.references:
- self.out.write("<li>")
- for x in r:
- self.write(x)
- self.out.write("</li>")
- self.out.write("</ol>")
-
- self.references = []
- return
- elif t.caption=='imagemap':
- # FIXME. this is not complete. t.imagemap.entries should also be handled.
- print "WRITEIMAGEMAP:", t.imagemap
- if t.imagemap.imagelink:
- self.write(t.imagemap.imagelink)
- return
-
-
- self.out.write(t.starttext.encode('utf8'))
- for x in t:
- self.write(x)
- self.out.write(t.endtext.encode('utf8'))
-
- def writeRow(self, row):
- self.out.write('<tr>')
- for x in row:
- self.write(x)
-
- self.out.write('</tr>')
-
- def writeTable(self, t):
- svl = ""
- if t.vlist:
- svl = self.serializeVList(t.vlist)
-
-
-
- self.out.write("<table %s>" % svl)
- if t.caption:
- self.out.write("<caption>")
- self.write(t.caption)
- self.out.write("<caption>")
- for x in t:
- self.write(x)
- self.out.write("</table>")
-
- def writeMath(self, obj):
- latex = obj.caption
- p = self.math_renderer.render(latex)
- self.out.write(p)
-
- def writeURL(self, obj):
- self.out.write('<a href="%s" class="offsite" ttid="externallink">' % obj.caption)
- if obj.children:
- for x in obj.children:
- self.write(x)
- else:
- self.out.write(obj.caption)
-
- self.out.write('&nbsp;<img src="/static/outgoing_link.gif" /></a>')
-
- def writeNamedURL(self, obj):
- self.out.write('<a href="%s" class="offsite" ttid="externallink">' % obj.caption)
- if obj.children:
- for x in obj.children:
- self.write(x)
- else:
- name = "[%s]" % self.namedLinkCount
- self.namedLinkCount += 1
- self.out.write(name)
-
- self.out.write('&nbsp;<img src="/static/outgoing_link.gif" /></a>')
-
-
- def writeParagraph(self, obj):
- self.out.write("\n<p>")
- for x in obj:
- self.write(x)
- self.out.write("</p>\n")
-
- def getHREF(self, obj):
- parts = obj.target.encode('utf-8').split('#')
- parts[0] = parts[0].replace(" ", "_")
-
-
- return '../%s/' % ("#".join([urllib.quote(x) for x in parts]))
-
- writeLangLink = ignore
-
- def writeLink(self, obj):
- if obj.target is None:
- return
-
- href = self.getHREF(obj)
- if href is not None:
- self.out.write('<a href="%s" class="normallink">' % (href,))
- else:
- self.out.write('<a class="deadlink">')
- if obj.children:
- for x in obj.children:
- self.write(x)
- else:
- self._write(obj.target)
-
- self.out.write("</a>")
-
- def writeSpecialLink(self, obj):
- if obj.children:
- for x in obj.children:
- self.write(x)
- else:
- self._write(obj.target)
-
- def writeCategoryLink(self, obj):
- if obj.colon:
- if obj.children:
- for x in obj.children:
- self.write(x)
- else:
- self._write(obj.target)
-
- def writeTimeline(self, obj):
- #img = timeline.drawTimeline(obj.caption)
- img = None
- if img is None:
- return
-
- target = "/timeline/"+os.path.basename(img)
- width, height = Image.open(img).size
-
- self.out.write('<img src="%s" width="%s" height="%s" />' % (target, width, height))
-
- def writeImageLink(self, obj):
- """
- <span class='image'>
- <span class='left'>
- <img src='bla' />
- <span class='imagecaption'>bla bla</span>
- <span/>
- <span/>
- """
-
- if self.images is None:
- return
-
- width = obj.width
- height = obj.height
-
- #if not width:
- # width = 400 # what could be a sensible default if no width is given? maybe better 0?
-
- if width:
- path = self.images.getPath(obj.target, size=max(width, height))
- url = self.images.getURL(obj.target, size=max(width, height))
- else:
- path = self.images.getPath(obj.target)
- url = self.images.getURL(obj.target)
-
- if url is None:
- return
-
- if isinstance(path, str):
- path = unicode(path, 'utf8')
-
- if self.imglevel==0:
- self.imglevel += 1
-
- # WTB: Added the ability to not specify width & height since images may not be found locally.
- # This may have to be redone eventually, perhaps we need a database of image dimensions,
- # but I doubt it. Besides, more hardcoded pathnames in 'getimg'?
- try:
- def getimg():
- return Image.open(path)
- img = None
-
- if not width:
- if not img:
- img = getimg()
- size = img.size
- width = min(400, size[0])
-
- if not height:
- if not img:
- img = getimg()
- size = img.size
- height = size[1]*width/size[0]
- except IOError, err:
- log.warn("Image.open failed:", err, "path=", repr(path))
- # WTB: Removed following return as images will not always be found locally.
- #self.imglevel -= 1
- #return
-
- attr = ''
- attr_css = ''
-
- if width:
- attr += "width='%d' " % width
- attr_css += "width:%dpx " % width
-
- if height:
- attr += "height='%d' " % height
- # WTB: Note- height not applied to CSS.
-
- if obj.isInline():
- self.out.write('<img src="%s" %s/>' % (url.encode("utf8"), attr.encode("utf8")))
- else:
- # WTB: This looked like a mistake to me, it was modifying obj.align instead of align.
- # This function should not modify obj at all.
- align = obj.align
- if obj.thumb == True and not align:
- align = "clear right"
- self.out.write('''<div class="bbotstyle image %s" style="%s">'''% (align, attr_css))
- self.out.write('<img src="%s" %s/>' % (url.encode("utf8"), attr.encode("utf8")))
-
- self.out.write('<span class="imagecaption">')
- for x in obj.children:
- self.write(x)
- self.out.write('</span></div>')
- self.imglevel -= 1
- else:
- self.out.write('<a href="%s">' % url)
- for x in obj.children:
- self.write(x)
- self.out.write('</a>')
-
- def writeText(self, t):
- #self.out.write(cgi.escape(t.caption).encode('ascii', 'xmlcharrefreplace'))
- self._write(t.caption)
-
- writeControl = writeText
-
- def writeArticle(self, a):
- if a.caption:
- self.out.write("<h1>")
- self._write(a.caption)
- self.out.write(' <font size="1">&middot; <a class="offsite" ')
- self.out.write('href="http://es.wikipedia.org/wiki/')
- self._write(a.caption)
- self.out.write('">De Wikipedia, la enciclopedia libre</a> ')
-
- # Report rendering problem.
- self.out.write('&middot; <a class="offsite" ')
- self.out.write('href="http://pullcord.laptop.org:8000/render?q=')
- self._write(a.caption)
- self.out.write('">Haz clic aquí si esta página contiene errores de presentación</a> ')
-
- # Report inappropriate content.
- self.out.write('&middot; <a class="offsite" ')
- self.out.write('href="http://pullcord.laptop.org:8000/report?q=')
- self._write(a.caption)
- self.out.write('">Esta página contiene material inapropiado</a>')
-
- self.out.write("</font>")
- self.out.write('</h1>')
-
- for x in a:
- self.write(x)
-
- self.out.write("\n<br/>")
-
- def writeStyle(self, s):
- if s.caption == "''":
- tag = 'em'
- elif s.caption=="'''''":
- self.out.write("<strong><em>")
- for x in s:
- self.write(x)
- self.out.write("</em></strong>")
- return
- elif s.caption == "'''":
- tag = 'strong'
- elif s.caption == ";":
- self.out.write("<div><strong>")
- for x in s:
- self.write(x)
- self.out.write("</strong></div>")
- return
-
- elif s.caption.startswith(":"):
- self.out.write("<blockquote>"*len(s.caption))
- for x in s:
- self.write(x)
- self.out.write("</blockquote>"*len(s.caption))
- return
- elif s.caption == "overline":
- self.out.write('<u style="text-decoration: overline;">')
- for x in s:
- self.write(x)
- self.out.write('</u>')
- return
- else:
- tag = s.caption
-
-
- self.out.write("<%s>" % tag)
- for x in s:
- self.write(x)
- self.out.write("</%s>" % tag)
-
- def writeItem(self, item):
- self.out.write("<li>")
- for x in item:
- self.write(x)
- self.out.write("</li>\n")
-
- def writeItemList(self, lst):
- if lst.numbered:
- tag = "ol"
- else:
- tag = "ul"
-
- self.out.write("<%s>" % tag)
-
- for x in lst:
- self.write(x)
- self.out.write("\n")
-
- self.out.write("</%s>" % tag)
-
-
-class NoLinksWriter(HTMLWriter):
- """Subclass that ignores (non-outgoing) links"""
-
- def writeLink(self, obj):
- if obj.target is None:
- return
-
- if obj.children:
- for x in obj.children:
- self.write(x)
- else:
- self._write(obj.target)
-
diff --git a/mwlib/imgmap.py b/mwlib/imgmap.py
deleted file mode 100755
index 80bb826..0000000
--- a/mwlib/imgmap.py
+++ /dev/null
@@ -1,122 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-from pyparsing import (Literal, restOfLine, Word, nums, Group,
- ZeroOrMore, OneOrMore, And, Suppress, LineStart,
- LineEnd, StringEnd, ParseException, Optional, White)
-
-class gob(object):
- def __init__(self, **kw):
- self.__dict__.update(kw)
-
- def __repr__(self):
- return "<%s %r>" % (self.__class__.__name__, self.__dict__)
-
-class Poly(gob): pass
-class Rect(gob): pass
-class Circle(gob): pass
-class Comment(gob): pass
-class Desc(gob): pass
-class Default(gob): pass
-class ImageMap(gob): pass
-
-def _makepoly(tokens):
- return Poly(caption=tokens[2].strip(), vertices=list(tokens[1]))
-
-def _makerect(tokens):
- return Rect(caption=tokens[-1].strip(), top_left=tuple(tokens[1]), bottom_right=tuple(tokens[2]))
-
-def _makecomment(tokens):
- return Comment(comment=tokens[1])
-
-def _makecircle(tokens):
- return Circle(caption=tokens[3].strip(), center=tokens[1], radius=tokens[2])
-
-def _makedesc(tokens):
- return Desc(location=tokens[1])
-
-def _makeimagemap(tokens):
- image = None
- for x in tokens:
- if isinstance(x, basestring):
- image = x
- break
- return ImageMap(entries=list(tokens), image=image)
-
-
-comment = (Literal('#')+restOfLine).setParseAction(_makecomment)
-
-integer = Word(nums).setParseAction(lambda s: int(s[0]))
-integer_pair = (integer+integer).setParseAction(lambda x: tuple(x))
-
-poly = Literal("poly")+Group(ZeroOrMore(integer_pair))+restOfLine
-poly = poly.setParseAction(_makepoly)
-
-rect = Literal("rect")+integer_pair+integer_pair+restOfLine
-rect = rect.setParseAction(_makerect)
-
-circle = Literal("circle")+integer_pair+integer+restOfLine
-circle = circle.setParseAction(_makecircle)
-
-desc = Literal("desc") + (Literal("top-right")
- |Literal("bottom-right")
- |Literal("bottom-left")
- |Literal("top-left")
- |Literal("none"))
-desc = desc.setParseAction(_makedesc)
-default = Literal("default")+restOfLine
-default.setParseAction(lambda t: Default(caption=t[1].strip()))
-
-
-def _makeother(tokens):
- if not tokens[0]:
- return [None]
- return tokens
-
-# we can't use restOfLine.setParseAction(_makeother) as that sets the
-# parse action for any occurence of restOfLine
-
-other = And([restOfLine]).setParseAction(_makeother)
-line = Suppress(LineStart()) + (comment | poly | rect | circle | desc | default | other) + Suppress(LineEnd())
-imagemap = ZeroOrMore(line) + StringEnd()
-imagemap.setParseAction(_makeimagemap)
-
-def ImageMapFromString(s):
- # uhh. damn. can't get pyparsing to parse
- # commands, other lines (i.e. syntax errors strictly speaking)
- # and lines containing only whitespace...
- lines = []
- for x in s.split("\n"):
- x=x.strip()
- if x:
- lines.append(x)
- s="\n".join(lines)
-
- try:
- return imagemap.parseString(s)[0]
- except ParseException, err:
- return ImageMap(entries=[], image=None)
-
-def main():
- ex="""
-
-
-Image:Foo.jpg|200px|picture of a foo
-poly 131 45 213 41 210 110 127 109 [[Display]]
-poly 104 126 105 171 269 162 267 124 [[Keyboard]]
-rect 15 95 94 176 [[Foo type A]]
-# A comment, this line is ignored
-circle 57 57 20 [[Foo type B]]
-desc bottom-left
-default [[Mainz]]
----dfg-sdfg--sdfg
-blubb
-"""
- res = ImageMapFromString(ex)
- for x in res.entries:
- print x
-
-if __name__=='__main__':
- main()
diff --git a/mwlib/lang.py b/mwlib/lang.py
deleted file mode 100755
index ca122a0..0000000
--- a/mwlib/lang.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import os
-languages = set(open(os.path.join(os.path.dirname(__file__), 'lang.txt')).read().split())
-
-
-
diff --git a/mwlib/lang.txt b/mwlib/lang.txt
deleted file mode 100644
index eaf52e3..0000000
--- a/mwlib/lang.txt
+++ /dev/null
@@ -1,256 +0,0 @@
-af
-als
-am
-an
-ang
-ar
-ast
-az
-ba
-bcl
-be
-bg
-bm
-bn
-bo
-br
-bs
-ca
-ceb
-chr
-crh
-co
-cs
-csb
-cv
-cy
-da
-de
-el
-dsb
-en
-eo
-es
-et
-eu
-fa
-fi
-fiu-vro
-fo
-fr
-frp
-fur
-fy
-ga
-gd
-gl
-gn
-gu
-he
-hi
-hr
-ht
-hu
-hy
-ia
-id
-ie
-ilo
-io
-is
-it
-iu
-ja
-jbo
-jv
-ka
-kg
-km
-kn
-ko
-ks
-ksh
-ku
-kw
-ky
-la
-lad
-lb
-li
-ln
-lt
-lv
-mg
-mi
-mk
-ml
-mo
-mr
-ms
-mt
-my
-na
-nah
-nap
-nb
-nds
-nds-nl
-ng
-nl
-nn
-no
-nrm
-nv
-oc
-os
-pam
-pap
-pdc
-pl
-ps
-pt
-rm
-ro
-roa-rup
-ru
-sa
-sc
-scn
-sco
-se
-sh
-si
-simple
-sk
-sl
-sm
-so
-sq
-sr
-st
-su
-sv
-sw
-ta
-te
-th
-tk
-tl
-to
-tpi
-tr
-tt
-ug
-uk
-ur
-vec
-vi
-vo
-wa
-war
-yi
-za
-zh
-zh-min-nan
-zh-yue
-pms
-dv
-got
-haw
-wo
-tet
-qu
-lmo
-be-x-old
-hsb
-pag
-bat-smg
-bpy
-lij
-udm
-nov
-cbk-zam
-arc
-kab
-ru-sib
-diq
-gv
-zea
-wuu
-cdo
-lg
-hak
-ty
-lo
-tn
-ti
-tg
-dk
-yo
-dz
-vls
-bar
-eml
-bxr
-ee
-rmy
-eve
-zu
-rw
-new
-rn
-xal
-bh
-bi
-wp
-om
-glk
-tw
-or
-aa
-xh
-ch
-ce
-cr
-fj
-cu
-zh-tw
-pa
-chy
-pi
-hz
-ho
-bug
-uz
-mn
-ik
-ss
-kj
-bet
-pih
-ab
-ve
-ak
-ii
-as
-av
-ay
-ig
-nan
-zh-min-nan
-ne
-ny
-sn
-ff
-mh
-mzn
-kk
-ki
-kl
-kv
-sg
-sd
-roa-tara
-zh-classical
-zh-cn
-map-bms
diff --git a/mwlib/licenses.py b/mwlib/licenses.py
deleted file mode 100644
index 2e96efd..0000000
--- a/mwlib/licenses.py
+++ /dev/null
@@ -1,185 +0,0 @@
-#! /usr/bin/env python
-
-"""Mapping of lower-cased template names of licenses to their normalized name.
-This file has been automatically generated with tools/get_license_templates.py
-"""
-
-lower2normal = {u'attr-tartu': u'Attr-Tartu',
- u'attribution': u'Attribution',
- u'attribution entomart': u'Attribution Entomart',
- u'attribution-ubisoft': u'Attribution-Ubisoft',
- u'attribution-ubisoft/ja': u'Attribution-Ubisoft/ja',
- u'attribution-ubisoft/ko': u'Attribution-Ubisoft/ko',
- u'attribution-ubisoft/nl': u'Attribution-Ubisoft/nl',
- u'attribution/lv': u'Attribution/lv',
- u'attribution/zh-hant': u'Attribution/zh-hant',
- u'autotravel': u'Autotravel',
- u'bsdu': u'BSDu',
- u'cc-by-1.0': u'Cc-by-1.0',
- u'cc-by-1.0-nl': u'Cc-by-1.0-nl',
- u'cc-by-2.0': u'Cc-by-2.0',
- u'cc-by-2.0-be': u'Cc-by-2.0-be',
- u'cc-by-2.0-br': u'Cc-by-2.0-br',
- u'cc-by-2.0-cl': u'Cc-by-2.0-cl',
- u'cc-by-2.0-es': u'Cc-by-2.0-es',
- u'cc-by-2.0-fr': u'Cc-by-2.0-fr',
- u'cc-by-2.0-it': u'Cc-by-2.0-it',
- u'cc-by-2.0-kr': u'Cc-by-2.0-kr',
- u'cc-by-2.0-nl': u'Cc-by-2.0-nl',
- u'cc-by-2.0-uk': u'Cc-by-2.0-uk',
- u'cc-by-2.1-au': u'Cc-by-2.1-au',
- u'cc-by-2.1-es': u'Cc-by-2.1-es',
- u'cc-by-2.1-jp': u'Cc-by-2.1-jp',
- u'cc-by-2.5': u'Cc-by-2.5',
- u'cc-by-2.5-bg': u'Cc-by-2.5-bg',
- u'cc-by-2.5-br': u'Cc-by-2.5-br',
- u'cc-by-2.5-dk': u'Cc-by-2.5-dk',
- u'cc-by-2.5-in': u'Cc-by-2.5-in',
- u'cc-by-2.5-it': u'Cc-by-2.5-it',
- u'cc-by-2.5-my': u'Cc-by-2.5-my',
- u'cc-by-2.5-nl': u'Cc-by-2.5-nl',
- u'cc-by-2.5-pl': u'Cc-by-2.5-pl',
- u'cc-by-2.5-se': u'Cc-by-2.5-se',
- u'cc-by-3.0': u'Cc-by-3.0',
- u'cc-by-3.0-gr': u'Cc-by-3.0-gr',
- u'cc-by-3.0-indiafm': u'Cc-by-3.0-IndiaFM',
- u'cc-by-3.0-nl': u'Cc-by-3.0-nl',
- u'cc-by-3.0-rs': u'Cc-by-3.0-rs',
- u'cc-by-3.0-us': u'Cc-by-3.0-us',
- u'cc-by-nc-sa-2.0-dual': u'Cc-by-nc-sa-2.0-dual',
- u'cc-by-sa-1.0': u'Cc-by-sa-1.0',
- u'cc-by-sa-1.0-fi': u'Cc-by-sa-1.0-fi',
- u'cc-by-sa-1.0-tw': u'Cc-by-sa-1.0-tw',
- u'cc-by-sa-2.0': u'Cc-by-sa-2.0',
- u'cc-by-sa-2.0-at': u'Cc-by-sa-2.0-at',
- u'cc-by-sa-2.0-be': u'Cc-by-sa-2.0-be',
- u'cc-by-sa-2.0-br': u'Cc-by-sa-2.0-br',
- u'cc-by-sa-2.0-ca': u'Cc-by-sa-2.0-ca',
- u'cc-by-sa-2.0-cl': u'Cc-by-sa-2.0-cl',
- u'cc-by-sa-2.0-de': u'Cc-by-sa-2.0-de',
- u'cc-by-sa-2.0-es': u'Cc-by-sa-2.0-es',
- u'cc-by-sa-2.0-fr': u'Cc-by-sa-2.0-fr',
- u'cc-by-sa-2.0-it': u'Cc-by-sa-2.0-it',
- u'cc-by-sa-2.0-kr': u'Cc-by-sa-2.0-kr',
- u'cc-by-sa-2.0-nl': u'Cc-by-sa-2.0-nl',
- u'cc-by-sa-2.0-tw': u'Cc-by-sa-2.0-tw',
- u'cc-by-sa-2.0-uk': u'Cc-by-sa-2.0-uk',
- u'cc-by-sa-2.1-au': u'Cc-by-sa-2.1-au',
- u'cc-by-sa-2.1-es': u'Cc-by-sa-2.1-es',
- u'cc-by-sa-2.1-jp': u'Cc-by-sa-2.1-jp',
- u'cc-by-sa-2.5': u'Cc-by-sa-2.5',
- u'cc-by-sa-2.5,1.0': u'Cc-by-sa-2.5,1.0',
- u'cc-by-sa-2.5,2.0,1.0': u'Cc-by-sa-2.5,2.0,1.0',
- u'cc-by-sa-2.5,2.0,1.0-no-link': u'Cc-by-sa-2.5,2.0,1.0-no-link',
- u'cc-by-sa-2.5-ar': u'Cc-by-sa-2.5-ar',
- u'cc-by-sa-2.5-au': u'Cc-by-sa-2.5-au',
- u'cc-by-sa-2.5-bg': u'Cc-by-sa-2.5-bg',
- u'cc-by-sa-2.5-br': u'Cc-by-sa-2.5-br',
- u'cc-by-sa-2.5-ca': u'Cc-by-sa-2.5-ca',
- u'cc-by-sa-2.5-ch': u'Cc-by-sa-2.5-ch',
- u'cc-by-sa-2.5-cl': u'Cc-by-sa-2.5-cl',
- u'cc-by-sa-2.5-cn': u'Cc-by-sa-2.5-cn',
- u'cc-by-sa-2.5-de': u'Cc-by-sa-2.5-de',
- u'cc-by-sa-2.5-dk': u'Cc-by-sa-2.5-dk',
- u'cc-by-sa-2.5-es': u'Cc-by-sa-2.5-es',
- u'cc-by-sa-2.5-hu': u'Cc-by-sa-2.5-hu',
- u'cc-by-sa-2.5-in': u'Cc-by-sa-2.5-in',
- u'cc-by-sa-2.5-it': u'Cc-by-sa-2.5-it',
- u'cc-by-sa-2.5-mx': u'Cc-by-sa-2.5-mx',
- u'cc-by-sa-2.5-nl': u'Cc-by-sa-2.5-nl',
- u'cc-by-sa-2.5-pl': u'Cc-by-sa-2.5-pl',
- u'cc-by-sa-2.5-pt': u'Cc-by-sa-2.5-pt',
- u'cc-by-sa-2.5-se': u'Cc-by-sa-2.5-se',
- u'cc-by-sa-2.5-si': u'Cc-by-sa-2.5-si',
- u'cc-by-sa-2.5-tw': u'Cc-by-sa-2.5-tw',
- u'cc-by-sa-3.0': u'Cc-by-sa-3.0',
- u'cc-by-sa-3.0,2.5,2.0,1.0': u'Cc-by-sa-3.0,2.5,2.0,1.0',
- u'cc-by-sa-3.0,2.5,2.0,1.0-no-link': u'Cc-by-sa-3.0,2.5,2.0,1.0-no-link',
- u'cc-by-sa-3.0-gr': u'Cc-by-sa-3.0-gr',
- u'cc-by-sa-3.0-nl': u'Cc-by-sa-3.0-nl',
- u'cc-by-sa-3.0-rs': u'Cc-by-sa-3.0-rs',
- u'cc-by-sa-3.0-tw': u'Cc-by-sa-3.0-tw',
- u'cc-by-sa-3.0-us': u'Cc-by-sa-3.0-us',
- u'cc-by-sa-jul': u'Cc-by-sa-jul',
- u'cecill': u'CeCILL',
- u'cng': u'CNG',
- u'elephants dream': u'Elephants Dream',
- u'fal': u'FAL',
- u'geograph': u'Geograph',
- u'gfdl': u'GFDL',
- u'gfdl or cc-by-nc-sa': u'GFDL or cc-by-nc-sa',
- u'gfdl or cc-by-nc-sa/2.5': u'GFDL or cc-by-nc-sa/2.5',
- u'gfdl-1.2': u'GFDL-1.2',
- u'gfdl-1.2-en': u'GFDL-1.2-en',
- u'gfdl-1.2/es': u'GFDL-1.2/es',
- u'gfdl-1.2/vi': u'GFDL-1.2/vi',
- u'gfdl-cc-triple': u'GFDL-CC-triple',
- u'gfdl-dd': u'GFDL-DD',
- u'gfdl-en': u'GFDL-en',
- u'gfdl-en/bg': u'GFDL-en/bg',
- u'gfdl-en/fr': u'GFDL-en/fr',
- u'gfdl-en/pl': u'GFDL-en/pl',
- u'gfdl-gmt': u'GFDL-GMT',
- u'gfdl-is': u'GFDL-IS',
- u'gfdl-it': u'GFDL-it',
- u'gfdl-ja': u'GFDL-ja',
- u'gfdl-landsat-kashmir3d': u'GFDL-Landsat-Kashmir3d',
- u'gfdl-opengeodb': u'GFDL-OpenGeoDB',
- u'gfdl-retouched': u'GFDL-retouched',
- u'gfdl-samoborac': u'GFDL-Samoborac',
- u'gfdl-self': u'GFDL-self',
- u'gfdl-user': u'GFDL-user',
- u'gfdl-user-als': u'GFDL-user-als',
- u'gfdl-user-ar': u'GFDL-user-ar',
- u'gfdl-user-bat-smg': u'GFDL-user-bat-smg',
- u'gfdl-user-bs': u'GFDL-user-bs',
- u'gfdl-user-cs': u'GFDL-user-cs',
- u'gfdl-user-da': u'GFDL-user-da',
- u'gfdl-user-de': u'GFDL-user-de',
- u'gfdl-user-el': u'GFDL-user-el',
- u'gfdl-user-en-no-disclaimers': u'GFDL-user-en-no-disclaimers',
- u'gfdl-user-en-note': u'GFDL-user-en-note',
- u'gfdl-user-en-with-disclaimers': u'GFDL-user-en-with-disclaimers',
- u'gfdl-user-es': u'GFDL-user-es',
- u'gfdl-user-fa': u'GFDL-user-fa',
- u'gfdl-user-fi': u'GFDL-user-fi',
- u'gfdl-user-fr': u'GFDL-user-fr',
- u'gfdl-user-gl': u'GFDL-user-gl',
- u'gfdl-user-he': u'GFDL-user-he',
- u'gfdl-user-hi': u'GFDL-user-hi',
- u'gfdl-user-hu': u'GFDL-user-hu',
- u'gfdl-user-id': u'GFDL-user-id',
- u'gfdl-user-it': u'GFDL-user-it',
- u'gfdl-user-ja': u'GFDL-user-ja',
- u'gfdl-user-ko': u'GFDL-user-ko',
- u'gfdl-user-lt': u'GFDL-user-lt',
- u'gfdl-user-nl': u'GFDL-user-nl',
- u'gfdl-user-nn': u'GFDL-user-nn',
- u'gfdl-user-no': u'GFDL-user-no',
- u'gfdl-user-pl': u'GFDL-user-pl',
- u'gfdl-user-pt': u'GFDL-user-pt',
- u'gfdl-user-ru': u'GFDL-user-ru',
- u'gfdl-user-sk': u'GFDL-user-sk',
- u'gfdl-user-sq': u'GFDL-user-sq',
- u'gfdl-user-tr': u'GFDL-user-tr',
- u'gfdl-user-uk': u'GFDL-user-uk',
- u'gfdl-user-vi': u'GFDL-user-vi',
- u'gfdl-user-vls': u'GFDL-user-vls',
- u'gfdl-user-w': u'GFDL-user-w',
- u'gfdl-user-zh': u'GFDL-user-zh',
- u'gpl': u'GPL',
- u'gplv2 only': u'GPLv2 only',
- u'gplv3': u'GPLv3',
- u'inewton': u'INewton',
- u'lgpl': u'LGPL',
- u'mdb': u'MdB',
- u'met.no': u'Met.no',
- u'norges golfforbund': u'Norges Golfforbund',
- u'open font': u'Open Font',
- u'parlament.ch': u'Parlament.ch',
- u'picswiss': u'Picswiss',
- u'polishsenatecopyright': u'PolishSenateCopyright',
- u'stationsweb': u'Stationsweb',
- u'statistics netherlands map': u'Statistics Netherlands map',
- u'swiss government portrait': u'Swiss Government Portrait',
- u'www.nordenskirker.dk': u'Www.nordenskirker.dk'}
diff --git a/mwlib/log.py b/mwlib/log.py
deleted file mode 100755
index 9afef8f..0000000
--- a/mwlib/log.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import sys
-
-class Stdout(object):
- """late-bound sys.stdout"""
- def write(self, msg):
- sys.stdout.write(msg)
-
- def flush(self):
- sys.stdout.flush()
-
-class Stderr(object):
- """late-bound sys.stderr"""
- def write(self, msg):
- sys.stderr.write(msg)
-
- def flush(self):
- sys.stderr.flush()
-
-class Log(object):
- logfile = Stderr()
-
- def __init__(self, prefix=None):
- if prefix is None:
- self._prefix = []
- else:
- if isinstance(prefix, basestring):
- self._prefix = [prefix]
- else:
- self._prefix = prefix
-
- def __getattr__(self, name):
- return Log([self, name])
-
- def __nonzero__(self):
- return bool(self._prefix)
-
- def __str__(self):
- return ".".join(str(x) for x in self._prefix if x)
-
- def __call__(self, msg, *args):
- if not self.logfile:
- return
-
- if args:
- msg = " ".join(([msg] + [repr(x) for x in args]))
-
- s = "%s >> %s\n" % (".".join(str(x) for x in self._prefix if x), msg)
- self.logfile.write(s)
diff --git a/mwlib/magics.py b/mwlib/magics.py
deleted file mode 100755
index 4246ba5..0000000
--- a/mwlib/magics.py
+++ /dev/null
@@ -1,469 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-"""expand magic variables/colon functions
-http://meta.wikimedia.org/wiki/Help:Colon_function
-http://meta.wikimedia.org/wiki/Help:Magic_words
-http://meta.wikimedia.org/wiki/ParserFunctions
-"""
-
-import datetime
-import urllib
-from mwlib.log import Log
-from mwlib import expr
-
-log = Log("expander")
-
-def singlearg(fun):
- def wrap(self, args):
- rl=args
- if not rl:
- a=u''
- else:
- a=rl[0]
-
- return fun(self, a)
-
- return wrap
-
-def noarg(fun):
- def wrap(self, *args):
- return fun(self)
- return wrap
-
-def as_numeric(x):
- try:
- return int(x)
- except ValueError:
- pass
- return float(x)
-
-
-def maybe_numeric_compare(a,b):
- if a==b:
- return True
- try:
- a=as_numeric(a)
- b=as_numeric(b)
- except ValueError:
- return False
-
- return a==b
-
-
-class OtherMagic(object):
- def DEFAULTSORT(self, args):
- """see http://en.wikipedia.org/wiki/Template:DEFAULTSORT"""
- return u""
-
-
-class TimeMagic(object):
- now = datetime.datetime.now()
-
- @noarg
- def CURRENTDAY(self):
- """Displays the current day in numeric form."""
- return "%s" % self.now.day
-
- @noarg
- def CURRENTDAY2(self):
- """[MW1.5+] Ditto with leading zero 01 .. 31)."""
- return "%02d" % self.now.day
-
- @noarg
- def CURRENTDAYNAME(self):
- """Displays the current day in named form."""
- return self.now.strftime("%A")
-
- @noarg
- def CURRENTDOW(self):
- """current day as number (0=Sunday, 1=Monday...)."""
- return str((self.now.weekday()+1) % 7)
-
- @noarg
- def CURRENTMONTH(self):
- """The number 01 .. 12 of the current month."""
- return "%02d" % self.now.month
-
- @noarg
- def CURRENTMONTHABBREV(self):
- """[MW1.5+] current month abbreviated Jan .. Dec."""
- return self.now.strftime("%b")
-
- @noarg
- def CURRENTMONTHNAME(self):
- """current month in named form January .. December. """
- return self.now.strftime("%B")
-
- @noarg
- def CURRENTTIME(self):
- """The current time of day (00:00 .. 23:59)."""
- return self.now.strftime("%H:%M")
-
- @noarg
- def CURRENTWEEK(self):
- """Number of the current week (1-53) according to ISO 8601 with no leading zero."""
- return str(self.now.isocalendar()[1])
-
- @noarg
- def CURRENTYEAR(self):
- """Returns the current year."""
- return str(self.now.year)
-
- @noarg
- def CURRENTTIMESTAMP(self):
- """[MW1.7+] Returns the current time stamp. e.g.: 20060528125203"""
- return self.now.strftime("%Y%m%d%H%M%S")
-
- def MONTHNAME(self, args):
- rl = args
- if not rl:
- return u"Missing required parameter 1=month!"
- try:
- m=int(rl[0].strip()) % 12
- except ValueError:
- return u"month should be an integer"
- if m==0:
- m=12
-
- return datetime.datetime(2000, m, 1).strftime("%B")
-
-class PageMagic(object):
- def __init__(self, pagename='', server="http://en.wikipedia.org", revisionid=0):
- self.pagename = pagename
- self.server = server
- self.revisionid = revisionid
-
- def PAGENAME(self, args):
- """Returns the name of the current page, including all levels (Title/Subtitle/Sub-subtitle)"""
- return self.pagename
-
- def PAGENAMEE(self, args):
- """same as PAGENAME but More URL-friendly percent encoded
- special characters (To use an articlename in an external link).
- """
- return urllib.quote(self.pagename.encode('utf8'))
-
-
- def SUBPAGENAME(self, args):
- """[MW1.6+] Returns the name of the current page, excluding parent
- pages ('Title/Subtitle' becomes 'Subtitle').
- """
- return self.pagename.split('/')[-1]
-
- def SUBPAGENAMEE(self, args):
- return urllib.quote(self.SUBPAGENAMEE())
-
- def BASEPAGENAME(self, args):
- """[MW1.7+] The basename of a subpage ('Title/Subtitle' becomes 'Title')
- """
- return self.pagename.rsplit('/', 1)[0]
-
- def BASEPAGENAMEE(self, args):
- """[MW1.7+] The basename of a subpage ('Title/Subtitle' becomes 'Title')
- """
- return urllib.quote(self.BASEPAGENAME(args))
-
- def NAMESPACE(self, args):
- """Returns the name of the namespace the current page resides in."""
- return u"" # we currently only have articles living in the main/empty namespace
-
- def NAMESPACEE(self, args):
- """Returns the name of the namespace the current page resides in. (quoted)"""
- return urllib.quote(self.NAMESPACE(args))
-
- def REVISIONID(self, args):
- """[MW1.5+] The unique identifying number of a page, see Help:Diff."""
- return str(self.revisionid)
-
- @noarg
- def SITENAME(self):
- """Value of $wgSitename."""
- return ""
-
- def NS(self, args):
- """Returns the name of a given namespace number."""
- return "++NS not implemented++"
-
- def LOCALURL(self, args):
- """Returns the local URL of a given page. The page might not exist."""
- try:
- url = "/wiki"+ "".join(args)
- except:
- url = '' # FIXME
- return "/wiki"+url
-
- def LOCALURLE(self, args):
- """Returns the local URL of a given page. The page might not exist."""
- return urllib.quote(self.LOCALURL(args))
-
- def URLENCODE(self, args):
- """[MW1.7+] To use a variable (parameter in a template) with spaces in an external link."""
- try:
- url = urllib.quote_plus("".join(args[0]))
- except:
- url = "".join(args[0])
- return url
-
- @noarg
- def SERVER(self):
- """Value of $wgServer"""
- return self.server
-
- def FULLURL(self, args):
- return u''
- u = "".join(args)
- self.SERVERNAME({})
-
- @noarg
- def SERVERNAME(self):
- return self.SERVER({})[len("http://"):]
-
-
-class NumberMagic(object):
- def DISPLAYTITLE(self, args):
- """[MW 1.7+] (unclear)"""
- return ""
-
- def NUMBEROFARTICLES(self, args):
- """A variable which returns the total number of articles on the Wiki."""
- return "0"
-
- def NUMBEROFPAGES(self, args):
- """[MW1.7+] Returns the total number of pages. """
- return "0"
-
- def NUMBEROFFILES(self, args):
- """[MW1.5+] Returns the number of uploaded files (rows in the image table)."""
- return "0"
-
- def NUMBEROFUSERS(self, args):
- """[MW1.7+] Returns the number of registered users (rows in the user table)."""
- return "0"
-
- def CURRENTVERSION(self, args):
- """[MW1.7+] Returns the current version of MediaWiki being run. [5]"""
- return "1.7alpha"
-
-
-
-class StringMagic(object):
- @singlearg
- def LC(self, a):
- return a.lower()
-
- @singlearg
- def UC(self, a):
- return a.upper()
-
- @singlearg
- def LCFIRST(self, a):
- return a[:1].lower()+a[1:]
-
- @singlearg
- def UCFIRST(self, a):
- return a[:1].upper()+a[1:]
-
- @singlearg
- def FORMATNUM(self, a):
- return a
-
-class ParserFunctions(object):
- wikidb = None
- def _error(self,s):
- return '<strong class="error">%s</strong>' % (s,)
-
- def TAG(self, args):
- name = args[0].strip()
- r= u"<%s>%s</%s>" % (name, args[1], name)
- return r
-
-
- def IF(self, rl):
- if rl[0]:
- return rl[1]
- else:
- return rl[2]
-
- def IFEXIST(self, args):
- name = args[0]
- if not self.wikidb:
- return args.get(args[2], "")
-
- # wrong place. FIXME.
- if ':' in name:
- ns, name = name.split(':', 1)
- if ns.lower() in ['vorlage', 'template']:
- r=self.wikidb.getTemplate(name)
- else:
- r=None
- else:
- r=self.wikidb.getRawArticle(name)
-
- if r:
- return args[1]
- else:
- return args[2]
-
-
-
- def IFEQ(self, rl):
- if maybe_numeric_compare(rl[0], rl[1]):
- return rl[2]
- else:
- return rl[3]
-
- def EXPR(self, rl):
- if rl:
- try:
- r=str(expr.expr(rl[0]))
- except Exception, err:
- return self._error(err)
-
- if "e" in r:
- f,i = r.split("e")
- i=int(i)
- if i<0:
- sign = ''
- else:
- sign = '+'
- fixed=str(float(f))+"E"+sign+str(int(i))
- return fixed
- return r
- return u"0"
-
-
- def IFEXPR(self, rl):
- try:
- r = expr.expr(rl[0])
- except Exception, err:
- return self._error(err)
-
- if r:
- return rl[1]
- else:
- return rl[2]
-
- def SWITCH(self, args):
- """see http://meta.wikimedia.org/wiki/ParserFunctions#.23switch:"""
- cmpval = args[0].strip()
- found=False # used for fall through
- for c in args[1:]:
- if '=' in c:
- val, result = c.split('=', 1)
- val=val.strip()
- result=result.strip()
- if found or maybe_numeric_compare(val, cmpval):
- return result
- else:
- if maybe_numeric_compare(cmpval,c.strip()):
- found=True
-
- d=args["#default"]
- if d:
- return d
-
-
- last = args[-1]
-
- if '=' not in last:
- return last
- return u''
-
- def TITLEPARTS(self, args):
- title = args[0]
- try:
- numseg = int(args[1])
- except ValueError:
- numseq = 0
-
- try:
- start = int(args[2])
- except ValueError:
- start = 1
-
- if start>0:
- start -= 1
-
- parts = title.split("/")[start:]
- if numseg:
- parts = parts[:numseg]
- return "/".join(parts)
-
- def IFERROR(self, args):
- errmark = '<strong class="error">'
- val = args[0]
- bad=args[1]
- good=args[2] or val
-
- if errmark in val:
- return bad
- else:
- return good
-
-
-for x in dir(ParserFunctions):
- if x.startswith("_"):
- continue
- setattr(ParserFunctions, "#"+x, getattr(ParserFunctions, x))
- delattr(ParserFunctions, x)
-
-class DummyResolver(object):
- pass
-
-class MagicResolver(TimeMagic, PageMagic, NumberMagic, StringMagic, ParserFunctions, OtherMagic, DummyResolver):
- def __call__(self, name, args):
- try:
- name = str(name)
- except UnicodeEncodeError:
- return None
-
-
- m = getattr(self, name.upper(), None)
- if m is None:
- return None
-
- if isinstance(m, basestring):
- return m
-
- res = m(args) or '' # FIXME: catch TypeErros
- assert isinstance(res, basestring), "MAGIC %r returned %r" % (name, res)
- return res
-
- def has_magic(self, name):
- try:
- name = str(name)
- except UnicodeEncodeError:
- return False
-
-
- m = getattr(self, name.upper(), None)
- return m is not None
-
-
-
-magic_words = ['basepagename', 'basepagenamee', 'contentlanguage', 'currentday', 'currentday2', 'currentdayname', 'currentdow', 'currenthour', 'currentmonth', 'currentmonthabbrev', 'currentmonthname', 'currentmonthnamegen', 'currenttime', 'currenttimestamp', 'currentversion', 'currentweek', 'currentyear', 'defaultsort', 'directionmark', 'displaytitle', 'fullpagename', 'fullpagenamee', 'language', 'localday', 'localday2', 'localdayname', 'localdow', 'localhour', 'localmonth', 'localmonthabbrev', 'localmonthname', 'localmonthnamegen', 'localtime', 'localtimestamp', 'localweek', 'localyear', 'namespace', 'namespacee', 'newsectionlink', 'numberofadmins', 'numberofarticles', 'numberofedits', 'numberoffiles', 'numberofpages', 'numberofusers', 'pagename', 'pagenamee', 'pagesinnamespace', 'revisionday', 'revisionday2', 'revisionid', 'revisionmonth', 'revisiontimestamp', 'revisionyear', 'scriptpath', 'server', 'servername', 'sitename', 'subjectpagename', 'subjectpagenamee', 'subjectspace', 'subjectspacee', 'subpagename', 'subpagenamee', 'talkpagename', 'talkpagenamee', 'talkspace', 'talkspacee', 'urlencode']
-
-def _populate_dummy():
- m=MagicResolver()
-
- def get_dummy(name):
- def resolve(*args):
- log.warn("using dummy resolver for %s" % (name,))
- return u""
- return resolve
-
- missing = set()
- for x in magic_words:
- if not m.has_magic(x):
- missing.add(x)
- setattr(DummyResolver, x.upper(), get_dummy(x))
-
- if missing:
- missing = list(missing)
- missing.sort()
- #log.info("installed dummy resolvers for %s" % (", ".join(missing),))
-
-_populate_dummy()
diff --git a/mwlib/metabook.py b/mwlib/metabook.py
deleted file mode 100755
index e36e70d..0000000
--- a/mwlib/metabook.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#! /usr/bin/env python
-#! -*- coding:utf-8 -*-
-
-import re
-import simplejson
-
-"""
-See METABOOK.txt for description of Metabook data
-"""
-
-class MetaBook(object):
- """Encapsulate meta information about an article collection"""
-
- title = u""
- subtitle = u""
-
- def __init__(self):
- self.type = 'collection'
- self.version = 1
- self.items = []
-
- def addArticles(self, articleTitles, chapterTitle=None, contentType='text/x-wiki'):
- """
- @param articleTitles: sequence of article titles or dicts containing
- article title (value for key 'title') and optionally display title
- (value for key 'displaytitle').
- @type articleTitles: [unicode|{str: unicode}]
- """
-
- articles = []
- for title in articleTitles:
- article = {
- 'type': 'article',
- 'content-type': contentType,
- }
- if isinstance(title, dict):
- article.update(title)
- else:
- article['title'] = title
- articles.append(article)
- if chapterTitle:
- self.items.append({
- 'type': 'chapter',
- 'title': chapterTitle,
- 'items': articles,
- })
- else:
- self.items.extend(articles)
-
- def dumpJson(self):
- return simplejson.dumps(vars(self))
-
- def loadJson(self, jsonStr):
- for (var, value) in simplejson.loads(jsonStr).items():
- setattr(self, var, value)
-
- def readJsonFile(self, filename):
- self.loadJson(open(filename, 'rb').read())
-
- def loadCollectionPage(self, mwcollection):
- """Parse wikitext of a MediaWiki collection page
-
- @param mwcollection: wikitext of a MediaWiki collection page as created by
- the Collection extension for MediaWiki
- @type mwcollection: unicode
- """
-
- titleRe = '^==\s+(?P<title>.*?)\s+==$'
- subtitleRe = '^===\s+(?P<subtitle>.*?)\s+===$'
- chapterRe = '^;(?P<chapter>.*?)$'
- articleRe = '^:\[\[:?(?P<article>.*?)(?:\|(?P<displaytitle>.*?))?\]\]$'
- alltogetherRe = re.compile("(%s)|(%s)|(%s)|(%s)" % (titleRe, subtitleRe, chapterRe, articleRe))
- gotChapter = False
- chapter = ''
- articles = []
- for line in mwcollection.splitlines():
- res = alltogetherRe.search(line.strip())
- if not res:
- continue
- if res.group('title'):
- self.title = res.group('title')
- elif res.group('subtitle'):
- self.subtitle = res.group('subtitle')
- elif res.group('chapter'):
- self.addArticles(articles, chapter)
- articles = []
- chapter = res.group('chapter')
- elif res.group('article'):
- d = {'title': res.group('article')}
- if res.group('displaytitle'):
- d['displaytitle'] = res.group('displaytitle')
- articles.append(d)
-
- if len(articles):
- self.addArticles(articles, chapter)
-
- def getArticles(self):
- """Generator that produces a sequence of (title, revision) pairs for
- each article contained in this collection. If no revision is specified,
- None is returned for the revision item.
- """
-
- for item in self.getItems():
- if item['type'] == 'article':
- yield item['title'], item.get('revision', None)
-
- def getItems(self):
- """Generator that produces a flattened list of chapters and articles
- in this collection.
- """
-
- for item in self.items:
- if item['type'] == 'article':
- yield item
- elif item['type'] == 'chapter':
- yield item
- for article in item.get('items', []):
- yield article
-
diff --git a/mwlib/mwapidb.py b/mwlib/mwapidb.py
deleted file mode 100644
index 4826ef4..0000000
--- a/mwlib/mwapidb.py
+++ /dev/null
@@ -1,376 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# Copyright (c) 2008, PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import os
-import re
-import shutil
-import tempfile
-import time
-import urllib
-import urllib2
-import urlparse
-
-import simplejson
-
-from mwlib import uparser, utils
-from mwlib.log import Log
-
-log = Log("mwapidb")
-
-try:
- from mwlib.licenses import lower2normal
-except ImportError:
- log.warn('no licenses found')
- lower2normal = {}
-
-# ==============================================================================
-
-
-def fetch_url(url, ignore_errors=False):
- log.info("fetching %r" % (url,))
- opener = urllib2.build_opener()
- opener.addheaders = [('User-agent', 'mwlib')]
- try:
- data = opener.open(url).read()
- except urllib2.URLError, err:
- if ignore_errors:
- log.error("%s - while fetching %r" % (err, url))
- return None
- raise RuntimeError('Could not fetch %r: %s' % (url, err))
- log.info("got %r (%d Bytes)" % (url, len(data)))
- return data
-
-
-# ==============================================================================
-
-
-class APIHelper(object):
- def __init__(self, base_url):
- """
- @param base_url: base URL (or list of URLs) of a MediaWiki,
- i.e. URL path to php scripts,
- e.g. 'http://en.wikipedia.org/w/' for English Wikipedia.
- @type base_url: basestring or [basestring]
- """
-
- if isinstance(base_url, unicode):
- self.base_url = base_url.encode('utf-8')
- else:
- self.base_url = base_url
- if self.base_url[-1] != '/':
- self.base_url += '/'
-
- def query(self, **kwargs):
- args = {
- 'action': 'query',
- 'format': 'json',
- }
- args.update(**kwargs)
- for k, v in args.items():
- if isinstance(v, unicode):
- args[k] = v.encode('utf-8')
- data = fetch_url('%sapi.php?%s' % (self.base_url, urllib.urlencode(args)))
- if data is None:
- return None
- try:
- return simplejson.loads(unicode(data, 'utf-8'))['query']
- except KeyError:
- return None
- except:
- raise RuntimeError('api.php query failed. Are you sure you specified the correct baseurl?')
-
- def page_query(self, **kwargs):
- q = self.query(**kwargs)
- if q is None:
- return None
- try:
- page = q['pages'].values()[0]
- except (KeyError, IndexError):
- return None
- if 'missing' in page:
- return None
- return page
-
-
-# ==============================================================================
-
-
-class ImageDB(object):
- def __init__(self, base_url, shared_base_url=None):
- self.api_helpers = [APIHelper(base_url)]
- if shared_base_url is not None:
- self.api_helpers.append(APIHelper(shared_base_url))
- self.tmpdir = tempfile.mkdtemp()
-
- def clear(self):
- shutil.rmtree(self.tmpdir, ignore_errors=True)
-
- def getURL(self, name, size=None):
- """Return image URL for image with given name
-
- @param name: image name (without namespace, i.e. without 'Image:')
- @type name: unicode
-
- @returns: URL to original image
- @rtype: str
- """
-
- assert isinstance(name, unicode), 'name must be of type unicode'
-
- for api_helper in self.api_helpers:
- if size is None:
- result = api_helper.page_query(titles='Image:%s' % name, prop='imageinfo', iiprop='url')
- else:
- result = api_helper.page_query(titles='Image:%s' % name, prop='imageinfo', iiprop='url', iiurlwidth=str(size))
- if result is not None:
- break
- else:
- return None
-
- try:
- imageinfo = result['imageinfo'][0]
- if size is not None and 'thumburl' in imageinfo:
- url = imageinfo['thumburl']
- else:
- url = imageinfo['url']
- if url: # url can be False
- if url.startswith('/'):
- url = urlparse.urljoin(self.api_helpers[0].base_url, url)
- return url
- return None
- except (KeyError, IndexError):
- return None
-
- def getDiskPath(self, name, size=None):
- """Return filename for image with given name and size
-
- @param name: image name (without namespace, i.e. without 'Image:')
- @type name: unicode
-
- @param size: if given, the image is converted to the given maximum width
- @type size: int or NoneType
-
- @returns: filename of image or None if image could not be found
- @rtype: basestring
- """
-
- assert isinstance(name, unicode), 'name must be of type unicode'
-
- url = self.getURL(name, size=size)
- if url is None:
- return None
-
- data = fetch_url(url, ignore_errors=True)
- if not data:
- return None
-
- ext = url.rsplit('.')[-1]
- if size is not None:
- ext = '%dpx.%s' % (size, ext)
- else:
- ext = '.%s' % ext
- filename = os.path.join(self.tmpdir, utils.fsescape(name + ext))
- f = open(filename, 'wb')
- f.write(data)
- f.close()
- return filename
-
- def getLicense(self, name):
- """Return license of image as stated on image description page
-
- @param name: image name without namespace (e.g. without "Image:")
- @type name: unicode
-
- @returns: license of image of None, if no valid license could be found
- @rtype: unicode
- """
-
- assert isinstance(name, unicode), 'name must be of type unicode'
-
- for api_helper in self.api_helpers:
- result = api_helper.page_query(titles='Image:%s' % name, prop='templates')
- if result is not None:
- break
- else:
- return None
-
- try:
- templates = [t['title'] for t in result['templates']]
- except KeyError:
- return None
-
- for t in templates:
- try:
- return lower2normal[t.split(':', 1)[-1].lower()]
- except KeyError:
- pass
-
- return None
-
-
-# ==============================================================================
-
-
-class WikiDB(object):
- print_template = u'Template:Print%s'
-
- ip_rex = re.compile(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$')
- bot_rex = re.compile(r'\bbot\b', re.IGNORECASE)
-
- def __init__(self, base_url, license, template_blacklist=None):
- """
- @param base_url: base URL of a MediaWiki,
- e.g. 'http://en.wikipedia.org/w/'
- @type base_url: basestring
-
- @param license: title of an article containing full license text
- @type license: unicode
-
- @param template_blacklist: title of an article containing blacklisted
- templates (optional)
- @type template_blacklist: unicode
- """
-
- self.base_url = base_url
- self.license = license
- self.api_helper = APIHelper(self.base_url)
- self.template_cache = {}
- self.template_blacklist = []
- if template_blacklist is not None:
- raw = self.getRawArticle(template_blacklist)
- if raw is None:
- log.error('Could not get template blacklist article %r' % template_blacklist)
- else:
- self.template_blacklist = [template.lower().strip()
- for template in re.findall('\* *\[\[.*?:(.*?)\]\]', raw)]
-
- def getURL(self, title, revision=None):
- name = urllib.quote(title.replace(" ", "_").encode('utf-8'))
- if revision is None:
- return '%sindex.php?title=%s' % (self.base_url, name)
- else:
- return '%sindex.php?title=%s&oldid=%s' % (self.base_url, name, revision)
-
- def getAuthors(self, title, revision=None, max_num_authors=10):
- """Return at most max_num_authors names of non-bot, non-anon users for
- non-minor changes of given article (before given revsion).
-
- @returns: list of principal authors
- @rtype: [unicode]
- """
-
- result = self.api_helper.page_query(
- titles=title,
- redirects=1,
- prop='revisions',
- rvprop='user|ids|flags|comment',
- rvlimit=500,
- )
- if result is None:
- return None
-
- try:
- revs = result['revisions']
- except KeyError:
- return None
-
- if revision is not None:
- revision = int(revision)
- revs = [r for r in revs if r['revid'] < revision]
-
- authors = [r['user'] for r in revs
- if not r.get('anon')
- and not self.ip_rex.match(r['user'])
- and not r.get('minor')
- and not self.bot_rex.search(r.get('comment', ''))
- and not self.bot_rex.search(r['user'])
- ]
- author2count = {}
- for a in authors:
- try:
- author2count[a] += 1
- except KeyError:
- author2count[a] = 1
- author2count = author2count.items()
- author2count.sort(key=lambda a: -a[1])
- return [a[0] for a in author2count[:max_num_authors]]
-
- def getTemplate(self, name, followRedirects=True):
- """
- Note: *Not* following redirects is unsupported!
- """
-
- try:
- return self.template_cache[name]
- except KeyError:
- pass
-
- if ":" in name:
- name = name.split(':', 1)[1]
-
- if name.lower() in self.template_blacklist:
- log.info("ignoring blacklisted template:" , repr(name))
- return None
-
- for title in (self.print_template % name, 'Template:%s' % name):
- log.info("Trying template %r" % (title,))
- c = self.getRawArticle(title)
- if c is not None:
- self.template_cache[name] = c
- return c
-
- return None
-
- def getRawArticle(self, title, revision=None):
- if revision is None:
- page = self.api_helper.page_query(titles=title, redirects=1, prop='revisions', rvprop='content')
- else:
- page = self.api_helper.page_query(revids=revision, prop='revisions', rvprop='content')
- if page['title'] != title: # given revision could point to another article!
- return None
- if page is None:
- return None
- try:
- return page['revisions'][0].values()[0]
- except KeyError:
- return None
-
- def getMetaData(self):
- result = self.api_helper.query(meta='siteinfo')
- try:
- g = result['general']
- return {
- 'license': {
- 'name': g['rights'],
- 'wikitext': self.getRawArticle(self.license),
- },
- 'url': g['base'],
- 'name': '%s (%s)' % (g['sitename'], g['lang']),
- }
- except KeyError:
- return None
-
- def getParsedArticle(self, title, revision=None):
- raw = self.getRawArticle(title, revision=revision)
- if raw is None:
- return None
- a = uparser.parseString(title=title, raw=raw, wikidb=self)
- return a
-
-
-class Overlay(WikiDB):
- def __init__(self, wikidb, templates):
- self.__dict__.update(wikidb.__dict__)
- self.overlay_templates = templates
-
- def getTemplate(self, name, followRedirects=False):
- try:
- return self.overlay_templates[name]
- except KeyError:
- pass
-
- return super(Overlay, self).getTemplate(name, followRedirects=followRedirects)
-
diff --git a/mwlib/mwscan.py b/mwlib/mwscan.py
deleted file mode 100755
index 100ea35..0000000
--- a/mwlib/mwscan.py
+++ /dev/null
@@ -1,315 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import sys
-import time
-import _mwscan
-import htmlentitydefs
-
-class token(object):
- t_end = 0
- t_text = 1
- t_entity = 2
- t_special = 3
- t_magicword = 4
- t_comment = 5
- t_2box_open = 6
- t_2box_close = 7
- t_http_url = 8
- t_break = 9
- t_begin_table = 10
- t_end_table = 11
- t_html_tag = 12
- t_style = 13
- t_pre = 14
- t_section = 15
- t_section_end = 16
- t_item = 17
- t_colon = 18
- t_semicolon = 19
- t_hrule = 20
- t_newline = 21
- t_column = 22
- t_row = 23
- t_tablecaption = 24
- t_urllink = 25
-
- token2name = {}
-
-for d in dir(token):
- token2name = token.token2name
- if d.startswith("t_"):
- token2name[getattr(token, d)] = d
-del d
-
-
-
-
-def dump_tokens(text, tokens):
- for type, start, len in tokens:
- print type, repr(text[start:start+len])
-
-def scan(text):
- stime=time.time()
- text += u"\0"*32
- tokens = _mwscan.scan(text)
- return scan_result(text, tokens)
-
-def resolve_entity(e):
- if e[1]=='#':
- if e[2]=='x' or e[2]=='X':
- return unichr(int(e[3:-1], 16))
- else:
- return unichr(int(e[2:-1]))
-
- else:
- try:
- return unichr(htmlentitydefs.name2codepoint[e[1:-1]])
- except KeyError:
- return e
-
-
-class scan_result(object):
- def __init__(self, source, toks):
- self.source = source
- self.toks = toks
-
- def rawtext(self, (type, start, tlen)):
- return self.source[start:start+tlen]
-
- def text(self, t):
- r=self.rawtext(t)
- if t[0] == token.t_entity:
- return resolve_entity(r)
- else:
- return r
-
- def dump(self, out=None):
- if out is None:
- out = sys.stdout
- for x in self:
- out.write("%s\n" % self.repr(x))
-
-
-
- def repr(self, t):
- return "(%s, %r)" % (token.token2name.get(t[0]), self.rawtext(t))
-
-
- def __len__(self):
- return len(self.toks)
-
- def __iter__(self):
- return iter(self.toks)
-
- def __getitem__(self, idx):
- return self.toks[idx]
-
-
-class _compat_scanner(object):
- class ignore: pass
- tok2compat = {
- token.t_text: "TEXT",
- token.t_special: "SPECIAL",
- token.t_2box_open: "[[",
- token.t_2box_close: "]]",
- token.t_http_url: "URL",
- token.t_break: "BREAK",
- token.t_style: "STYLE",
- token.t_pre: "PRE",
- token.t_section: "SECTION",
- token.t_section_end: "ENDSECTION",
- token.t_magicword: ignore,
- token.t_comment: ignore,
- token.t_end: ignore,
- token.t_item: "ITEM",
- token.t_colon: "EOLSTYLE",
- token.t_semicolon: "EOLSTYLE",
- token.t_newline: "\n",
- token.t_begin_table: "BEGINTABLE",
- token.t_end_table: "ENDTABLE",
- token.t_column: "COLUMN",
- token.t_row: "ROW",
- token.t_tablecaption: "TABLECAPTION",
- token.t_urllink: "URLLINK",
- }
-
-
- def __call__(self, text):
- tokens = scan(text)
- scanres = scan_result(text, tokens)
-
-
- res = []
-
- def g():
- return text[start:start+tlen]
- a = lambda x: res.append((x,g()))
-
-
- ignore = self.ignore
- tok2compat = self.tok2compat
-
- i = 0
- numtokens = len(tokens)
- while i < numtokens:
- type, start, tlen = tokens[i]
- n=tok2compat.get(type)
- if n is ignore:
- pass
- elif n is not None:
- a(n)
- elif type==token.t_entity:
- res.append(("TEXT", resolve_entity(g())))
- elif type==token.t_hrule:
- res.append((self.tagtoken("<hr />"), g()))
- elif type==token.t_html_tag:
- s = g()
-
- tt = self.tagtoken(s)
- isEndToken = isinstance(tt, EndTagToken)
- closingOrSelfClosing = isEndToken or tt.selfClosing
-
- if tt.t=="math":
- if closingOrSelfClosing:
- i+=1
- continue
-
- res.append(("MATH", g()))
- i+=1
- while i<numtokens:
- type, start, tlen = tokens[i]
- if type==token.t_html_tag:
- tt = self.tagtoken(g())
- if tt.t=="math":
- res.append(("ENDMATH", g()))
- break
- res.append(("LATEX", g()))
- i+=1
- elif tt.t=="timeline":
- if closingOrSelfClosing:
- i+=1
- continue
- res.append(("TIMELINE", g()))
- i+=1
- while i<numtokens:
- type, start, tlen = tokens[i]
- if type==token.t_html_tag:
- tt = self.tagtoken(g())
- if tt.t=="timeline":
- res.append(("TIMELINE", g()))
- break
- res.append(("TEXT", g()))
- i+=1
- elif tt.t=="nowiki":
- i+=1
- if isEndToken or tt.selfClosing:
- continue
- while i<numtokens:
- type, start, tlen = tokens[i]
- if type==token.t_html_tag:
- tt = self.tagtoken(g())
- if tt.t=="nowiki":
- break
- res.append(("TEXT", scanres.text((type, start, tlen))))
- i+=1
- elif tt.t in ["font", "noinclude", 'p', 'caption']:
- pass
- elif tt.t=="table":
- if isEndToken:
- res.append(("ENDTABLE", g()))
- else:
- res.append(("BEGINTABLE", g()))
- elif tt.t in ['th', 'td']:
- if isEndToken:
- pass
- else:
- res.append(("COLUMN", g()))
- elif tt.t=='tr':
- if isEndToken:
- pass
- else:
- res.append(("ROW", g()))
- else:
- res.append((tt, s))
- else:
- a(type)
- i+=1
-
-
- return res
-
- def tagtoken(self, text):
- selfClosing = False
- if text.startswith(u"</"):
- name = text[2:-1]
- klass = EndTagToken
- isEndToken = True
- elif text.endswith("/>"):
- name = text[1:-2]
- klass = TagToken
- selfClosing = True
- isEndToken = False # ???
- else:
- name = text[1:-1]
- klass = TagToken
- isEndToken = False
-
- name, values = (name.split(None, 1)+[u''])[:2]
- from mwlib.parser import paramrx
- values = dict(paramrx.findall(values))
- name = name.lower()
-
- if name=='br' or name=='references':
- isEndToken = False
- klass = TagToken
-
- r = klass(name, text)
- r.selfClosing = selfClosing
- r.values = values
- return r
-
-
-
-compat_scan = _compat_scanner()
-
-# from plexscanner import _BaseTagToken, TagToken, EndTagToken
-
-class _BaseTagToken(object):
- def __eq__(self, other):
- if isinstance(other, basestring):
- return self.t == other
- if isinstance(other, self.__class__):
- return self.t == other.t
- return False
-
- def __ne__(self, other):
- return not(self==other)
-
- def __hash__(self):
- return hash(self.t)
-
-class TagToken(_BaseTagToken):
- values = {}
- selfClosing=False
-
- def __init__(self, t, text=''):
- self.t = t
- self.text = text
-
- def __repr__(self):
- return "<Tag:%s %r>" % (self.t, self.text)
-
-class EndTagToken(_BaseTagToken):
- def __init__(self, t, text=''):
- self.t = t
- self.text = text
-
- def __repr__(self):
- return "<EndTag:%s>" % self.t
-
-def tokenize(input, name="unknown"):
- assert input is not None, "must specify input argument in tokenize"
- return compat_scan(input)
diff --git a/mwlib/netdb.py b/mwlib/netdb.py
deleted file mode 100755
index ec38ee0..0000000
--- a/mwlib/netdb.py
+++ /dev/null
@@ -1,529 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# Copyright (c) 2008, PediaPress GmbH
-# See README.txt for additional licensing information.
-
-# An alternative solution to construct the hashpath of images would be to use
-# api.php, e.g.
-# fetch the page http://de.wikipedia.org/w/api.php?action=query&titles=Bild:SomePic.jpg&prop=imageinfo&iiprop=url&format=json
-
-import os
-import sys
-import urllib
-import urllib2
-try:
- from hashlib import md5
-except ImportError:
- from md5 import md5
-import shutil
-import sys
-import time
-import tempfile
-import re
-
-from mwlib import uparser, utils
-from mwlib.log import Log
-
-log = Log("netdb")
-
-# ==============================================================================
-
-def hashpath(name):
- """Compute hashpath for an image in the same way as MediaWiki does
-
- @param name: name of an image
- @type name: unicode
-
- @returns: hashpath to image
- @type: str
- """
-
- name = name.replace(' ', '_')
- name = name[:1].upper()+name[1:]
- d = md5(name.encode('utf-8')).hexdigest()
- return "/".join([d[0], d[:2], name])
-
-class ImageDB(object):
- convert_command = 'convert' # name of/path to ImageMagick's convert tool
-
- def __init__(self, baseurl, cachedir=None, wikidb=None, knownLicenses=None):
- """Init ImageDB with a base URL (or a list of base URLs) and optionally
- with a cache directory.
-
- @param baseurl: base URL or sequence containing several base URLs
- @type baseurl: unicode or (unicode,)
-
- @param cachedir: image cache directory (optional)
- @type cachedir: basestring or None
-
- @param wikidb: WikiDB instance used to fetch image description pages to
- find out image licenses
- @type wikidb: object
-
- @param knownLicenses: list of known license templates (whose name is the
- name of the license) which may appear on image description pages
- @type knownLicenses: [unicode]
- """
-
- if isinstance(baseurl, unicode):
- self.baseurls = [baseurl.encode('ascii')]
- else:
- self.baseurls = []
- for bu in baseurl:
- if isinstance(bu, unicode):
- bu = bu.encode('ascii')
- self.baseurls.append(bu)
-
- if cachedir:
- self.cachedir = cachedir
- self.tempcache = False
- else:
- self.cachedir = tempfile.mkdtemp()
- self.tempcache = True
- if self.cachedir[-1] != '/':
- self.cachedir += '/' # needed for getPath() to work correctly
-
- self.wikidb = wikidb
-
- oredLicenses = '|'.join(['(%s)' % re.escape(license)
- for license in (knownLicenses or [])])
- self.licenseRegexp = re.compile(r'{{(?P<license>%s)}}' % oredLicenses)
-
- self.name2license = {}
-
- def clear(self):
- """Delete temporary cache directory (i.e. only if no cachedir has been
- passed to __init__().
- """
-
- if self.tempcache:
- shutil.rmtree(self.cachedir)
-
- def getURL(self, name, size=None):
- """Return image URL for image with given name
-
- @param name: image name (without namespace, i.e. without 'Image:')
- @type name: unicode
-
- @returns: URL to original image
- @rtype: str
- """
-
- assert isinstance(name, unicode), 'name must be of type unicode'
-
- # use getDiskPath() to fetch and cache (!) image
- path = self.getDiskPath(name, size=size)
- if path is None:
- return None
-
- # first, look for a cached image with that name (in any size)
- for baseurl in self.baseurls:
- urldir = self._getCacheDirForBaseURL(baseurl)
- if not path.startswith(urldir):
- continue
- return self._getImageURLForBaseURL(baseurl, name)
-
- def getPath(self, name, size=None):
- """Return path to image with given parameters relative to cachedir"""
-
- path = self.getDiskPath(name, size=size)
- if path is None:
- return None
- assert path.startswith(self.cachedir), 'invalid path from getDiskPath()'
- return path[len(self.cachedir):]
-
- def getDiskPath(self, name, size=None):
- """Return filename for image with given name. If the image is not found
- in the cache, it is fetched per HTTP and converted.
-
- @param name: image name (without namespace, i.e. without 'Image:')
- @type name: unicode
-
- @param size: if given, the image is converted to the given maximum size
- (i.e. the image is scaled so that neither its width nor its height
- exceed size)
- @type size: int or NoneType
-
- @returns: filename of image
- @rtype: basestring
- """
-
- assert isinstance(name, unicode), 'name must be of type unicode'
-
- path = self._getImageFromCache(name, size=size)
- if path:
- return path
-
- tmpfile, baseurl = self._fetchImage(name)
- if tmpfile is None:
- return None
-
- self.name2license[name] = self._fetchLicense(baseurl, name)
-
- path = self._convertToCache(tmpfile, baseurl, name, size=size)
-
- try:
- os.unlink(tmpfile)
- except IOError:
- log.warn('Could not delete temp file %r' % tmpfile)
-
- return path
-
- def _fetchLicense(self, baseurl, name):
- if self.wikidb is None:
- return None
-
- raw = self.wikidb.getImageDescription(name,
- urlIndex=self.baseurls.index(baseurl),
- )
- if raw is None:
- return None
-
- mo = re.search(self.licenseRegexp, raw)
- if mo is None:
- return None
-
- return mo.group('license')
-
- def getLicense(self, name):
- """Return license of image as stated on image description page
-
- @param name: image name without namespace (e.g. without "Image:")
- @type name: unicode
-
- @returns: license of image of None, if no valid license could be found
- @rtype: str
- """
-
- assert isinstance(name, unicode), 'name must be of type unicode'
- return self.name2license.get(name)
-
- def _getImageFromCache(self, name, size=None):
- """Look in cachedir for an image with the given parameters"""
-
- for baseurl in self.baseurls:
- path = self._getCachedImagePath(baseurl, name, size=size)
- if path is not None and os.path.exists(path):
- return path
- return None
-
- def _getCacheDirForBaseURL(self, baseurl):
- """Construct the path of the cache directory for the given base URL.
- This directory doesn't need to exist.
- """
-
- return os.path.join(self.cachedir,
- md5(baseurl.encode('utf-8')).hexdigest()[:8])
-
- def _getCachedImagePath(self, baseurl, name, size=None, makedirs=False):
- """Construct a filename for an image with the given parameters inside
- the cache directory. The file doesn't need to exist. If makedirs is True
- create all directories up to filename.
- """
-
- urlpart = self._getCacheDirForBaseURL(baseurl)
- if size is not None:
- sizepart = '%dpx' % size
- else:
- sizepart = 'orig'
-
- if name.lower().endswith('.svg'):
- if size is None:
- log.warn('Cannot get SVG image when no size is given')
- return None
- name += '.png'
- if name.lower().endswith('.gif'):
- name += '.png'
- name = (name[0].upper() + name[1:]).replace(' ', '_').replace("'", "-")
-
- d = os.path.join(urlpart, sizepart)
- if makedirs and not os.path.isdir(d):
- os.makedirs(d)
- return os.path.join(d, utils.fsescape(name))
-
- def _fetchImage(self, name):
- """Fetch image with given name in original (i.e. biggest) size per HTTP.
-
- @returns: filename of written image and base URL used to retrieve the
- image or (None, None) if the image could not be fetched
- @rtype: (basestring, str) or (NoneType, NoneType)
- """
-
- for baseurl in self.baseurls:
- path = self._fetchImageFromBaseURL(baseurl, name)
- if path:
- return path, baseurl
- return None, None
-
- def _getImageURLForBaseURL(self, baseurl, name):
- """Construct a URL for the image with given name under given base URL"""
-
- hp = hashpath(name).encode('utf-8')
- return urllib.basejoin(baseurl, urllib.quote(hp))
-
- def _fetchImageFromBaseURL(self, baseurl, name):
- """Fetch image with given name under given baseurl and write it to a
- tempfile.
-
- @returns: filename of written image or None if image could not be fetched
- @rtype: basestring or NoneType
- """
-
- url = self._getImageURLForBaseURL(baseurl, name)
- log.info("fetching %r" % (url,))
- opener = urllib2.build_opener()
- opener.addheaders = [('User-agent', 'mwlib')]
- try:
- data = opener.open(url).read()
- log.info("got image: %r" % url)
- fd, filename = tempfile.mkstemp()
- os.write(fd, data)
- os.close(fd)
- return filename
- except urllib2.URLError, err:
- log.error("%s - while fetching %r" % (err, url))
- return None
-
- def _convertToCache(self, srcfile, baseurl, name, size=None):
- """Convert image in file named srcfile to have the given maximum size.
- Save the converted image in the cache directory for the given baseurl.
-
- @returns: filename of converted image
- @rtype: basestring
- """
- destfile = self._getCachedImagePath(baseurl, name, size=size, makedirs=True)
- if size is not None:
- thumbnail = '-thumbnail "%dx%d>"' % (size, size)
- else:
- thumbnail = '-strip'
-
- opts = '-background white -density 100 -flatten -coalesce %(thumbnail)s' % {
- 'thumbnail': thumbnail,
- }
- cmd = "%(convert)s %(opts)s '%(src)s[0]' '%(dest)s'" % {
- 'convert': self.convert_command,
- 'opts': opts,
- 'src': srcfile,
- 'dest': destfile,
- }
- log.info('executing %r' % cmd)
- rc = utils.shell_exec(cmd)
- if rc != 0:
- log.error('Could not convert %r: convert returned %d' % (name, rc))
- return None
-
- return destfile
-
-
-# ==============================================================================
-
-def normname(name):
- name = name.strip().replace("_", " ")
- name = name[:1].upper()+name[1:]
- return name
-
-
-class NetDB(object):
- redirect_rex = re.compile(r'^#Redirect:?\s*?\[\[(?P<redirect>.*?)\]\]', re.IGNORECASE)
-
- def __init__(self, pagename,
- imagedescriptionurls=None,
- templateurls=None,
- templateblacklist=None,
- defaultauthors=None,
- ):
- """
- @param pagename: URL to page in wikitext format. @TITLE@ gets replaced
- with the page name and @REVISION@ gets replaced with the requested
- revision/oldid. E.g.
-
- "http://mw/index.php?title=@TITLE@&action=raw&oldid=@TITLE@"
-
- @type pagename: str
-
- @param imagedescriptionurls: list of URLs to image description pages in
- wikitext format. @TITLE@ gets replaced with the image title w/out
- its prefix. E.g.
-
- ["http://mw/index.php?title=Image:@TITLE@s&action=raw"]
-
- The list must be of the same length as the baseurl list of the
- accompanying ImageDB, and the URL with the corresponding position
- in the list is used to retrieve the description page.
- @type imagedescriptionurls: [str]
-
- @param templateurls: list of URLs to template pages in wikitext format.
- @TITLE@ gets replaced with the template title. E.g.
-
- ["http://mw/index.php?title=Template:@TITLE@s&action=raw"]
-
- If more than one URL is specified, URLs are tried in given order.
- @type templateurls: [str]
-
- @param defaultauthors: list of default (principal) authors for articles
- @type defaultauthors: [unicode]
- """
-
- self.pagename = pagename.replace("%", "%%").replace("@TITLE@", "%(NAME)s").replace("@REVISION@", "%(REVISION)s")
-
- if templateurls is None:
- templateurls = []
- self.templateurls = [x.replace("%", "%%").replace("@TITLE@", "%(NAME)s")
- for x in templateurls]
-
- if imagedescriptionurls is None:
- imagedescriptionurls = []
- self.imagedescriptionurls = [x.replace("%", "%%").replace("@TITLE@", "%(NAME)s")
- for x in imagedescriptionurls]
-
- if templateblacklist:
- self.templateblacklist = self._readTemplateBlacklist(templateblacklist)
- else:
- self.templateblacklist = []
-
- if defaultauthors:
- self.defaultauthors = defaultauthors
- else:
- self.defaultauthors = []
-
- self.pages = {}
-
- def _getpage(self, url, expectedContentType='text/x-wiki'):
- try:
- return self.pages[url]
- except KeyError:
- pass
-
- stime=time.time()
- response = urllib.urlopen(url)
- data = response.read()
- log.info('fetched %r in %ss' % (url, time.time()-stime))
-
- if expectedContentType:
- ct = response.info().gettype()
- if ct != expectedContentType:
- log.warn('Skipping page %r with content-type %r (%r was expected). Skipping.'\
- % (url, ct, expectedContentType))
- return None
-
- self.pages[url] = data
- return data
-
- def _readTemplateBlacklist(self,templateblacklist):
- if not templateblacklist:
- return []
- try:
- content = urllib.urlopen(templateblacklist).read()
- return [template.lower().strip() for template in re.findall('\* *\[\[.*?:(.*?)\]\]', content)]
- except: # fixme: more sensible error handling...
- log.error('Error fetching template blacklist from url:', templateblacklist)
- return []
-
- def _dummy(self, *args, **kwargs):
- pass
-
- startCache = _dummy
-
- def getURL(self, title, revision=None):
- name = urllib.quote(title.replace(" ", "_").encode('utf8'))
- if revision is None:
- return self.pagename % dict(NAME=name, REVISION='0')
- else:
- return self.pagename % dict(NAME=name, REVISION=revision)
-
- def getAuthors(self, title, revision=None):
- return list(self.defaultauthors)
-
- def title2db(self, title):
- assert isinstance(title, unicode), 'title must be of type unicode'
- return title.encode('utf-8')
-
- def db2title(self, dbtitle):
- assert isinstance(dbtitle, str), 'dbtitle must be of type str'
- return unicode(dbtitle, 'utf-8')
-
- def getImageDescription(self, title, urlIndex=0):
- """Fetch the image description page for the image with the given title.
- If baseurl and self.imagedescriptions contains more than one URL, use
- the one which starts with baseurl.
-
- @param title: title of the image w/out prefix (like Image:)
- @type title: unicode
-
- @param urlIndex: index for imagedescriptionurls
- @type urlIndex: int
-
- @returns: wikitext of image description page or None
- @rtype: unicode or None
- """
-
- if not self.imagedescriptionurls:
- return None
-
- raw = self._getpage(self.imagedescriptionurls[urlIndex] % {
- 'NAME': urllib.quote(title.replace(" ", "_").encode('utf8')),
- })
- if raw is None:
- return None
-
- return unicode(raw, 'utf-8')
-
- def getTemplate(self, name, followRedirects=False):
- if ":" in name:
- name = name.split(':', 1)[1]
-
-
- if name.lower() in self.templateblacklist:
- log.info("ignoring blacklisted template:" , repr(name))
- return None
- name = urllib.quote(name.replace(" ", "_").encode('utf8'))
- for u in self.templateurls:
- url = u % dict(NAME=name)
- log.info("Trying %r" %(url,))
- c=self._getpage(url)
- if c:
- log.info("got content from", url)
- res=unicode(c, 'utf8')
- mo = self.redirect_rex.search(res)
- if mo:
- redirect = mo.group('redirect')
- redirect = normname(redirect.split("|", 1)[0].split("#", 1)[0])
- return self.getTemplate(redirect)
- return res
-
-
-
-
- #return self.getRawArticle(u'Template:%s' % name)
-
- def getRawArticle(self, title, revision=None):
- r = self._getpage(self.getURL(title, revision=revision))
- if r is None:
- return None
- return unicode(r, 'utf8')
-
- def getRedirect(self, title):
- return u""
-
- def getParsedArticle(self, title, revision=None):
- raw = self.getRawArticle(title, revision=revision)
- if raw is None:
- return None
- a = uparser.parseString(title=title, raw=raw, wikidb=self)
- return a
-
-
-class Overlay(NetDB):
- def __init__(self, wikidb, templates):
- self.__dict__.update(wikidb.__dict__)
- self.overlay_templates = templates
-
- def getTemplate(self, name, followRedirects=False):
- try:
- return self.overlay_templates[name]
- except KeyError:
- pass
-
- return super(Overlay, self).getTemplate(name, followRedirects=followRedirects)
-
diff --git a/mwlib/overlay.py b/mwlib/overlay.py
deleted file mode 100644
index 68c4774..0000000
--- a/mwlib/overlay.py
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import os
-
-class OverlayDB(object):
- def __init__(self, db, basedir):
- self.db = db
- self.basedir = basedir
-
- def getRawArticle(self, title):
- p = os.path.join(self.basedir, title)
- if os.path.isfile(p):
- return unicode(open(p, 'rb').read(), 'utf-8')
- return self.db.getRawArticle(title)
-
- def getTemplate(self, title, followRedirects=False):
- p = os.path.join(self.basedir, title)
- if os.path.isfile(p):
- return unicode(open(p, 'rb').read(), 'utf-8')
- return self.db.getTemplate(title, followRedirects=followRedirects)
diff --git a/mwlib/parser.py b/mwlib/parser.py
deleted file mode 100755
index fd27750..0000000
--- a/mwlib/parser.py
+++ /dev/null
@@ -1,1418 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import sys
-import os
-import re
-
-from mwlib.scanner import tokenize, TagToken, EndTagToken
-from mwlib.log import Log
-
-log = Log("parser")
-
-
-tag_li = TagToken("li")
-tag_div = TagToken("div")
-
-class TokenSet(object):
- def __init__(self, lst):
- self.types = set()
- self.values = set()
-
- for x in lst:
- if isinstance(x, type):
- self.types.add(x)
- else:
- self.values.add(x)
-
- def __contains__(self, x):
- return x in self.values or type(x) in self.types
-
-FirstAtom = TokenSet(['TEXT', 'URL', 'SPECIAL', '[[', 'MATH', '\n',
- 'BEGINTABLE', 'STYLE', 'TIMELINE', 'ITEM', 'URLLINK',
- TagToken])
-
-FirstParagraph = TokenSet(['SPECIAL', 'URL', 'TEXT', 'TIMELINE', '[[', 'STYLE', 'BEGINTABLE', 'ITEM',
- 'PRE', 'MATH', '\n', 'PRE', 'EOLSTYLE', 'URLLINK',
- TagToken])
-
-
-def show(out, node, indent=0):
- print >>out, " "*indent, node
- for x in node:
- show(out, x, indent+1)
-
-
-paramrx = re.compile("(?P<name>\w+) *= *(?P<value>(?:(?:\".*?\")|(?:(?:\w|[%:])+)))")
-def parseParams(s):
- def style2dict(s):
- res = {}
- for x in s.split(';'):
- if ':' in x:
- var, value = x.split(':', 1)
- var=var.strip()
- value = value.strip()
- res[var] = value
-
- return res
-
- def maybeInt(v):
- try:
- return int(v)
- except:
- return v
-
- r = {}
- for name, value in paramrx.findall(s):
- if value.startswith('"'):
- value = value[1:-1]
-
- if name=='style':
- value = style2dict(value)
- r['style'] = value
- else:
- r[name] = maybeInt(value)
- return r
-
-
-
-
-class Node(object):
- caption = ''
-
- def __init__(self, caption=''):
- self.children = []
- self.caption = caption
-
- def hasContent(self):
- for x in self.children:
- if x.hasContent():
- return True
- return False
-
- def append(self, c, merge=False):
- if c is None:
- return
-
- if merge and type(c)==Text and self.children and type(self.children[-1])==Text:
- self.children[-1].caption += c.caption
- else:
- self.children.append(c)
-
- def __iter__(self):
- for x in self.children:
- yield x
-
- def __repr__(self):
- return "%s %r: %s children" % (self.__class__.__name__, self.caption, len(self.children))
-
- def __eq__(self, other):
- return (isinstance(other, self.__class__)
- and self.caption == other.caption
- and self.children == other.children)
-
- def __ne__(self, other):
- return not(self==other)
-
- def allchildren(self): # name is broken, returns self, which is not a child
- yield self
- for c in self.children:
- for x in c.allchildren():
- yield x
-
- def find(self, tp):
- """find instances of type tp in self.allchildren()"""
- return [x for x in self.allchildren() if isinstance(x, tp)]
-
-
- def filter(self, fun):
- for x in self.allchildren():
- if fun(x):
- yield x
-
- def _asText(self, out):
- out.write(self.caption)
- for x in self.children:
- x._asText(out)
-
- def asText(self, ):
- from StringIO import StringIO
- out = StringIO()
- self._asText(out)
- return out.getvalue()
-
-class Math(Node): pass
-class Ref(Node): pass
-class Item(Node): pass
-class ItemList(Node):
- numbered = False
- def append(self, node, merge=False):
- if not isinstance(node, Item):
- c=Item()
- c.append(node)
- self.children.append(c)
- else:
- self.children.append(node)
-
-class Style(Node): pass
-class Book(Node): pass
-class Magic(Node): pass
-class Chapter(Node): pass
-class Article(Node): pass
-class Paragraph(Node): pass
-class Section(Node): pass
-class Timeline(Node): pass
-class TagNode(Node): pass
-class PreFormatted(TagNode): pass
-class URL(Node): pass
-class NamedURL(Node): pass
-
-
-
-class _VListNode(Node):
- def __init__(self, caption=''):
- Node.__init__(self, caption)
- self.vlist = {}
-
- def __repr__(self):
- return "%s %r %s: %s children" % (self.__class__.__name__, self.caption, self.vlist, len(self.children))
-
-class Table(_VListNode):
- pass
-
-class Row(_VListNode):
- pass
-
-class Cell(_VListNode):
- pass
-
-class Caption(_VListNode):
- pass
-
-class Link(Node):
- target = None
-
- specialPrefixes = set([
- # English
- "wikipedia", "wiktionary", "wikibooks", "wikisource", "wikiquote", "meta", "talk",
- "commons", "wikinews", "template", "wikitravel", "help",
- # German
- "vorlage",
- # Spanish
- ])
-
- imageKeywords = set([
- "image", "imagen", "bild"
- ])
-
- categoryKeywords = set([
- "category", "kategorie"
- ])
-
- from mwlib.lang import languages
- colon = False
-
- def hasContent(self):
- if self.target:
- return True
- return False
-
- def _specialize(self):
- if not self.children:
- return
-
- if type(self.children[0]) != Text:
- return
-
- self.target = target = self.children[0].caption.strip()
- del self.children[0]
- if self.children and self.children[0] == Control("|"):
- del self.children[0]
-
- pic = self.target
- if pic.startswith(':'):
- self.colon = True
-
-
-
- # pic == "Bild:Wappen_von_Budenheim.png"
-
- pic = pic.strip(': ')
- if ':' not in pic:
- return
-
- linktype, pic = pic.split(':', 1)
- linktype = linktype.lower().strip(" :")
-
- if linktype in self.categoryKeywords:
- self.__class__ = CategoryLink
- self.target = pic.strip()
- return
-
- if linktype in self.specialPrefixes:
- self.__class__ = SpecialLink
- self.target = pic.strip()
- self.ns = linktype
-
- return
-
- if linktype in self.languages:
- self.__class__ = LangLink
- return
-
-
- if linktype not in self.imageKeywords:
- # assume a LangLink
- log.info("Unknown linktype:", repr(linktype))
- if len(linktype)==2:
- self.__class__ = LangLink
- return
-
-
- # pic == "Wappen_von_Budenheim.png"
-
- # WTB: See es.wikipedia.org/wiki/Provincia_de_Lima
- #try:
- # prefix, suffix = pic.rsplit('.', 1)
- #except ValueError:
- # return
- #if suffix.lower() in ['jpg', 'jpeg', 'gif', 'png', 'svg']:
-
- self.__class__ = ImageLink
- self.target = pic.strip()
-
-
-
- idx = 0
- last = []
-
- while idx<len(self.children):
- x = self.children[idx]
- if x == Control("|"):
- if idx:
- last = self.children[:idx]
-
- del self.children[:idx+1]
- idx = 0
- continue
-
- if not type(x)==Text:
- idx += 1
- continue
-
- x = x.caption.lower()
-
- if x == 'thumb' or x=='thumbnail':
- self.thumb = True
- del self.children[idx]
- continue
-
- if x in ['left', 'right', 'center', 'none']:
- self.align = x
- del self.children[idx]
- continue
-
- if x == 'frame' or x=='framed' or x=='enframed':
- self.frame = True
- del self.children[idx]
- continue
-
-
- if x.endswith('px'):
- # x200px
- # 100x200px
- # 200px
- x = x[:-2]
- width, height = (x.split('x')+['0'])[:2]
- try:
- width = int(width)
- except ValueError:
- width = 0
-
- try:
- height = int(height)
- except ValueError:
- height = 0
-
- self.width = width
- self.height = height
- del self.children[idx]
- continue
-
- idx += 1
-
- if not self.children:
- self.children = last
-
-class ImageLink(Link):
- target = None
- width = None
- height = None
- align = ''
- thumb = False
- frame = False
-
- def isInline(self):
- return not bool(self.align or self.thumb or self.frame)
-
-class LangLink(Link):
- pass
-
-class CategoryLink(Link):
- pass
-
-class SpecialLink(Link):
- pass
-
-
-class Text(Node):
- def __repr__(self):
- return repr(self.caption)
-
- def __init__(self, txt):
- self.caption = txt
- self.children = []
-
- def hasContent(self):
- if self.caption.strip():
- return True
- return False
-
-class Control(Text):
- pass
-
-def _parseAtomFromString(s):
- from mwlib import scanner
- tokens = scanner.tokenize(s)
- p=Parser(tokens)
- try:
- return p.parseAtom()
- except Exception, err:
- log.error("exception while parsing %r: %r" % (s, err))
- return None
-
-
-
-def parse_fields_in_imagemap(imap):
-
- if imap.image:
- imap.imagelink = _parseAtomFromString(u'[['+imap.image+']]')
- if not isinstance(imap.imagelink, ImageLink):
- imap.imagelink = None
-
- # FIXME: the links of objects inside 'entries' array should also be parsed
-
-
-def append_br_tag(node):
- """append a self-closing 'br' TagNode"""
- br = TagNode("br")
- br.starttext = '<br />'
- br.endtext = ''
- node.append(br)
-
-class Parser(object):
- def __init__(self, tokens, name=''):
- self.tokens = tokens
- self.pos = 0
- self.name = name
- self.lastpos = 0
- self.count = 0
-
- @property
- def token(self):
- t=self.tokens[self.pos]
- if self.pos == self.lastpos:
- self.count += 1
- if self.count > 500:
- from mwlib.caller import caller
-
- raise RuntimeError("internal parser error: %s" % ((self.pos, t, caller()), ))
- else:
- self.count = 0
- self.lastpos = self.pos
-
-
- return t
-
-
-
- @property
- def left(self):
- return self.pos < len(self.tokens)
-
- def next(self):
- self.pos += 1
-
- def parseAtom(self):
- token = self.token
-
- if token[0]=='TEXT':
- self.next()
- return Text(token[1])
- elif token[0]=='URL':
- self.next()
- return URL(token[1])
- elif token[0]=='URLLINK':
- return self.parseUrlLink()
- elif token[0]=='SPECIAL':
- self.next()
- return Text(token[1])
- elif token[0]=='[[':
- return self.parseLink()
- elif token[0]=='MATH':
- return self.parseMath()
- elif token[0]=='\n':
- self.next()
- return Text(token[1])
- elif token[0]=='BEGINTABLE':
- return self.parseTable()
- elif token[0]=='STYLE':
- return self.parseStyle()
- elif token[0]=='TIMELINE':
- return self.parseTimeline()
- elif token[0]=='ITEM':
- return self.parseItemList()
- elif isinstance(token[0], TagToken):
- return self.parseTagToken()
- else:
- raise RuntimeError("not handled: %s" % (token,))
-
- def parseUrlLink(self):
- u = self.token[1][1:]
- n = Node()
- n.append(Text("["))
- n.append(URL(u))
-
- self.next()
-
- while self.left:
- if self.tokens[self.pos:self.pos+2] == [(']]', ']]'), ('SPECIAL', u']')]:
- self.tokens[self.pos:self.pos+2] = [('SPECIAL', ']'), (']]', ']]')]
-
- token = self.token
-
-
- if token[0] == 'SPECIAL' and token[1]==']':
- self.next()
- n.__class__ = NamedURL
- n.caption = u
- del n.children[:2]
- break
- elif token[0] in FirstAtom:
- n.append(self.parseAtom())
- else:
- break
-
- return n
-
-
- def parseArticle(self):
- a=Article(self.name)
-
- while self.left:
- token = self.token
- if token[0] == 'SECTION':
- a.append(self.parseSection())
- elif token[0]=='BREAK':
- self.next()
- elif token[0] in FirstParagraph:
- a.append(self.parseParagraph())
- else:
- log.info("in parseArticle: skipping", token)
- self.next()
-
- return a
-
- def parseLink(self):
- break_at = TokenSet(['BREAK', EndTagToken, 'SECTION'])
-
- obj = Link()
- self.next()
- while self.left:
- token = self.token
- if token[0] == ']]':
- self.next()
- break
- elif token[0]=='SPECIAL' and token[1]==']':
- self.next()
- break
- elif token[1] == '|' or token[1]=="||":
- obj.append(Control('|'))
- self.next()
- elif token[0]=='TEXT' or token[0]=='SPECIAL' or token[0]=='\n':
- obj.append(Text(token[1]), merge=True)
- self.next()
- elif token[0] in break_at:
- break
- elif token[0] in FirstAtom:
- obj.append(self.parseAtom())
- elif token[1].startswith("|"):
- obj.append(Control("|"))
- obj.append(Text(token[1][1:]))
- self.next()
- else:
- log.info("assuming text in parseLink", token)
- obj.append(Text(token[1]), merge=True)
- self.next()
-
- obj._specialize()
-
- return obj
-
- def parseTag(self):
- token = self.token[0]
-
- n = TagNode(token.t)
- if token.values:
- n.values = token.values
- n.vlist = parseParams(self.token[1])
-
- n.starttext = token.text
- n.endtext = u'</%s>' % token.t
- self.next()
-
- if token.selfClosing:
- return n
-
-
- end = EndTagToken(token.t)
-
- while self.left:
- token = self.token
- if token[0]==end:
- n.endtext = token[0].text
- self.next()
- break
- elif token[0]=='BREAK':
- self.next()
- else:
- if token[0] not in FirstParagraph:
- log.warn("tag not closed", n, token)
- break
- n.append(self.parseParagraph())
-
- return n
-
- def parsePRETag(self):
- token = self.token[0]
- if token.t.lower()=='pre':
- n=PreFormatted()
- else:
- n=TagNode(token.t)
- n.starttext = ''
- n.endtext = ''
-
- n.vlist = parseParams(self.token[1])
-
- end = EndTagToken(self.token[0].t)
- self.next()
-
- txt = []
- while self.left:
- token = self.token
- if token[0]==end:
- self.next()
- break
- txt.append(token[1])
- self.next()
-
- n.append(Text("".join(txt)))
- return n
-
- parseCODETag = parsePRETag
- parseSOURCETag = parsePRETag
- def parseA7831D532A30DF0CD772BBC895944EC1Tag(self):
- p = self.parseTag()
- p.__class__ = Magic
- return p
-
- parseREFTag = parseTag
- parseREFERENCESTag = parseTag
-
- parseDIVTag = parseTag
- parseSPANTag = parseTag
- parseINDEXTag = parseTag
- parseTTTag = parseTag
-
- parseH1Tag = parseTag
- parseH2Tag = parseTag
- parseH3Tag = parseTag
- parseH4Tag = parseTag
- parseH5Tag = parseTag
- parseH6Tag = parseTag
-
- parseINPUTBOXTag = parseTag
-
- parseRSSTag = parseTag
-
- parseSTRIKETag = parseTag
- parseCODETag = parseTag
- parseDELTag = parseTag
- parseINSTag = parseTag
- parseCENTERTag = parseTag
- parseSTARTFEEDTag = parseTag
- parseENDFEEDTag = parseTag
- parseCENTERTag = parseTag
-
- def parseGALLERYTag(self):
- node = self.parseTag()
- txt = "".join(x.caption for x in node.find(Text))
- #print "GALLERY:", repr(txt)
-
- children=[]
-
- lines = [x.strip() for x in txt.split("\n")]
- for x in lines:
- if not x:
- continue
-
- # either image link or text inside
- # FIXME: Styles and links in text are ignored!
- n=_parseAtomFromString(u'[['+x+']]')
-
- if isinstance(n, ImageLink):
- children.append(n)
- else:
- children.append(Text(x))
-
- node.children=children
-
- return node
-
- def parseIMAGEMAPTag(self):
- node = self.parseTag()
- txt = "".join(x.caption for x in node.find(Text))
- #from mwlib import imgmap
- #node.imagemap = imgmap.ImageMapFromString(txt)
-
- class FakeImageMap(object):
- pass
-
- node.imagemap = FakeImageMap()
- node.imagemap.entries = []
- node.imagemap.imagelink = None
- match = re.search('Image:.*', txt)
-
- if match:
- node.imagemap.image = match.group(0)
- else:
- node.imagemap.image = None
-
- parse_fields_in_imagemap(node.imagemap)
-
- #print node.imagemap
- return node
-
- def parseSection(self):
- s = Section()
-
- level = self.token[1].count('=')
- s.level = level
- closelevel = 0
-
- self.next()
-
- title = Node()
- while self.left:
- token = self.token
-
- if token[0] == 'ENDSECTION':
- closelevel = self.token[1].count('=')
- self.next()
- break
- elif token[0] == '[[':
- title.append(self.parseLink())
- elif token[0] == "STYLE":
- title.append(self.parseStyle())
- elif token[0] == 'TEXT':
- self.next()
- title.append(Text(token[1]))
- elif isinstance(token[0], TagToken):
- title.append(self.parseTagToken())
- elif token[0] == 'URLLINK':
- title.append(self.parseUrlLink())
- elif token[0] == 'MATH':
- title.append(self.parseMath())
- else:
- self.next()
- title.append(Text(token[1]))
-
- s.level = min(level, closelevel)
- if s.level==0:
- title.children.insert(0, Text("="*level))
- s.__class__ = Node
- else:
- diff = closelevel-level
- if diff>0:
- title.append(Text("="*diff))
- elif diff<0:
- title.children.insert(0, Text("="*(-diff)))
-
- s.append(title)
-
-
- while self.left:
- token = self.token
- if token[0] == 'SECTION':
- if token[1].count('=') <= level:
- return s
-
- s.append(self.parseSection())
- elif token[0] in FirstParagraph:
- s.append(self.parseParagraph())
- else:
- log.info("in parseSection: skipping", token)
- break
-
- return s
-
- def parseStyle(self):
- end = self.token[1]
- b = Style(self.token[1])
- self.next()
-
- break_at = TokenSet(['BREAK', '\n', 'ENDEOLSTYLE', 'SECTION', 'ENDSECTION',
- 'BEGINTABLE', ']]', 'ROW', 'COLUMN', 'ENDTABLE', EndTagToken])
-
- while self.left:
- token = self.token
- if token[0]=="STYLE":
- if token[1]==end:
- self.next()
- break
- else:
- new = token[1]
- if end=="'''''":
- if token[1]=="''":
- new = "'''"
- else:
- new = "''"
- elif end=="''":
- if token[1]=="'''":
- new = "'''''"
- elif token[1]=="'''''":
- new = "'''"
- elif end=="'''":
- if token[1]=="''":
- new = "'''''"
- elif token[1]=="'''''":
- new = "''"
-
- self.tokens[self.pos] = ("STYLE", new)
- break
- elif token[0] in break_at:
- break
- elif token[0] in FirstAtom:
- b.append(self.parseAtom())
- else:
- log.info("assuming text in parseStyle", token)
- b.append(Text(token[1]))
- self.next()
-
- return b
-
-
- def parseColumn(self):
- token = self.token
- c = Cell()
-
- params = ''
- if "|" in token[1] or "!" in token[1]: # not a html cell
- # search for the first occurence of "||", "|", "\n" in the next tokens
- # if it's a "|" we have a parameter list
- self.next()
- savepos = self.pos
-
- while self.left:
- token = self.token
- self.next()
- if token[0] in ("\n", "BREAK", "[[", "ROW", "ENDTABLE"):
- params = ''
- self.pos = savepos
- break
- elif (token[0]=='SPECIAL' or token[0]=='COLUMN') and token[1]=='|':
- break
- params += token[1]
-
- c.vlist = parseParams(params)
-
- elif token[0]=='COLUMN': # html cell
- params=parseParams(token[1])
- #print "CELLTOKEN:", token
- #print "PARAMS:", params
- c.vlist = params
- self.next()
-
-
-
- while self.left:
- token = self.token
- if token[0] in ("COLUMN", "ENDTABLE", "ROW"):
- break
-
- if token[0] == 'BEGINTABLE':
- c.append(self.parseTable())
- elif token[0]=='SPECIAL' and token[1] == '|':
- self.next()
- elif token[0] == 'SECTION':
- c.append(self.parseSection())
- elif token[0] in FirstParagraph:
- c.append(self.parseParagraph())
- elif isinstance(token[0], EndTagToken):
- log.info("ignoring %r in parseColumn" % (token,))
- self.next()
- else:
- log.info("assuming text in parseColumn", token)
- c.append(Text(token[1]))
- self.next()
-
- return c
-
-
- def parseRow(self):
- r = Row()
- r.vlist={}
-
- token = self.token
- params = ''
- if token[0]=='ROW':
- self.next()
- if "|-" in token[1]:
- # everything till the next newline/break is a parameter list
- while self.left:
- token = self.token
- if token[0]=='\n' or token[0]=='BREAK':
- break
- else:
- params += token[1]
- self.next()
- r.vlist = parseParams(params)
-
- else:
- # html row
- r.vlist = parseParams(token[1])
-
-
- while self.left:
- token = self.token
- if token[0] == 'COLUMN':
- r.append(self.parseColumn())
- elif token[0] == 'ENDTABLE':
- return r
- elif token[0] == 'ROW':
- return r
- elif token[0] == 'BREAK':
- self.next()
- elif token[0]=='\n':
- self.next()
- else:
- log.warn("skipping in parseRow: %r" % (token,))
- self.next()
- return r
-
- def parseCaption(self):
- token = self.token
- self.next()
- n = Caption()
- params = ""
- if token[1].strip().startswith("|+"):
- # search for the first occurence of "||", "|", "\n" in the next tokens
- # if it's a "|" we have a parameter list
- savepos = self.pos
- while self.left:
- token = self.token
- self.next()
- if token[0] in ("\n", "BREAK", "[[", "ROW", "COLUMN", "ENDTABLE"):
- params = ''
- self.pos = savepos
- break
- elif token[0]=='SPECIAL' and token[1]=='|':
- break
- params += token[1]
-
- n.vlist = parseParams(params)
-
- while self.left:
- token = self.token
- if token[0] in ('TEXT' , 'SPECIAL', '\n'):
- if token[1]!='|':
- n.append(Text(token[1]))
- self.next()
- elif token[0] == 'STYLE':
- n.append(self.parseStyle())
- elif isinstance(token[0], TagToken):
- n.append(self.parseTagToken())
- elif token[0] == '[[':
- n.append(self.parseLink())
- else:
- break
- return n
-
- def parseTable(self):
- token = self.token
- self.next()
- t = Table()
-
- params = ""
- if "{|" in token[1]: # not a <table> tag
- # everything till the next newline/break is a parameter list
- while self.left:
- token = self.token
- if token[0]=='\n' or token[0]=='BREAK':
- break
- else:
- params += token[1]
- self.next()
- t.vlist = parseParams(params)
- else:
- t.vlist = parseParams(token[1])
-
- while self.left:
- token = self.token
- if token[0]=='ROW' or token[0]=='COLUMN':
- t.append(self.parseRow())
- elif token[0]=='TABLECAPTION':
- t.append(self.parseCaption())
- elif token[0]=='ENDTABLE':
- self.next()
- break
- elif token[0]=='\n':
- self.next()
- else:
- log.warn("skipping in parseTable", token)
- self.next()
- #t.append(self.parseRow())
-
- return t
-
- def parseMath(self):
- self.next()
- caption = u''
- while self.left:
- token = self.token
- self.next()
- if token[0]=='ENDMATH':
- break
- caption += token[1]
- return Math(caption)
-
- def parseTimeline(self):
- t=Timeline()
- self.next()
- snippets = []
- while self.left:
- token = self.token
- self.next()
- if token[0]=='TIMELINE':
- break
- snippets.append(token[1])
- t.caption = "".join(snippets)
- return t
-
- def parseEOLStyle(self):
- token = self.token
- maybe_definition = False
- if token[1]==';':
- p=Style(";")
- maybe_definition = True
- elif token[1].startswith(':'):
- p=Style(token[1])
- else:
- p=Style(":")
-
- assert p
- retval = p
-
- self.next()
-
- last = None
- # search for the newline and replace it with ENDEOLSTYLE
- for idx in range(self.pos, len(self.tokens)-1):
- if self.tokens[idx][0]=='BREAK' or self.tokens[idx][0]=='\n':
- last = idx, self.tokens[idx]
- self.tokens[idx] = ("ENDEOLSTYLE", self.tokens[idx][1])
- break
-
- break_at = TokenSet(['ENDEOLSTYLE', 'BEGINTABLE', 'BREAK', EndTagToken])
-
- while self.left:
- token = self.token
- if token[0] in break_at:
- break
- elif maybe_definition and token[1]==':':
- self.next()
- maybe_definition = False
- retval = Node()
- retval.append(p)
- p = Style(":")
- retval.append(p)
-
- elif token[0] in FirstAtom:
- p.append(self.parseAtom())
- else:
- log.info("in parseEOLStyle: assuming text", token)
- p.append(Text(token[1]))
- self.next()
-
- if last:
- self.tokens[last[0]] = last[1]
-
- return retval
-
- def parseParagraph(self):
- p = Node()
-
- while self.left:
- token = self.token
- if token[0]=='EOLSTYLE':
- p.append(self.parseEOLStyle())
- elif token[0]=='PRE':
- pre = self.parsePre()
- if pre is None:
- # empty line with spaces. handle like BREAK
- p.__class__ = Paragraph
- break
- p.append(pre)
- elif token[0] == 'BREAK':
- self.next()
- p.__class__ = Paragraph
- break
- elif token[0] == 'SECTION':
- p.__class__ = Paragraph
- break
- elif token[0] == 'ENDSECTION':
- p.append(Text(token[1]))
- self.next()
- elif token[0] in FirstAtom:
- p.append(self.parseAtom())
- else:
- break
-
- if not self.left:
- p.__class__ = Paragraph
-
- if p.children:
- return p
- else:
- return None
-
- def parseTagToken(self):
- tag = self.token[0].t
- try:
- m=getattr(self, 'parse'+tag.upper()+'Tag')
- except (AttributeError, UnicodeEncodeError):
- t=Text(self.token[1])
- self.next()
- return t
- else:
- return m()
-
- def parseEMTag(self):
- return self._parseStyledTag(Style("''"))
-
- def parseITag(self):
- return self._parseStyledTag(Style("''"))
-
- def parseBTag(self):
- return self._parseStyledTag(Style("'''"))
-
- def parseSTRONGTag(self):
- return self._parseStyledTag(Style("'''"))
-
- def parseBLOCKQUOTETag(self):
- return self._parseStyledTag(Style(":"))
-
- def _parseStyledTag(self, style=None):
-
- token = self.token[0]
- if style is None:
- style = Style(token.t)
-
- b = style
- end = EndTagToken(token.t)
- start = TagToken(token.t)
- self.next()
-
-
- if token.selfClosing:
- return style
-
- break_at = set(["ENDTABLE", "ROW", "COLUMN", "ITEM", "BREAK", "SECTION", "BEGINTABLE"])
-
- while self.left:
- token = self.token
- if token[0] in break_at:
- break
- elif token[0]=='\n':
- b.append(Text(token[1]))
- self.next()
- elif token[0]==end:
- self.next()
- break
- elif isinstance(token[0], EndTagToken):
- break
- elif isinstance(token[0], TagToken):
- if token[0]==start:
- self.next() # 'Nuclear fuel' looks strange otherwise
- break
- b.append(self.parseTagToken())
- elif token[0] in FirstAtom:
- b.append(self.parseAtom())
- else:
- log.info("_parseStyledTag: assuming text", token)
- b.append(Text(token[1]))
- self.next()
-
- return b
-
- parseVARTag = parseCITETag = parseSTag = parseSUPTag = parseSUBTag = parseBIGTag = parseSMALLTag = _parseStyledTag
-
- def parseBRTag(self):
- token = self.token[0]
- n = TagNode(token.t)
- n.starttext = token.text
- n.endtext = u''
- self.next()
- return n
-
- parseHRTag = parseBRTag
-
- def parseUTag(self):
- token = self.token
- if "overline" in self.token[1].lower():
- s = Style("overline")
- else:
- s = None
-
- return self._parseStyledTag(s)
-
- def parsePre(self):
- p = n = PreFormatted()
- token = self.token
- p.append(Text(token[1]))
-
- self.next()
-
- # find first '\n' not followed by a 'PRE' token
- last = None
- for idx in range(self.pos, len(self.tokens)-1):
- if self.tokens[idx][0] in ['ROW', 'COLUMN', 'BEGINTABLE', 'ENDTABLE', 'TIMELINE', 'MATH']:
- return None
-
- if self.tokens[idx][0]=='BREAK':
- break
-
- if self.tokens[idx][0]=='\n' and self.tokens[idx+1][0]!='PRE':
- last = idx, self.tokens[idx]
- self.tokens[idx]=('ENDPRE', '\n')
- break
-
-
- while self.left:
- token = self.token
- if token[0] == 'ENDPRE' or token[0]=='BREAK':
- break
- if token[0]=='\n' or token[0]=='PRE' or token[0]=='TEXT':
- p.append(Text(token[1]))
- self.next()
- elif token[0] == 'SPECIAL':
- p.append(Text(token[1]))
- self.next()
- elif isinstance(token[0], EndTagToken):
- break
- elif isinstance(token[0], TagToken):
- if token[0] == tag_div:
- break
-
- p.append(self.parseTagToken())
- elif token[0] in FirstAtom:
- p.append(self.parseAtom())
- else:
- log.info("in parsePre: assuming text", token)
- p.append(Text(token[1]))
- self.next()
-
- if last:
- self.tokens[last[0]] = last[1]
-
- for x in p:
- if not isinstance(x, Text):
- return p
- if x.caption.strip():
- return p
-
- return None
-
-
-
- def parseOLTag(self):
- numbered = parseParams(self.token[1]).get('type', '1')
- return self._parseHTMLList(numbered)
-
- def parseULTag(self):
- return self._parseHTMLList(False)
-
- def parseLITag(self):
- p = item = Item()
- self.next()
- break_at = TokenSet([EndTagToken, 'ENDTABLE', 'SECTION'])
- while self.left:
- token = self.token
- if token[0] == '\n':
- p.append(Text(token[1]))
- self.next()
- elif token[0] == 'EOLSTYLE':
- p.append(self.parseEOLStyle())
- elif token[0]=='BREAK':
- append_br_tag(p)
- self.next()
- elif token[0]==tag_li:
- break
- elif token[0]==EndTagToken("li"):
- self.next()
- break
- elif token[0] in break_at:
- break
- elif token[0] in FirstAtom:
- p.append(self.parseAtom())
- else:
- log.info("in parseLITag: assuming text", token)
- p.append(Text(token[1]))
- self.next()
-
- return item
-
-
- def _parseHTMLList(self, numbered):
- lst = ItemList()
- lst.numbered = numbered
-
- end = EndTagToken(self.token[0].t)
-
- self.next()
- while self.left:
- token = self.token
- if token[0]==end:
- self.next()
- break
- elif isinstance(token[0], TagToken):
- lst.append(self.parseTagToken())
- elif token[0]=='ITEM':
- lst.append(self.parseItemList())
- elif token[0] in FirstAtom:
- lst.append(self.parseAtom())
- else:
- log.info("assuming text in _parseHTMLList", token)
- lst.append(Text(token[1]))
- self.next()
-
- return lst
-
-
- def parseItemList(self):
- # actually this parses multiple nested item lists..
- items = []
- while self.left:
- token = self.token
- if token[0]=='ITEM':
- items.append(self.parseItem())
- else:
- break
-
- # hack
- commonprefix = lambda x,y : os.path.commonprefix([x,y])
-
- current_prefix = u''
- stack = [Node()]
-
- def append_item(parent, node):
- if parent is stack[0]:
- parent.append(node)
- return
-
- if not parent.children:
- parent.children.append(Item())
-
- parent.children[-1].append(node)
-
- for item in items:
- prefix = item.prefix.strip(":")
- common = commonprefix(current_prefix, item.prefix)
-
- stack = stack[:len(common)+1]
-
- create = prefix[len(common):]
- for x in create:
- itemlist = ItemList()
- itemlist.numbered = (x=='#')
- append_item(stack[-1], itemlist)
- stack.append(itemlist)
- stack[-1].append(item)
- current_prefix = prefix
-
- return stack[0]
-
- def parseItem(self):
- p = item = Item()
- p.prefix = self.token[1]
-
- self.token[1]
- break_at = TokenSet(["ENDTABLE", "COLUMN", "ROW"])
-
- self.next()
- while self.left:
- token = self.token
-
- if token[0] == '\n':
- self.next()
- break
- elif token[0]=='BREAK':
- break
- elif token[0]=='SECTION':
- break
- elif isinstance(token[0], EndTagToken):
- break
- elif token[0] in break_at:
- break
- elif token[0] in FirstAtom:
- p.append(self.parseAtom())
- else:
- log.info("in parseItem: assuming text", token)
- p.append(Text(token[1]))
- self.next()
- return item
-
-
- def parse(self):
- log.info("Parsing", repr(self.name))
- try:
- return self.parseArticle()
- except Exception, err:
- log.error("error while parsing article", repr(self.name), repr(err))
- raise
-
-def main():
- #import htmlwriter
- from mwlib.dummydb import DummyDB
- db = DummyDB()
-
- for x in sys.argv[1:]:
- input = unicode(open(x).read(), 'utf8')
- from mwlib import expander
- te = expander.Expander(input, pagename=x, wikidb=db)
- input = te.expandTemplates()
-
-
- tokens = tokenize(input, x)
-
- p=Parser(tokens, os.path.basename(x))
- r = p.parse()
-
- show(sys.stdout, r, 0)
-
- #hw = htmlwriter.HTMLWriter(htmlout)
-
-if __name__=="__main__":
- main()
diff --git a/mwlib/recorddb.py b/mwlib/recorddb.py
deleted file mode 100755
index fe895cf..0000000
--- a/mwlib/recorddb.py
+++ /dev/null
@@ -1,83 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import simplejson
-import zipfile
-from mwlib import uparser, parser
-import mwlib.log
-log = mwlib.log.Log("zip")
-
-
-class RecordDB(object):
- def __init__(self, db):
- assert db is not None, "db must not be None"
- self.db = db
- self.articles = {}
- self.templates = {}
-
- def getRawArticle(self, name, revision=None):
- r = self.db.getRawArticle(name, revision=revision)
- self.articles[name] = {
- 'revision': revision,
- 'content-type': 'text/x-wiki',
- 'content': r,
- 'url': self.db.getURL(name, revision=revision),
- 'authors': self.db.getAuthors(name, revision=revision),
- }
- return r
-
- def getTemplate(self, name, followRedirects=False):
- r = self.db.getTemplate(name, followRedirects=followRedirects)
- self.templates[name] = {
- 'content-type': 'text/x-wiki',
- 'content': r,
- }
- return r
-
-
-class ZipfileCreator(object):
- def __init__(self, zf, wikidb=None, imgdb=None):
- self.zf = zf
- self.db = RecordDB(wikidb)
- self.images = {}
- self.imgdb = imgdb
-
- def addObject(self, name, value):
- """
- @type name: unicode
-
- @type value: str
- """
-
- self.zf.writestr(name.encode('utf-8'), value)
-
- def addArticle(self, title, revision=None):
- a = uparser.parseString(title, revision=revision, wikidb=self.db)
- for x in a.allchildren():
- if isinstance(x, parser.ImageLink):
- name = x.target
- self.images[name] = {}
-
- def writeImages(self, size=None):
- if self.imgdb is None:
- return
-
- for name in sorted(self.images.keys()):
- dp = self.imgdb.getDiskPath(name, size=size)
- if dp is None:
- continue
- self.zf.write(dp, (u"images/%s" % name.replace("'", '-')).encode("utf-8"))
- self.images[name]['url'] = self.imgdb.getURL(name, size=size)
- license = self.imgdb.getLicense(name)
- if license:
- self.images[name]['license'] = license
-
- def writeContent(self):
- self.addObject('content.json', simplejson.dumps(dict(
- articles=self.db.articles,
- templates=self.db.templates,
- images=self.images,
- )))
-
diff --git a/mwlib/rendermath.py b/mwlib/rendermath.py
deleted file mode 100755
index 10d6cdd..0000000
--- a/mwlib/rendermath.py
+++ /dev/null
@@ -1,144 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import os
-import re
-try:
- from hashlib import md5
-except ImportError:
- from md5 import md5
-
-from mwlib import texmap
-import mwlib.log
-
-log = mwlib.log.Log("rendermath")
-
-latex = r"""
-%% %(ident)s
-\documentclass[%(fontsize)spt]{article}
-%(extra_header)s
-\usepackage{ucs}
-\usepackage{amsmath}
-\usepackage{amsfonts}
-\usepackage{amssymb}
-
-%% \newcommand{\R}[0]{\mathbb{R}}
-
-\def\Alpha{{A{}}}
-\def\Beta{{B{}}}
-\def\Epsilon{{E{}}}
-\def\Zeta{{Z{}}}
-\def\Eta{{H{}}}
-\def\Iota{{I{}}}
-\def\Kappa{{K{}}}
-\def\Mu{{M{}}}
-\def\Nu{{N{}}}
-\def\Rho{{P{}}}
-\def\Tau{{T{}}}
-\def\Chi{{C{}}}
-
-\usepackage[utf8x]{inputenc}
-\usepackage[dvips]{graphicx}
-\pagestyle{empty}
-\begin{document}
-%(source)s
-\end{document}
-"""
-
-
-
-
-
-
-def mysystem(cmd):
- err=os.system(cmd)
- if err:
- raise RuntimeError("exit code %s while running %r" % (err, cmd))
-
-class Renderer(object):
- basedir = os.path.expanduser("~/pngmath/")
-
- def __init__(self, basedir=None, lazy=True):
- if basedir:
- self.basedir = os.path.realpath(os.path.join(basedir, 'pngmath/'))
- if not os.path.exists(self.basedir):
- #os.makedirs(self.basedir)
- pass
- self.lazy = lazy
-
- def _render_file(self, name, format):
- assert format in ('pdf', 'png', 'eps'), "rendermath: format %r not supported" % format
-
- texfile = os.path.join(self.basedir, name+'.tex')
- srcbase = os.path.join(self.basedir, name)
-
- cwd = os.getcwd()
- os.chdir(self.basedir)
- try:
- mysystem("latex -interaction=batchmode %s" % texfile)
- mysystem("dvips -E %s.dvi -o %s.ps" % (srcbase, srcbase))
- if format=='png':
- mysystem("convert +adjoin -transparent white -density 300x300 %s.ps %s.png" % (srcbase, srcbase))
- elif format=='pdf':
- mysystem("epstopdf %s.ps" % srcbase)
- elif format=='eps':
- os.rename("%s.ps" % srcbase, "%s.eps" % srcbase)
- finally:
- for x in ['.dvi', '.aux', '.log', '.ps']:
- p = os.path.join(self.basedir, name+x)
- try:
- os.unlink(p)
- except OSError, err:
- pass
-
- os.chdir(cwd)
-
- def _normalizeLatex(self, latexsource):
- latexsource = re.compile("\n+").sub("\n", latexsource)
- return latexsource
-
- def convert(self, latexsource, lazy=True, format='pdf', addMathEnv=True):
- assert format in ('pdf', 'png', 'eps'), "rendermath: format %r not supported" % format
- latexsource = self._normalizeLatex(latexsource)
- if addMathEnv:
- latexsource = '$' + latexsource + '$'
- if format in ('pdf', 'eps'):
- extra_header = '\usepackage{geometry}\n\geometry{textwidth=3.0in}\n'
- fontsize = 10
- else:
- fontsize = 12
- extra_header = ''
-
- latexsource = texmap.convertSymbols(latexsource)
-
- source = latex % dict(source=latexsource,
- ident=format,
- fontsize=fontsize,
- extra_header=extra_header)
-
- m=md5()
- m.update(source)
- name = m.hexdigest()
-
- srcbase = os.path.join(self.basedir, name)
- texfile = os.path.join(self.basedir, name+'.tex')
- outfile = os.path.join(self.basedir, name+'.'+format)
-
- if os.path.exists(outfile):
- return outfile # FIXME
-
- open(texfile, 'w').write(source)
-
- if not lazy:
- self._render_file(name, format)
-
-
- return outfile
-
- def render(self, latexsource, lazy=None, addMathEnv=True):
- if lazy is None:
- lazy = self.lazy
- return self.convert(latexsource, lazy=lazy, format='png', addMathEnv=addMathEnv)
-
diff --git a/mwlib/resources/__init__.py b/mwlib/resources/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/mwlib/resources/__init__.py
+++ /dev/null
diff --git a/mwlib/resources/__init__.pyc b/mwlib/resources/__init__.pyc
deleted file mode 100644
index d46b5c5..0000000
--- a/mwlib/resources/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/mwlib/resources/outgoing_link.gif b/mwlib/resources/outgoing_link.gif
deleted file mode 100644
index d508fc4..0000000
--- a/mwlib/resources/outgoing_link.gif
+++ /dev/null
Binary files differ
diff --git a/mwlib/resources/pedia.css b/mwlib/resources/pedia.css
deleted file mode 100644
index 3e814ef..0000000
--- a/mwlib/resources/pedia.css
+++ /dev/null
@@ -1,1250 +0,0 @@
-/* ############# misc #################*/
-body, p, li, ul, a {
- margin:0px;
- padding:0px;
-}
-
-body {
- background-color:#F4F5E7;
- font-family:arial;
- font-size:10pt;
-}
-
-img {
- border:0;
- }
-
-* {
- font-size:10pt;
- }
-
-h1, h1 * {
- font-size:20pt;
- }
-
-h2, h2 * {
- font-size:14pt;
- }
-
-h3, h3 * {
- font-size:13pt;
- }
-
-.invisible {
- display: none;
-}
-
-/* ############### base ########### */
-
-* a, * a:hover, * a:visited, * a:active {
- color:rgb(29,48,161);
- }
-
-
-
-#header {
- text-align:right;
- height:74px;
- padding:0px;
- margin:0px;
- table-layout:fixed;
- overflow:hidden;
-}
-
-#main_nav {
- padding-top:5px;
- margin-right:20px;
- height:47px !important;
- /* height:50px !important; */
- height:54px;
- /* height:57px; */
-}
-
-#main_nav a {
- font-size:10pt;
- font-weight:bold;
- color: black;
- text-decoration:none;
-}
-
-#main_nav ul {
- line-height:12pt;
-}
-
-#main_nav li {
- display:inline;
-}
-
-#tab_nav {
- position:absolute;
- /* top:60px !important;
- top:57px; */
-
- top:66px !important;
- top:63px;
- right:30px;
- border:0px;
- }
-
-
-#errorarea, #busyarea {
- position:absolute;
- top:40%;
- left:30%;
- width:40%;
- height:10%;
- border:2px solid rgb(196,196,196);
- background-color: rgb(255,136,0);
- text-align:center;
- }
-
-head:first-child+body #busyarea { /* this is a hack to prevent IE to read this*/
- position:fixed;
- }
-
-#busyarea {
- /* background-color:#F4F5E7; */
- background-color:white;
- }
-
-#errorarea {
- background-color: rgb(255,136,0);
- }
-
-a#errorclose {
- color:black;
- font-weight:bold;
- }
-
-/* ######### misc table formatting ################*/
-
-/*
-#managebook table {
- padding:0px;
- margin:0px;
- border-collapse:collapse;
- border-spacing:0px;
- }
-*/
-
-.roundbox, .roundbox tr, .roundbox td, .roundbox img, .clean, #tab_nav img, .snippet img {
- padding:0px;
- margin:0px;
- border:0px;
- border-collapse:collapse;
- border-spacing:0px;
- /* border-style:hidden; */
-}
-
-.tablefull {
- margin:0px;
- border:0px;
- border-spacing:0px;
- width:100%;
- padding:5px;
-}
-
-/*
-.roundbox td {
- background-color:white;
-}
-*/
-
-.roundboxContent {
- background-color:white;
- }
-
-/* ################## managebook ################## */
-
-#book_nav {
- line-height:16pt;
- font-size:10pt;
-}
-
-#book_nav input {
- margin:0px;
- vertical-align:bottom;
- font-size:10pt;
- width:220px;
-}
-
- .link {
- color:black;
- margin-right:15px;
-}
-#book_nav img {
- border:0px;
- padding:0px;
- margin:0px;
- margin-left:10px;
- margin-right:10px;
- vertical-align:bottom;
-}
-.info li {
- list-style-type:square;
-}
-
-#info li {
- list-style-type:square;
- margin-left:35px;
-}
-
-#info h2 {
- margin:10px;
- margin-top:15px;
- }
-
-#info h2 a {
- color:black;
- }
-
-#info h3 {
- margin-bottom:5px;
- }
-
-#info p {
- margin:10px;
- }
-
-#tab_nav .info {
- border:1px solid rgb(128,128,128);
- font-size:8pt;
- padding-left:20px;
-}
-
-.no_list_style li{
- list-style-type:none !important;
-}
-
-#info h3 {
- margin-left:10px;
- }
-
-/* ################## main ################### */
-
-#main {
- margin-top:0px;
- margin-right:0px;
-}
-
-#main_content {
- padding-left:10px;
- padding-right:0px;
- padding-top:5px;
-}
-
-#fromsearch {
- margin-right:350px;
- margin-bottom:10px;
- margin-left:10px;
- /* background-color: rgb(200, 220, 255); */
- background-color:rgb(240,240,240);
- border:2px solid rgb(251,88,33);
- padding:5px;
- }
-
-#wikipagecontent {
- padding: 0px 10px;
- }
-
-#add_pages {
- float:right;
- margin:0px;
- background-color:white;
- border:0px;
-}
-
-#add_pages img {
- border:0px;
- margin:5px 10px;
-}
-
-/* ******************** wikipedia article formatting ******************* */
-
-#main {
- font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif;
- /* font-family: Palatino Linotype, Book Antiqua, Palatino; */
- font-size:10pt;
- overflow:hidden;
-}
-
-#main h1 {
- font-size:20pt;
- margin-bottom:30px;
- margin-right:10px;
- border-bottom:1px solid rgb(128,128,128);
-}
-
-#main h2 {
- z-index:-1;
- font-size:14pt;
- margin-right:20px;
- border-bottom:1px solid rgb(128,128,128);
-}
-
-#main h3 {
- margin-top:10px;
- margin-bottom:5px;
- font-size:13pt;
-}
-
-
-#main p {
- margin-top:5px;
-}
-
-#main a {
- text-decoration:none;
-}
-
-#main a:hover {
- text-decoration:underline;
-}
-
-#main ul {
- margin: 5px 15px;
-}
-#main ul li {
- list-style-type:square;
- margin-left:20px;
-}
-
-
-#main table {
- empty-cells:show;
- background-color:white;
- margin:10px;
-}
-
-
-
-#main th {
- font-weight:bold;
- }
-
-
-#main .deadlink, #main .deadlink:hover {
- text-decoration:none;
- color:black;
- }
-
-
-#main .infobox {
- float:right;
- border:1px solid grey;
- padding:2px;
- }
-
-#main .infobox td {
- padding:2px 4px;
- }
-
-#main .bordered {
- border-collapse:collapse;
- }
-
-#main .bordered td {
- border:1px solid grey;
- }
-
-#main .borderless *, #main .borderless {
- border:0 !important;
- }
-
-
-#main .infobox * {
- font-size: 8pt;
- }
-
-#main sub, #main sup {
- font-size: 8pt;
- margin-right:3px;
- }
-
-
-#main .small * {
- font-size:8pt;
- }
-
-
-.border {
- border:1px solid rgb(128,128,128);
- border-collapse:collapse;
-}
-
-.image {
- margin:10px;
- padding:2px;
- border:1px solid rgb(128,128,128);
- background:white;
-}
-
-.clear {
- clear:both;
- }
-
-.right {
- clear:right;
- float:right;
-}
-
-/*
-.right + .right {
- clear:right;
- }
-*/
-
-.left {
- clear:left;
- float:left;
-}
-
-/*
-.left + .left {
- clear:left;
- }
-*/
-
-#main .formula {
- vertical-align:middle;
- }
-
-
-.imagecaption {
- display:block;
- font-size:8pt;
- padding:2px;
-}
-
-.imagecaption *{
- font-size:8pt;
-}
-
-/* .wikitable, .wikitable tr, */
-
-.wikitable {
- border-collapse:collapse;
-}
-
-.wikitable td {
- border:1px solid black;
- border-spacing:0px;
- padding:0px 2px;
- }
-
-.toccolours {
- border:1px solid black;
- }
-
-
-/* ###### misc... ##### */
-
-.addButton img {
- width:12px;
- height:12px;
- border:0;
- margin-right:10px;
- }
-
-.addButton div {
- margin-right:10px;
- width:12px;
- display:inline;
- }
-
-
-.addButton a {
- margin-left:0px;
- }
-
-
-/* ############## pagelist ####################### */
-
-#pagelist {
- padding:10px;
- }
-
-#collTitle {
- /* margin-left:10px; */
- font-size:12pt;
- font-weight:bold;
- border-bottom:1px solid rgb(128,128,128);
- }
-
-#collEditTable {
- margin:10px 0px;
- }
-
-.box_content {
- margin:10px 0px;
- font-size:9pt;
-}
-
-#collInfo {
- margin-top:10px;
- font-size:10pt;
- }
-
-.del_col {
- /* width:2em; */
- width:21px;
- padding:0px 2px;
- }
-
-.priceInfo {
- margin-bottom:10px;
- font-size:8pt;
- }
-
-#collNumPages {
- margin-top:10px;
-}
-
-#collNumPages, #collPrice {
- font-weight:bold;
- }
-
-#clearbook {
- margin-top:10px;
- }
-
-
-div.uitable table{
- border-collapse: collapse;
- /* border:1px solid rgb(196,196,196); */
- cursor:pointer;
-}
-
-div.uitable table tbody tr {
- padding:3px;
- margin:3px;
-}
-
-/*
-div.uitable table tbody tr.ui_hover td{
- background-color:#BACFE4;
-}
-*/
-
-div.uitable table tbody tr.ui_active td {
- /* background-color:#F4F5E7; */
- font-weight:bold;
-
-}
-
-div.uitable td {
- padding:0px 2px;
- }
-
-div.uitable td:hover {
- text-decoration:underline;
- background-color:#BACFE4;
- }
-
-
-/* ############################# index.html ########################### */
-
-#home_left, #home_right {
- padding:0px 10px;
- }
-
-#home_right span {
- /* font-style:italic; */
- border-bottom:1px solid rgb(128,128,128);
-
-}
-
-#home_right .heading {
- width:450px;
- border-bottom:1px solid rgb(128,128,128);
- }
-
-
-#home_right li {
- margin-left:20px;
- font-style:normal;
- font-weight: normal;
- }
-
-#home_left p, #home_right p {
- margin:0px 0px;
- }
-
-#home_right h1 {
- font-size:14pt;
- /* color:rgb(64,64,64); */
- color:rgb(32,32,32);
- margin-right:15px;
- margin-top:0px;
- text-decoration:underline;
- }
-
-#home_right h2 {
- font-size:14pt;
- color:rgb(64,64,64);
- color:rgb(32,32,32);
- margin-right:15px;
- display:inline;
- }
-
-#home_right ul {
- margin-bottom:10px;
- list-style-type:square;
- }
-
-
-#home_left h2 {
- font-size:14pt;
- color:rgb(64,64,64);
- color:rgb(32,32,32);
- margin-top:5px;
- margin-bottom:5px;
- }
-
-#home_left li {
- list-style-type:none;
- margin-bottom:5px;
- margin-left:0px;
- padding-left:0px;
- }
-
-#home_left .title {
- font-weight:bold;
- font-style:italic;
- }
-
-#home_left td {
- padding:3px 2px;
- }
-
-
-
-#finish_book {
- line-height:18pt;
- }
-
-#finish_book .label {
- font-weight:bold;
- vertical-align:bottom;
- text-align:right;
- padding-right:5px;
- }
-
-#finish_book .input {
- vertical-align:bottom;
- text-align:left;
- padding-left:5px;
- }
-
-#finish_book input {
- padding: 0px 5px;
- margin:2px 0px;
- width:400px;
- }
-
-#booktitle {
- font-size:14pt;
-}
-
-#bookeditor {
- font-size:12pt;
- }
-
-
-#finish_book table {
- margin-bottom:5px;
-}
-
-#wp_footer {
- clear:both;
- float:right;
- margin-top:10px;
- margin-bottom:10px;
- padding:5px;
- /* border:2px solid rgb(230,230,230); */
- border:2px solid rgb(251,88,33);
- background-color:rgb(240,240,240);
- }
-
-/* ++++++++++++++++++ order ++++++++++++++ */
-
-#order_pay h2 {
- margin-top:0px;
- }
-
-#order_content h2, #order_content h3, #showbook_content h2, #showbook_content h3 {
- margin:5px 0px;
- }
-
-#order_content h3, #showbook_content h3 {
- margin-top:15px;
- }
-
-
-#order_content li, #showbook_content li {
- margin-right:10px;
- list-style-type:none;
- border-bottom:1px dotted grey;
- }
-
-#order_content, #order_pay, #showbook_content {
- margin:10px;
- }
-
-#order_content a, #showbook_content a {
- text-decoration:none;
- }
-
-#order_content a:hover, #showbook_content a:hover {
- text-decoration:underline;
- }
-
-#cost .label, #ship .label, #contact_form .label {
- text-align:right;
- vertical-align:top;
- }
-#cost .value #ship .value, #contact_form .value {
- text-align:left;
- }
-
-#cost td, #ship td, #contact_form td {
- padding:2px 5px;
- }
-
-#cost {
- border:1px solid grey;
- }
-
-#ship input, #ship textarea, #ship select {
- width:250px;
- }
-
-#terms_ok {
- margin-left:10px;
- }
-
-#terms_ok input {
- margin-left:0px;
-
- }
-
-#contact_form input, #contact_form select {
- width: 250px;
- }
-
- #contact_form textarea {
- width:400px;
- }
-
-#contact h2 {
- margin-top:0px;
- }
-
-
-.tooltip {
- background-color: rgb(255, 250, 200);
- border: 1px solid black;
- position: absolute;
- z-index: 10000;
- width: 200px;
- padding:2px;
- text-align:center;
-}
-
-.snippet {
- background-color: rgb(200, 220, 255);
- border: 1px solid black;
- padding: 5px;
- z-index: 10000;
- position: absolute;
- font-size: 10px;
-}
-
-#snippetid, #snippetid * {
- font-size: 10pt;
- font-style:normal;
- font-weight:normal;
-}
-
-#snippetid em {
- font-style:italic;
- }
-
-#snippetid strong {
- font-weight:bold;
- }
-
-
-.hasborder {
- border: 2px solid rgb(220,220,220);
-}
-
-.noborder {
- border-width: 0px;
- border: 2px solid white;
-}
-
-.greyedout {
- color: rgb(127, 127, 127);
-}
-
-.notgreyedout {
- color: black;
-}
-
-#terms dt {
- margin-top:10px;
- font-weight:bold;
- }
-
-#terms .toc li {
- margin-left:15px;
- list-style-type:none;
- }
-
-#terms p {
- margin-top:10px;
-
- }
-
-
-#terms p, #terms dt, #terms dd, #terms li, #terms a, #terms strong{
- font-size:8pt;
- }
-
-#terms h2, #terms h2 a {
- font-size:12pt;
- color:black;
- }
-
-#terms h3 {
- font-size:10pt;
- }
-
-#terms li {
- list-style-type:square;
- }
-
-#refreshproposals {
- padding:5px;
- margin:5px;
- margin-right:0px;
- }
-
-
-.site_link {
- border-bottom:1px dotted black;
- color:black;
- text-decoration:none;
-}
-
-.site_link:hover {
- text-decoration:none !important;
- }
-
-
-.topcats, .topcats * {
- font-weight:bold;
- list-style-type:none !important;
- margin:0px;
- padding:0px;
- font-size:12pt;
- border-bottom:1px solid rgb(128,128,128);
- margin-top:5px;
- }
-
-.topcats {
- margin-right:5px;
-}
-
-.subcats {
- margin-right:0px;
- }
-
-
-#preview {
- margin:10px;
- }
-
-#preview h1 {
- margin-top:0px;
- margin-bottom:10px;
- }
-
-#adobe_info {
- float:right;
- width:33%;
- border:1px solid rgb(128,128,128);
- border:1px solid rgb(196,196,196);
- margin:10px;
- margin-right:0px;
- margin-top:0px;
- padding:5px;
-
- }
-
-#generating {
- margin:0px;
- }
-
-#finished p {
- margin-bottom:10px;
- }
-
-#affiliate {
- padding:5px;
- padding-top:0px;
- }
-#affiliate p{
- margin-bottom:10px;
- }
-
-#affiliate li {
- list-style-type:square;
- margin-left:25px;
- }
-#affiliate ul {
- margin-bottom:10px;
-}
-
-#affiliatetable td{
- padding:10px;
- }
-
-#affiliatetable li {
- list-style-type:none;
- }
-
-#affiliatetable input {
- margin-left:0px;
- }
-
-.affiliatebox {
- float:left;
- width:45%;
- margin:10px;
- /* padding:10px; */
- /* border:2px solid rgb(210,210,210); */
- /* border:2px solid rgb(251,88,33); */
- }
-
-.affiliateboxcontent {
- margin:10px;
- }
-
-.affiliatebox h2 {
- margin:0px;
- margin-bottom:10px;
- }
-
-.affiliatebox ul li {
- list-style-type:square;
- margin-left:15px;
- }
-
-.affiliatebox .nobullets li {
- list-style-type:none;
- margin-left:0px;
- }
-
-
-
-#welcome {
- padding:10px;
- padding-top:5px;
- margin:0px;
- }
-
-#welcome h1 {
- margin:0px;
- margin-bottom:10px;
- font-size:16pt;
- color:rgb(32,32,32);
- }
-
-
-#home_howto td{
- padding:5px;
- vertical-align:top;
- }
-
-#home_howto .step_num {
- font-size:20pt;
- color:rgb(128,128,128);
- float:left;
- margin:5px;
- }
-
-#home_howto li {
- list-style-type:square;
- margin-left:20px;
- }
-
-#news .newsitem {
- margin: 10px;
- max-width:500px;
- }
-
-#news .newsitem h3 {
- font-size:12pt;
- margin-bottom:5px;
- margin-top:10px;
- }
-
-.newsitem + .newsitem {
- border-top:1px dotted rgb(128,128,128);
- }
-
-#news .date {
- float:right;
- margin-top:5px;
- margin-left:10px;
- font-size:8pt;
- }
-
-.deadlink {
- color:black;
-}
-
-.smalltext, .smalltext em, .smalltext * {
- font-size:8pt !important;
- }
-
-.template_warningsmart {
- border:3px solid red;
-}
-.template_warningmanual{
- border:3px solid orange;
- }
-
-.template_warningsmart * {
- background-color:rgb(210,210,210);
- }
-
-.template_warningmanual * {
- background-color:rgb(230,230,230);
- }
-
-
- #startcats {
- padding:5px;
- }
-
- #startcats h2, #startcats h3 {
- margin:5px 0px;
- }
-
-#startcats .topcats {
- margin-bottom:5px;
-}
-
-#startcats .topcats *, #startcats .subcats * {
- text-decoration:none;
- }
-
-#startcats .topcats a {
- border-bottom:0;
- }
-
-.startcatbox {
- width:30%;
- float:left;
- padding:10px;
- padding-bottom:0px;
- }
-
-.startcatbox h3 {
- border-bottom:1px solid rgb(128,128,128);
- }
-
-
-#lowpagecount, #highpagecount {
- margin:10px 0px;
- padding:10px;
- border:2px solid rgb(251,88,33);
- background-color:rgb(240,240,240);
- }
-
-#highpagecount {
- margin-left:10px;
- }
-
-
-#examplebook {
- padding:10px;
- }
-
-#examplebook li {
- list-style-type: none;
- text-align:center;
- margin-bottom:5px;
- }
-
-#examplebook .book_img img {
- border:1px dotted rgb(128,128,128);
- padding:2px;
- }
-
-#examplebook .info {
- float:right;
- border:1px dotted rgb(128,128,128);
- padding:5px;
- }
-
-#examplebook .navigation {
- position:absolute;
- margin:15px 0px;
- border:1px dotted rgb(128,128,128);
- padding:5px 15px;
- }
-
-#examplebook .navigation li {
- text-align:left;
- }
-
-#examplebook .navigation a {
- text-decoration:none;
- }
-
-#examplebook .navigation a:hover {
- text-decoration:underline;
- }
-
-
-
-
-
-
-/* ######## pssearch */
-
-
-
-.pssnippet strong {
- font-weight:normal;
- }
-
-.pssnippet li {
- margin-left:15px;
- }
-
-.pssnippethl {
- background-color: rgb(196, 224, 255);
-}
-
-
-#pssearch a {
- color:rgb(28,53,110);
- }
-
-/*
-#pssearch li {
- margin-bottom:10px;
- list-style-type:square;
- }
-*/
-
-li.result {
- margin-bottom:10px;
- list-style-type:square;
- }
-
-#pssearch .details, #pssearch .details * {
- font-size:8pt;
- }
-
-.marginbox {
- padding:5px 10px;
- }
-
-#searchresultlist .result {
- margin: 0px 5px;
- padding: 8px 0px;
- list-style-type:none;
- border-bottom:1px dotted rgb(128,128,128);
- /* border-top:1px dotted rgb(128,128,128);*/
- /*background:rgb(245, 250, 250);*/
-}
-
-/*
-.alternate {
- background: rgb(234, 238, 245);
-}
-*/
-
-.clustered {
- margin-left: 40px;
-}
-
-.resultdetails * {
- text-align:middle;
- }
-
-/* display styles for snippets search result snippet*/
-.pssnippet hr {
- display:none;
-}
-
-.pssnippet li {
- margin-left:15px;
-}
-
-/* end filter */
-
-#categories li {
- list-style-type: none;
-}
-
-#categories h2 {
- margin:0px;
- font-size: 12pt;
- }
-
-#categories a:hover {
- background-color:rgb(1,160,199);
- color:white;
- text-decoration:none;
-}
-
-#pssearch .subcats {
- margin-bottom:0px;
- margin-left:15px;
- list-style-type:none;
-}
-
-#searchselection {
- margin-left:10px;
- vertical-align:middle;
-}
-
-#searchselection input {
- color:green;
- margin-left:10px;
- margin-right:5px;
- vertical-align:middle;
-}
-
-.searchresulturl {
- color: rgb(0, 96, 120);
-}
-
-.psformat {
- font-size: 8pt;
-}
-
-.psrf {
- float: right;
-}
-
-.pscategorylink, .psarticlelink {
- white-space: nowrap;
-}
-
-.matchedcategories {
- border: 1px dotted grey;
- /*background-color: rgb(245, 245, 245);*/
- margin-left: 10px;
- margin-right: 10px;
- margin-bottom: 15px;
- padding: 4px;
-}
-
diff --git a/mwlib/sanitychecker.py b/mwlib/sanitychecker.py
deleted file mode 100644
index 78d25b8..0000000
--- a/mwlib/sanitychecker.py
+++ /dev/null
@@ -1,205 +0,0 @@
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-"""
-class for defining DTD-Like Rules for the tree
-"""
-from advtree import Article
-
-from mwlib.log import Log
-log = Log("sanitychecker")
-
-# -----------------------------------------------------------
-# Constraints
-# -----------------------------------------------------------
-
-class ConstraintBase(object):
- def __init__(self, *klasses):
- self.klasses = klasses
-
- def test(self, nodes):
- return True,None # passed
-
- def __repr__(self):
- return "%s(%s)" %(self.__class__.__name__, ", ".join(k.__name__ for k in self.klasses))
-
-
-class Forbid(ConstraintBase):
- "forbid any of the classes"
- def test(self, nodes):
- for n in nodes:
- if n.__class__ in self.klasses:
- return False, n
- return True, None
-
-
-class Allow(ConstraintBase):
- "allow only these classes"
- def test(self, nodes):
- for n in nodes:
- if not n.__class__ in self.klasses:
- return False, n
- return True, None
-
-
-class Require(ConstraintBase):
- "require any of these classes"
- def test(self, nodes):
- for n in nodes:
- if n.__class__ in self.klasses:
- return True, n
- return False, None
-
-class Equal(ConstraintBase):
- "node classes and their order must be equal to these klasses"
- def test(self, nodes):
- if len(nodes) != len(self.klasses):
- return False, None # FIXME what could we report?
- for i,n in enumerate(nodes):
- if n.__class__ != self.klasses[i]:
- return False, n
- return True, None
-
-
-# -----------------------------------------------------------
-# Rules regarding [Children, AllChildren, Parents, ...]
-# -----------------------------------------------------------
-
-class RuleBase:
- def __init__(self, klass, constraint):
- self.klass = klass
- self.constraint = constraint
-
- def _tocheck(self, node):
- return []
-
- def test(self, node):
- if node.__class__ == self.klass:
- return self.constraint.test( self._tocheck(node) )
- return True, None
-
- def __repr__(self):
- return "%s(%s, %r)" %(self.__class__.__name__, self.klass.__name__, self.constraint)
-
-class ChildrenOf(RuleBase):
- def _tocheck(self, node):
- return node.children
-
-class AllChildrenOf(RuleBase):
- def _tocheck(self, node):
- return node.getAllChildren()
-
-class ParentsOf(RuleBase):
- def _tocheck(self, node):
- return node.parents
-
-class ParentOf(RuleBase):
- def _tocheck(self, node):
- if node.parent:
- return [node.parent]
- return []
-
-class SiblingsOf(RuleBase):
- def _tocheck(self, node):
- return node.siblings
-
-
-
-# example custom rules
-
-class RequireChild(RuleBase):
-
- def __init__(self, klass):
- self.klass = klass
-
- def __repr__(self):
- return "%s(%s)" %(self.__class__.__name__, self.klass.__name__)
-
- def test(self, node):
- if node.__class__ == self.klass:
- if not len(node.children):
- return False, node
- return True, None
-
-
-
-
-# -----------------------------------------------------------
-# Callbacks
-# -----------------------------------------------------------
-"""
-callbacks get called if added to rules
-callback return values should be:
- * True if it modified the tree and the sanity check needs to restart
- * False if the tree is left unmodified
-"""
-class SanityException(Exception):
- pass
-
-def exceptioncb(rule, node=None, parentnode=None):
- raise SanityException("%r err:%r" %(rule, node or parentnode) )
-
-def warncb(rule, node=None, parentnode=None):
- log.warn("%r node:%r parent:%r" %(rule, node, parentnode))
- return False
-
-def removecb(rule, node=None, parentnode=None):
- assert node and node.parent
- node.parent.removeChild(node)
- return True
-
-
-
-# -----------------------------------------------------------
-# Container for sanity rules
-# -----------------------------------------------------------
-
-class SanityChecker(object):
-
- def __init__(self):
- self.rules = []
-
- def addRule(self, rule, actioncb=exceptioncb):
- self.rules.append((rule, actioncb))
-
- def check(self, tree):
- """
- check each node with each rule
- on failure call callback
- """
- modified = True
- while modified:
- modified = False
- for node in tree.allchildren():
- #if node.__class__ == Article:
- # log.info("checking article:", node.caption.encode('utf-8'))
- for r,cb in self.rules:
- passed, errnode = r.test(node)
- if not passed and cb:
- if cb(r, errnode or node):
- modified = True
- break
- if modified:
- break
-
-def demo(tree):
- "for documentation only, see tests for more demos"
- from mwlib.advtree import Table, Row, Cell, Text, ImageLink, PreFormatted
-
- sc = SanityChecker()
- rules = [ChildrenOf(Table, Allow(Row)),
- ChildrenOf(Row, Allow(Cell)),
- AllChildrenOf(Cell, Require(Text, ImageLink)),
- AllChildrenOf(Cell, Forbid(PreFormatted)),
- ChildrenOf(PreFormatted, Equal(Text)),
- ]
-
- def mycb(rule, node=None, parentnode=None):
- print "failed", rule, node or parentnode
- modifiedtree = False
- return modifiedtree
-
- for r in rules:
- sc.addRule( r, mycb)
- #sc.check(anytree)
-
-
diff --git a/mwlib/scanfile.py b/mwlib/scanfile.py
deleted file mode 100755
index 96519d2..0000000
--- a/mwlib/scanfile.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#! /usr/bin/env python
-
-"""used for debugging/testing"""
-
-import sys
-import time
-import mwscan
-
-d=unicode(open(sys.argv[1]).read(), 'utf-8')
-
-stime=time.time()
-r=mwscan.scan(d)
-needed = time.time()-stime
-for x in r:
- print r.repr(x)
-
-print needed, len(d), len(r)
-
-
-
-# stime=time.time()
-# r=mwscan.compat_scan(d)
-# needed = time.time()-stime
-
-# print "COMPAT:", needed, len(d), len(r)
-
-
-# #mwscan.dump_tokens(d,r)
-# #print needed, len(d), len(r)
diff --git a/mwlib/scanner.py b/mwlib/scanner.py
deleted file mode 100755
index d4d7167..0000000
--- a/mwlib/scanner.py
+++ /dev/null
@@ -1,6 +0,0 @@
-#! /usr/bin/env python
-
-if 0:
- from plexscanner import TagToken, EndTagToken, tokenize
-else:
- from mwscan import TagToken, EndTagToken, tokenize
diff --git a/mwlib/texmap.py b/mwlib/texmap.py
deleted file mode 100755
index f3071e6..0000000
--- a/mwlib/texmap.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import re
-
-def convertSymbols(latexsource):
- def repl(mo):
- name=mo.group(0)
- return symbolMap.get(name, name)
-
- latexsource = texcmd.sub(repl, latexsource)
- return latexsource
-
-texcmd = re.compile(r"\\[a-zA-Z]+")
-
-symbolMap = {'\\Bbb': '\\mathbb',
- '\\Complex': '\\mathbb{C}',
- '\\Dagger': '\\ddagger',
- '\\Darr': '\\Downarrow',
- '\\Harr': '\\Leftrightarrow',
- '\\Larr': '\\Leftarrow',
- '\\Lrarr': '\\Leftrightarrow',
- '\\N': '\\mathbb{N}',
- '\\O': '\\emptyset',
- '\\R': '\\mathbb{R}',
- '\\Rarr': '\\Rightarrow',
- '\\Reals': '\\mathbb{R}',
- '\\Uarr': '\\Uparrow',
- '\\Z': '\\mathbb{Z}',
- '\\alef': '\\aleph',
- '\\alefsym': '\\aleph',
- '\\and': '\\land',
- '\\ang': '\\angle',
- '\\arccos': '\\mathop{\\mathrm{arccos}}',
- '\\arccot': '\\mathop{\\mathrm{arccot}}',
- '\\arccsc': '\\mathop{\\mathrm{arccsc}}',
- '\\arcsec': '\\mathop{\\mathrm{arcsec}}',
- '\\bold': '\\mathbf',
- '\\bull': '\\bullet',
- '\\clubs': '\\clubsuit',
- '\\cnums': '\\mathbb{C}',
- '\\dArr': '\\Downarrow',
- '\\darr': '\\downarrow',
- '\\diamonds': '\\diamondsuit',
- '\\empty': '\\emptyset',
- '\\exist': '\\exists',
- '\\ge': '\\geq',
- '\\hAar': '\\Leftrightarrow',
- '\\harr': '\\leftrightarrow',
- '\\hearts': '\\heartsuit',
- '\\image': '\\Im',
- '\\infin': '\\infty',
- '\\isin': '\\in',
- '\\lArr': '\\Leftarrow',
- '\\lang': '\\langle',
- '\\larr': '\\leftarrow',
- '\\le': '\\leq',
- '\\lrArr': '\\Leftrightarrow',
- '\\lrarr': '\\leftrightarrow',
- '\\natnums': '\\mathbb{N}',
- '\\ne': '\\neq',
- '\\or': '\\lor',
- '\\part': '\\partial',
- '\\plusmn': '\\pm',
- '\\rArr': '\\Rightarrow',
- '\\rang': '\\rangle',
- '\\rarr': '\\rightarrow',
- '\\real': '\\Re',
- '\\reals': '\\mathbb{R}',
- '\\sdot': '\\cdot',
- '\\sect': '\\S',
- '\\sgn': '\\mathop{\\mathrm{sgn}}',
- '\\spades': '\\spadesuit',
- '\\sub': '\\subset',
- '\\sube': '\\subseteq',
- '\\supe': '\\supseteq',
- '\\thetasym': '\\vartheta',
- '\\uArr': '\\Uparrow',
- '\\uarr': '\\uparrow',
- '\\weierp': '\\wp',
- '\\Alpha': 'A{}',
- '\\Beta': 'B{}',
- '\\Epsilon': 'E{}',
- '\\Zeta': 'Z{}',
- '\\Eta': 'H{}',
- '\\Iota': 'I{}',
- '\\Kappa' : 'K{}',
- '\\Mu': 'M{}',
- '\\Nu': 'N{}',
- '\\Rho': 'P{}',
- '\\Tau': 'T{}',
- '\\Chi': 'C{}',
- }
diff --git a/mwlib/timeline.py b/mwlib/timeline.py
deleted file mode 100755
index e85dd84..0000000
--- a/mwlib/timeline.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-"""implement http://meta.wikimedia.org/wiki/EasyTimeline
-"""
-
-import os
-import tempfile
-try:
- from hashlib import md5
-except ImportError:
- from md5 import md5
-
-
-def drawTimeline(script, basedir=None):
- if isinstance(script, unicode):
- script = script.encode('utf8')
- if basedir is None:
- basedir = os.path.join(tempfile.gettempdir(), "timeline-%s" % (os.getuid(),))
- if not os.path.exists(basedir):
- os.mkdir(basedir)
-
- m=md5()
- m.update(script)
- ident = m.hexdigest()
-
- pngfile = os.path.join(basedir, ident+'.png')
-
- if os.path.exists(pngfile):
- return pngfile
-
- scriptfile = os.path.join(basedir, ident+'.txt')
- open(scriptfile, 'w').write(script)
- et = os.path.join(os.path.dirname(__file__), "EasyTimeline.pl")
-
- err = os.system("perl %s -P /usr/bin/ploticus -T /tmp/ -i %s" % (et, scriptfile))
- if err != 0:
- return None
-
- svgfile = os.path.join(basedir, ident+'.svg')
-
- if os.path.exists(svgfile):
- os.unlink(svgfile)
-
- if os.path.exists(pngfile):
- return pngfile
-
- return None
-
-
diff --git a/mwlib/uparser.py b/mwlib/uparser.py
deleted file mode 100755
index 8565c74..0000000
--- a/mwlib/uparser.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-"""usable/user parser"""
-
-from mwlib import parser, scanner, expander
-
-def simplify(node):
- "concatenates textnodes in order to reduce the number of objects"
- Text = parser.Text
-
- last = None
- toremove = []
- for i,c in enumerate(node.children):
- if c.__class__ == Text: # would isinstance be safe?
- if last:
- last.caption += c.caption
- toremove.append(i)
- else:
- last = c
- else:
- simplify(c)
- last = None
-
- for i,ii in enumerate(toremove):
- del node.children[ii-i]
-
-def fixlitags(node):
- Text = parser.Text
-
- if not isinstance(node, parser.ItemList):
- idx = 0
- while idx < len(node.children):
- if isinstance(node.children[idx], parser.Item):
- lst = parser.ItemList()
- lst.append(node.children[idx])
- node.children[idx] = lst
- idx += 1
- while idx<len(node.children):
- if isinstance(node.children[idx], parser.Item):
- lst.append(node.children[idx])
- del node.children[idx]
- elif node.children[idx]==Text("\n"):
- del node.children[idx]
- else:
- break
- else:
- idx += 1
-
- for x in node.children:
- fixlitags(x)
-
-def removeBoilerplate(node):
- i = 0
- while i < len(node.children):
- x = node.children[i]
- if isinstance(x, parser.TagNode) and x.caption=='div':
- try:
- klass = x.values.get('class', '')
- except AttributeError:
- klass = ''
-
- if 'boilerplate' in klass:
- del node.children[i]
- continue
-
- i += 1
-
- for x in node.children:
- removeBoilerplate(x)
-
-
-
-
-postprocessors = [removeBoilerplate, simplify, fixlitags]
-
-def parseString(title=None, raw=None, wikidb=None, revision=None):
- """parse article with title from raw mediawiki text"""
- assert title is not None
-
- if raw is None:
- raw = wikidb.getRawArticle(title, revision=revision)
- assert raw is not None, "cannot get article %r" % (title,)
- if wikidb:
- te = expander.Expander(raw, pagename=title, wikidb=wikidb)
- input = te.expandTemplates()
- else:
- input = raw
-
- tokens = scanner.tokenize(input, title)
-
- a = parser.Parser(tokens, title).parse()
- a.caption = title
- for x in postprocessors:
- x(a)
- return a
-
-
-def simpleparse(raw): # !!! USE FOR DEBUGGING ONLY !!! does not use post processors
- import sys
- from mwlib import dummydb
- db = dummydb.DummyDB()
-
- tokens = scanner.tokenize(raw)
- r=parser.Parser(tokens, "unknown").parse()
- parser.show(sys.stdout, r, 0)
- return r
-
-def main():
- from mwlib.dummydb import DummyDB
-
- import os
- import sys
-
- db = DummyDB()
-
- for x in sys.argv[1:]:
- input = unicode(open(x).read(), 'utf8')
- title = unicode(os.path.basename(x))
- parseString(title, input, db)
-
-if __name__=="__main__":
- main()
-
diff --git a/mwlib/utils.py b/mwlib/utils.py
deleted file mode 100644
index 4fd6b55..0000000
--- a/mwlib/utils.py
+++ /dev/null
@@ -1,112 +0,0 @@
-import os
-import sys
-import errno
-import time
-
-# provide all for python 2.4
-try:
- from __builtin__ import all
-except ImportError:
- def all(items):
- for x in items:
- if not x:
- return False
- return True
-
-def fsescape(s):
- res = []
- for x in s:
- c = ord(x)
- if c>127:
- res.append("~%s~" % c)
- elif c==126: # ord("~")==126
- res.append("~~")
- else:
- res.append(x)
- return "".join(res)
-
-def start_logging(path):
- sys.stderr.flush()
- sys.stdout.flush()
-
- f = open(path, "a")
- fd = f.fileno()
- os.dup2(fd, 1)
- os.dup2(fd, 2)
-
- null=os.open('/dev/null', os.O_RDWR)
- os.dup2(null, 0)
- os.close(null)
-
-def daemonize(dev_null=False):
- # See http://www.erlenstar.demon.co.uk/unix/faq_toc.html#TOC16
- if os.fork(): # launch child and...
- os._exit(0) # kill off parent
- os.setsid()
- if os.fork(): # launch child and...
- os._exit(0) # kill off parent again.
- os.umask(077)
- if dev_null:
- null=os.open('/dev/null', os.O_RDWR)
- for i in range(3):
- try:
- os.dup2(null, i)
- except OSError, e:
- if e.errno != errno.EBADF:
- raise
- os.close(null)
-
-def shell_exec(cmd):
- """Execute cmd in a subshell
-
- @param cmd: command to execute with os.system(), if given as unicode its
- converted to str using sys.getfilesystemencoding()
- @type cmd: basestring
-
- @returns: exit code of command
- @rtype: int
- """
- if isinstance(cmd, unicode):
- enc = sys.getfilesystemencoding()
- assert enc is not None, 'no filesystem encoding (set LANG)'
- cmd = cmd.encode(enc, 'ignore')
- return os.system(cmd)
-
-
-def get_multipart(filename, data, name):
- """Build data in format multipart/form-data to be used to POST binary data.
-
- @param filename: filename to be used in multipart request
- @type filenaem: basestring
-
- @param data: binary data to include
- @type data: str
-
- @param name: name to be used in multipart request
- @type name: basestring
-
- @returns: tuple containing content-type and body for the request
- @rtype: (str, str)
- """
-
- if isinstance(filename, unicode):
- filename = filename.encode('utf-8', 'ignore')
- if isinstance(name, unicode):
- name = name.encode('utf-8', 'ignore')
-
- boundary = "-"*20 + ("%f" % time.time()) + "-"*20
-
- items = []
- items.append("--" + boundary)
- items.append('Content-Disposition: form-data; name="%(name)s"; filename="%(filename)s"'\
- % {'name': name, 'filename': filename})
- items.append('Content-Type: application/octet-stream')
- items.append('')
- items.append(data)
- items.append('--' + boundary + '--')
- items.append('')
-
- body = "\r\n".join(items)
- content_type = 'multipart/form-data; boundary=%s' % boundary
-
- return content_type, body
diff --git a/mwlib/web.py b/mwlib/web.py
deleted file mode 100755
index 5e32fb8..0000000
--- a/mwlib/web.py
+++ /dev/null
@@ -1,122 +0,0 @@
-#! /usr/bin/env python
-
-"""simple wsgi app for serving mediawiki content
-"""
-
-import os
-import mimetypes
-import StringIO
-from mwlib import uparser, htmlwriter, rendermath
-
-class Pngmath(object):
- def __init__(self, basedir):
- self.basedir = basedir
-
- def __call__(self, env, start_response):
- pi = env['PATH_INFO']
- path = pi.split('/', 2)[-1]
- path = path.strip("/")
- path = path[:-len(".png")]
-
- pngfile = os.path.join(self.basedir, path+'.png')
- if not os.path.exists(pngfile):
- texfile = os.path.join(self.basedir, path+'.tex')
- if not os.path.exists(texfile):
- start_response('404 Not found', [('Content-Type', 'text/plain')])
- return ["404 not found"]
-
- r = rendermath.Renderer()
- r._render_file(path, 'png')
-
-
- d=open(pngfile, 'rb').read()
-
-
- start_response('200 Ok', [('Content-Type', 'image/png')])
- return [d]
-
-class Files(object):
- def __init__(self, basedir):
- self.basedir = basedir
-
- def __call__(self, env, start_response):
- pi = env['PATH_INFO']
- path = pi.split('/', 2)[-1]
- path = path.strip("/")
- assert ".." not in path, "path must not contain '..'"
-
- mt, enc = mimetypes.guess_type(path)
-
- try:
- f=open(os.path.join(self.basedir, path), 'rb')
- except (IOError, OSError), err:
- print "ERROR:", err
- start_response('404 Not found', [('Content-Type', 'text/plain')])
- return ["404 not found"]
-
- send = start_response('200 OK', [('Content-type', mt or 'text/plain; charset=utf-8')])
- while 1:
- data=f.read(0x20000)
- if not data:
- break
- send(data)
- return []
-
-
-class Serve(object):
- head = """<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="content-type" content="text/html; charset="utf-8"></meta>
-<link rel="stylesheet" href="/resources/pedia.css" />
-</head>
-<body>
-"""
- def __init__(self, db, images):
- self.db = db
- self.images = images
- from mwlib import resources
- self.resources = Files(os.path.dirname(resources.__file__)) # FIXME
- self.image_files = Files(os.path.expanduser("~/images")) # FIXME
- self.pngmath = Pngmath(os.path.expanduser("~/pngmath")) # FIXME
- self.timeline = Files(os.path.expanduser("~/timeline")) # FIXME
-
- def show(self, env, start_response):
- article = unicode(env['PATH_INFO'], 'utf-8').strip('/').replace("_", " ")
- article = article[:1].upper()+article[1:] # FIXME: we should redirect instead.
-
- raw=self.db.getRawArticle(article)
- if not raw:
- start_response('404 Not found', [('Content-Type', 'text/plain')])
- return ["Article %r not found" % (article,)]
-
- send = start_response('200 OK', [('Content-type', 'text/html; charset=utf-8')])
- send(self.head)
-
- out=StringIO.StringIO(u"")
-
- a=uparser.parseString(article, raw=raw, wikidb=self.db)
- w=htmlwriter.HTMLWriter(out, self.images)
- w.write(a)
-
- return [out.getvalue().encode('utf-8')]
-
- def __call__(self, env, start_response):
- path = env['PATH_INFO']
-
-
- if path.startswith("/resources/"):
- return self.resources(env, start_response)
- if path.startswith("/images"):
- return self.image_files(env, start_response)
- if path.startswith("/pngmath/"):
- return self.pngmath(env, start_response)
- if path.startswith("/timeline/"):
- return self.timeline(env, start_response)
-
- return self.show(env, start_response)
-
-
- start_response('404 Not found', [('Content-Type', 'text/plain')])
- return ["404 Not found"]
diff --git a/mwlib/wiki.py b/mwlib/wiki.py
deleted file mode 100755
index 96378ed..0000000
--- a/mwlib/wiki.py
+++ /dev/null
@@ -1,135 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2007-2008 PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import os
-from ConfigParser import ConfigParser
-
-def wiki_mwapi(base_url=None, license=None, template_blacklist=None):
- from mwlib import mwapidb
- return mwapidb.WikiDB(base_url, license, template_blacklist)
-
-def wiki_zip(path=None, url=None, name=None):
- from mwlib import zipwiki
- return zipwiki.Wiki(path)
-
-def wiki_net(articleurl=None, url=None, name=None, imagedescriptionurls=None,
- templateurls=None, templateblacklist=None, defaultarticlelicense=None,
- defaultauthors=None, **kwargs):
- from mwlib import netdb
-
- if templateurls:
- templateurls = [x for x in templateurls.split() if x]
- else:
- raise RuntimeError("templateurls parameter for netdb not set in [wiki] section")
-
- if imagedescriptionurls:
- imagedescriptionurls = [x for x in imagedescriptionurls.split() if x]
- else:
- raise RuntimeError("imagedescriptionurls parameter for netdb not set in [wiki] section")
-
- if defaultauthors:
- defaultauthors = [a.strip() for a in defaultauthors.split(',')]
-
- return netdb.NetDB(articleurl,
- imagedescriptionurls=imagedescriptionurls,
- templateurls=templateurls,
- templateblacklist=templateblacklist,
- defaultauthors=defaultauthors,
- )
-
-def wiki_cdb(path=None, **kwargs):
- from mwlib import cdbwiki
- path = os.path.expanduser(path)
- db=cdbwiki.WikiDB(path)
- return db
-
-def image_mwapi(base_url=None, shared_base_url=None):
- from mwlib import mwapidb
- return mwapidb.ImageDB(base_url, shared_base_url)
-
-def image_download(url=None, localpath=None, knownlicenses=None):
- assert url, "must supply url in [images] section"
- from mwlib import netdb
-
- if localpath:
- localpath = os.path.expanduser(localpath)
- urls = [x for x in url.split() if x]
- assert urls
-
- if knownlicenses:
- knownlicenses = [x for x in knownlicenses.split() if x]
- else:
- knownlicenses = None
-
- imgdb = netdb.ImageDB(urls, cachedir=localpath, knownLicenses=knownlicenses)
- return imgdb
-
-def image_zip(path=None):
- from mwlib import zipwiki
- return zipwiki.ImageDB(path)
-
-
-
-dispatch = dict(
- images = dict(mwapi=image_mwapi, download=image_download, zip=image_zip),
- wiki = dict(mwapi=wiki_mwapi, cdb=wiki_cdb, net=wiki_net, zip=wiki_zip)
-)
-
-def _makewiki(conf):
- res = {}
-
- # yes, I really don't want to type this everytime
- wc = os.path.join(conf, "wikiconf.txt")
- if os.path.exists(wc):
- conf = wc
-
- if conf.startswith("http://") or conf.startswith("https://"):
- res['wiki'] = wiki_mwapi(conf)
- res['images'] = image_mwapi(conf)
- return res
-
-
- if conf.lower().endswith(".zip"):
- from mwlib import zipwiki
- res['wiki'] = zipwiki.Wiki(conf)
- res['images'] = zipwiki.ImageDB(conf)
- return res
-
- cp=ConfigParser()
-
- if not cp.read(conf):
- raise RuntimeError("could not read config file %r" % (conf,))
-
-
- for s in ['images', 'wiki']:
- if not cp.has_section(s):
- continue
-
- args = dict(cp.items(s))
- if "type" not in args:
- raise RuntimeError("section %r does not have key 'type'" % s)
- t = args['type']
- del args['type']
- try:
- m = dispatch[s][t]
- except KeyError:
- raise RuntimeError("cannot handle type %r in section %r" % (t, s))
-
- res[s] = m(**args)
-
- assert "wiki" in res
- return res
-
-def makewiki(conf):
- res = _makewiki(conf)
-
- try:
- overlaydir = os.environ['MWOVERLAY']
- assert os.path.isdir(overlaydir)
- import mwlib.overlay
- res['wiki'] = mwlib.overlay.OverlayDB(res['wiki'], overlaydir)
- except:
- pass
- return res
diff --git a/mwlib/zipwiki.py b/mwlib/zipwiki.py
deleted file mode 100755
index c6893b8..0000000
--- a/mwlib/zipwiki.py
+++ /dev/null
@@ -1,167 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (c) 2008, PediaPress GmbH
-# See README.txt for additional licensing information.
-
-import os
-import shutil
-import simplejson
-import tempfile
-from zipfile import ZipFile
-
-from mwlib.metabook import MetaBook
-from mwlib import uparser
-
-class Wiki(object):
- def __init__(self, zipfile):
- """
- @type zipfile: basestring or ZipFile
- """
-
- if isinstance(zipfile, ZipFile):
- self.zf = zipfile
- else:
- self.zf = ZipFile(zipfile)
- self.metabook = MetaBook()
- self.metabook.loadJson(self.zf.read("metabook.json"))
- content = simplejson.loads(self.zf.read('content.json'))
- self.articles = content['articles']
- self.templates = content['templates']
-
- def _getArticle(self, title, revision=None):
- try:
- article = self.articles[title]
- if revision is None or article['revision'] == revision:
- return article
- except KeyError:
- pass
- return None
-
- def getRawArticle(self, title, revision=None):
- article = self._getArticle(title, revision=revision)
- if article:
- return article['content']
- return None
-
- def getParsedArticle(self, title, revision=None):
- raw = self.getRawArticle(title, revision=revision)
- if raw is None:
- return None
- a = uparser.parseString(title=title, raw=raw, wikidb=self)
- return a
-
- def getURL(self, title, revision=None):
- article = self._getArticle(title, revision=revision)
- if article:
- return article['url']
- return None
-
- def getAuthors(self, title, revision=None):
- article = self._getArticle(title, revision=revision)
- if article:
- return article.get('authors', [])
- return None
-
- def getTemplate(self, name, followRedirects=True):
- try:
- return self.templates[name]['content']
- except KeyError:
- pass
- return None
-
-
-class ImageDB(object):
- def __init__(self, zipfile, tmpdir=None):
- """
- @type zipfile: basestring or ZipFile
- """
-
- if isinstance(zipfile, ZipFile):
- self.zf = zipfile
- else:
- self.zf = ZipFile(zipfile)
- content = simplejson.loads(self.zf.read('content.json'))
- self.images = content['images']
- self._tmpdir = tmpdir
- self.diskpaths = {}
-
- @property
- def tmpdir(self):
- if self._tmpdir is None:
- self._tmpdir = unicode(tempfile.mkdtemp())
- return self._tmpdir
-
- def getDiskPath(self, name, size=None):
- try:
- return self.diskpaths[name]
- except KeyError:
- pass
- try:
- data = self.zf.read('images/%s' % name.replace("'", '-').encode('utf-8'))
- except KeyError: # no such file
- return None
-
- try:
- ext = '.' + name.rsplit('.', 1)[1]
- except IndexError:
- ext = ''
- if ext.lower() == '.svg':
- ext = '.svg.png'
- elif ext.lower() == '.gif':
- ext = '.gif.png'
- res = os.path.join(self.tmpdir, 'image%04d%s' % (len(self.diskpaths), ext))
- self.diskpaths[name] = res
- f=open(res, "wb")
- f.write(data)
- f.close()
- return res
-
- def getLicense(self, name):
- try:
- return self.images[name]['license']
- except KeyError:
- return None
-
- def getPath(self):
- raise NotImplemented('getPath() does not work with zipwiki.ImageDB!')
-
- def getURL(self, name):
- try:
- return self.images[name]['url']
- except KeyError:
- return None
-
- def clean(self):
- if self._tmpdir:
- shutil.rmtree(self._tmpdir, ignore_errors=True)
-
-
-
-
-class FakeImageDB(ImageDB):
-
- imagedata = '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x03 \x00\x00\x01\xe0\x01\x03\x00\x00\x00g\xc9\x9b\xb6\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\x06PLTE\xff\xff\xff\x00\x00\x00U\xc2\xd3~\x00\x00\x00\tpHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00EIDATx\xda\xed\xc1\x01\x01\x00\x00\x00\x82 \xff\xafnH@\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/\x06\xbd`\x00\x01`<5\x84\x00\x00\x00\x00IEND\xaeB`\x82'
-
- def __init__(self, tmpdir=None):
- """
- @type zipfile: basestring or ZipFile
- """
- self._tmpdir = tmpdir
-
- def getDiskPath(self, name, size=None):
- res = os.path.join(self.tmpdir, 'blank.png')
- if not os.path.exists(res):
- open(res, "w").write(self.imagedata)
- return res
-
- def getPath(self):
- raise NotImplemented('getPath() does not work with zipwiki.FakeImageDB!')
-
- def getURL(self, name):
- raise NotImplemented('getURL() does not work with zipwiki.FakeImageDB!')
-
- def getLicense(self, name):
- raise NotImplemented('getLicense() does not work with zipwiki.FakeImageDB!')
-
-
-
diff --git a/searchtoolbar.py b/searchtoolbar.py
deleted file mode 100644
index 2e2e184..0000000
--- a/searchtoolbar.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright (C) 2007, One Laptop Per Child
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-from gettext import gettext as _
-
-import gtk
-
-from sugar.graphics.toolbutton import ToolButton
-from sugar.graphics.toolcombobox import ToolComboBox
-from sugar._sugarext import AddressEntry
-
-default_search_providers = {
- 'schoolserver': {
- 'order': 3,
- 'name': _('Wiki'),
- 'url': 'http://localhost:8000/search?q=%s',
- 'icon': 'zoom-home'
- },
-}
-
-class SearchToolbar(gtk.Toolbar):
- def __init__(self, activity):
- gtk.Toolbar.__init__(self)
-
- self._activity = activity
-
- self._browser = self._activity._browser
-
- self._providercombo = ToolComboBox()
-
- self.insert(self._providercombo, -1)
- self._providercombo.show()
-
- self.set_providers(default_search_providers)
-
- self._entry = gtk.Entry()
- self._entry.connect('activate', self._entry_activate_cb)
-
- entry_item = gtk.ToolItem()
- entry_item.set_expand(True)
- entry_item.add(self._entry)
- self._entry.show()
-
- self.insert(entry_item, -1)
- entry_item.show()
-
- def _entry_activate_cb(self, entry):
- k = self._providercombo.combo.get_active_item()[0]
- p = self._providers[k]
-
- self._browser.load_uri(p['url'] % entry.props.text)
- self._browser.grab_focus()
-
- self._activity.toolbox.current_toolbar = 1
-
- def _cmp_provider_order(self, a, b):
- return self._providers[a]['order'] - self._providers[b]['order']
-
- def set_providers(self, providers):
- self._providers = providers
-
- self._providercombo.combo.remove_all()
-
- for k in sorted(self._providers.keys(), cmp=self._cmp_provider_order):
- p = self._providers[k]
- self._providercombo.combo.append_item(k, p['name'], p['icon'])
-
- self._providercombo.combo.set_active(0)
diff --git a/server.py b/server.py
deleted file mode 100755
index 51e7164..0000000
--- a/server.py
+++ /dev/null
@@ -1,612 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007, One Laptop Per Child
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Web server script for Wikiserver project.
-#
-# Usage: server.py <dbfile> <port>
-#
-from __future__ import with_statement
-import sys
-import os
-import subprocess
-import codecs
-from StringIO import StringIO
-import BaseHTTPServer
-from SimpleHTTPServer import SimpleHTTPRequestHandler
-import urllib
-import re
-import wp
-import xml.dom.minidom
-
-# Uncomment to print out a large dump from the template expander.
-#os.environ['DEBUG_EXPANDER'] = '1'
-
-try:
- from hashlib import md5
-except ImportError:
- from md5 import md5
-
-import mwlib.htmlwriter
-from mwlib import parser, scanner, expander
-
-class LinkStats:
- allhits = 1
- alltotal = 1
- pagehits = 1
- pagetotal = 1
-
-class ArticleIndex:
- # Prepare an in-memory index, using the already generated
- # index file.
-
- def __init__(self, path):
- self.article_index = set()
- with open(path, 'r') as f:
- for line in f.readlines():
- m = re.search(r'(.*?)\s*\d+$', line)
- if m is None:
- raise AssertionError("Match didn't work")
- self.article_index.add(m.group(1))
-
- def __contains__(self, x):
- return x in self.article_index
-
-class WPWikiDB:
- """Retrieves article contents for mwlib."""
-
- def getRawArticle(self, title):
- # Retrieve article text, recursively following #redirects.
- oldtitle = ""
- while True:
- # Replace underscores with spaces in title.
- title = title.replace("_", " ")
- # Capitalize the first letter of the article -- Trac #6991.
- title = title[0].capitalize() + title[1:]
-
- if title == oldtitle:
- article_text = ""
- break
-
- article_text = unicode(wp.wp_load_article(title.encode('utf8')), 'utf8')
-
- # To see unmodified article_text, uncomment here.
- # print article_text
-
- m = re.match(r'^\s*\#?redirect\s*\:?\s*\[\[(.*)\]\]', article_text, re.IGNORECASE|re.MULTILINE)
- if not m: break
-
- oldtitle = title
- title = m.group(1)
-
- # Stripping leading & trailing whitespace fixes template expansion.
- article_text = article_text.lstrip()
- article_text = article_text.rstrip()
-
- return article_text
-
- def getTemplate(self, title, followRedirects=False):
- return self.getRawArticle(title)
-
- def expandArticle(self, article_text, title):
- template_expander = expander.Expander(article_text, pagename=title, wikidb=self)
- return template_expander.expandTemplates()
-
- def getExpandedArticle(self, title):
- return self.expandArticle(self.getRawArticle(title), title)
-
-class WPImageDB:
- """Retrieves images for mwlib."""
-
- def hashpath(self, name):
- name = name.replace(' ', '_')
- name = name[:1].upper()+name[1:]
- d = md5(name.encode('utf-8')).hexdigest()
- return "/".join([d[0], d[:2], name])
-
- def getPath(self, name, size=None):
- hashed_name = self.hashpath(name).encode('utf8')
- path = 'es_PE/images/%s' % hashed_name
- #print "getPath: %s -> %s" % (name.encode('utf8'), path.encode('utf8'))
- return path
-
- def getURL(self, name, size=None):
- hashed_name = self.hashpath(name).encode('utf8')
- if os.path.exists('es_PE/images/' + hashed_name):
- url = '/es_PE/images/' + hashed_name
- else:
- url = 'http://upload.wikimedia.org/wikipedia/commons/' + hashed_name
- #print "getUrl: %s -> %s" % (name.encode('utf8'), url.encode('utf8'))
- return url
-
-class HTMLOutputBuffer:
- """Buffers output and converts to utf8 as needed."""
-
- def __init__(self):
- self.buffer = ''
-
- def write(self, obj):
- if isinstance(obj, unicode):
- self.buffer += obj.encode('utf8')
- else:
- self.buffer += obj
-
- def getvalue(self):
- return self.buffer
-
-class WPMathRenderer:
- def render(self, latex):
- process = subprocess.Popen(('bin/blahtex', '--mathml', '--texvc-compatible-commands'), stdin=subprocess.PIPE, stdout=subprocess.PIPE)
-
- (mathml, err) = process.communicate(latex.encode('utf8'))
- if process.returncode is not 0:
- return ""
-
- # Ugly! There is certainly a better way to do this, but my DOM skills are weak, and this works.
- try:
- dom = xml.dom.minidom.parseString(mathml)
- dom = dom.getElementsByTagName('blahtex')[0]
- dom = dom.getElementsByTagName('mathml')[0]
- dom = dom.getElementsByTagName('markup')[0]
- mathml = dom.toxml()
- mathml = mathml.replace('markup', 'math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"')
- dom.unlink()
- except:
- print "BLAHTEX XML PARSING FAILED:\nINPUT: '%s'\nOUTPUT: '%s'" % (latex, mathml)
- return ""
-
- # Straight embedding. Requires parent document to be XHTML.
- return mathml
-
-class WPHTMLWriter(mwlib.htmlwriter.HTMLWriter):
- """Customizes HTML output from mwlib."""
-
- def __init__(self, index, wfile, images=None):
- self.index = index
- self.gallerylevel = 0
-
- math_renderer = WPMathRenderer()
- mwlib.htmlwriter.HTMLWriter.__init__(self, wfile, images, math_renderer=math_renderer)
-
- def writeLink(self, obj):
- if obj.target is None:
- return
-
- article = obj.target
-
- # Parser appending '/' characters to link targets for some reason.
- article = article.rstrip('/')
-
- title = article
- title = title[0].capitalize() + title[1:]
- title = title.replace("_", " ")
-
- article_exists = title.encode('utf8') in self.index
-
- if article_exists:
- # Exact match. Internal link.
- LinkStats.allhits += 1
- LinkStats.alltotal += 1
- LinkStats.pagehits += 1
- LinkStats.pagetotal += 1
- link_attr = ''
- link_baseurl = '/wiki/'
- else:
- # No match. External link. Use es.wikipedia.org.
- # FIXME: Decide between es.w.o and schoolserver.
- LinkStats.alltotal += 1
- LinkStats.pagetotal += 1
- link_attr = "class='offsite' "
- link_baseurl = "http://es.wikipedia.org/wiki/"
-
- parts = article.encode('utf-8').split('#')
- parts[0] = parts[0].replace(" ", "_")
- url = ("#".join([x for x in parts]))
-
- self.out.write("<a %s href='%s%s'>" % (link_attr, link_baseurl, url))
-
- if obj.children:
- for x in obj.children:
- self.write(x)
- else:
- self._write(obj.target)
-
- self.out.write("</a>")
-
- def writeImageLink(self, obj):
- if self.images is None:
- return
-
- width = obj.width
- height = obj.height
-
- if width and height:
- path = self.images.getPath(obj.target, size=max(width, height))
- url = self.images.getURL(obj.target, size=max(width, height))
- else:
- path = self.images.getPath(obj.target)
- url = self.images.getURL(obj.target)
-
- if url is None:
- return
-
- # The following HTML generation code is copied closely from InstaView, which seems to
- # approximate the nest of <div> tags needed to render images close to right.
- # It's also been extended to support Gallery tags.
- if self.imglevel==0:
- self.imglevel += 1
-
- align = obj.align
- thumb = obj.thumb
- frame = obj.frame
- caption = obj.caption
-
- # SVG images must be included using <object data=''> rather than <img src=''>.
- if re.match(r'.*\.svg$', url, re.IGNORECASE):
- tag = 'object'
- ref = 'data'
- else:
- tag = 'img'
- ref = 'src'
-
- # Hack to get galleries to look okay, in the absence of image dimensions.
- if self.gallerylevel > 0:
- width = 120
-
- if thumb and not width:
- width = 180 #FIXME: This should not be hardcoded
-
- attr = ''
- if width:
- attr += 'width="%d" ' % width
-
- img = '<%(tag)s %(ref)s="%(url)s" longdesc="%(caption)s" %(attr)s></%(tag)s>' % \
- {'tag':tag, 'ref':ref, 'url':url, 'caption':caption, 'attr':attr}
-
- center = False
- if align == 'center':
- center = True
- align = None
-
- if center:
- self.out.write('<div class="center">');
-
- if self.gallerylevel > 0:
- self.out.write('<div class="gallerybox" style="width: 155px;">')
-
- self.out.write('<div class="thumb" style="padding: 13px 0; width: 150px;">')
- self.out.write('<div style="margin-left: auto; margin-right: auto; width: 120px;">')
- self.out.write('<a href="%s" class="image" title="%s">' % (url, caption))
- self.out.write(img)
- self.out.write('</a>')
- self.out.write('</div>')
- self.out.write('</div>')
-
- self.out.write('<div class="gallerytext">')
- self.out.write('<p>')
- for x in obj.children:
- self.write(x)
- self.out.write('</p>')
- self.out.write('</div>')
-
- self.out.write('</div>')
- elif frame or thumb:
- if not align:
- align = "right"
- self.out.write('<div class="thumb t%s">' % align)
-
- if not width:
- width = 180 # default thumb width
- self.out.write('<div style="width:%dpx;">' % (int(width)+2))
-
- if thumb:
- self.out.write(img)
- self.out.write('<div class="thumbcaption">')
- self.out.write('<div class="magnify" style="float:right">')
- self.out.write('<a href="%s" class="internal" title="Enlarge">' % url)
- self.out.write('<img src="/static/magnify-clip.png"></img>')
- self.out.write('</a>')
- self.out.write('</div>')
- for x in obj.children:
- self.write(x)
- self.out.write('</div>')
- else:
- self.out.write(img)
- self.out.write('<div class="thumbcaption">')
- for x in obj.children:
- self.write(x)
- self.out.write('</div>')
-
- self.out.write('</div>')
- self.out.write('</div>')
- elif align:
- self.out.write('<div class="float%s">' % align)
- self.out.write(img)
- self.out.write('</div>')
- else:
- self.out.write(img)
-
- if center:
- self.out.write('</div>');
-
- self.imglevel -= 1
- else:
- self.out.write('<a href="%s">' % url.encode('utf8'))
-
- for x in obj.children:
- self.write(x)
-
- self.out.write('</a>')
-
- def writeTagNode(self, t):
- if t.caption == 'gallery':
- self.out.write('<table class="gallery" cellspacing="0" cellpadding="0">')
-
- self.gallerylevel += 1
-
- # TODO: More than one row.
- self.out.write('<tr>')
-
- for x in t.children:
- self.out.write('<td>')
- self.write(x)
- self.out.write('</td>')
-
- self.out.write('</tr>')
-
- self.gallerylevel -= 1
-
- self.out.write('</table>')
- else:
- # All others handled by base class.
- mwlib.htmlwriter.HTMLWriter.writeTagNode(self, t)
-
-class WikiRequestHandler(SimpleHTTPRequestHandler):
- def __init__(self, index, request, client_address, server):
- self.index = index
- self.client_address = client_address
- SimpleHTTPRequestHandler.__init__(
- self, request, client_address, server)
-
- def get_wikitext(self, title):
- wikidb = WPWikiDB()
- article_text = wikidb.getRawArticle(title)
-
- # Pass ?override=1 in the url to replace wikitext for testing the renderer.
- if self.params.get('override', 0):
- override = codecs.open('override.txt', 'r', 'utf-8')
- article_text = override.read()
- override.close()
-
- # Pass ?noexpand=1 in the url to disable template expansion.
- if not self.params.get('noexpand', 0):
- article_text = wikidb.expandArticle(article_text, title)
-
- return article_text
-
- def write_wiki_html(self, htmlout, title, article_text):
- tokens = scanner.tokenize(article_text, title)
-
- wiki_parsed = parser.Parser(tokens, title).parse()
- wiki_parsed.caption = title
-
- imagedb = WPImageDB()
- writer = WPHTMLWriter(self.index, htmlout, images=imagedb)
- writer.write(wiki_parsed)
-
- def send_article(self, title):
- article_text = self.get_wikitext(title)
-
- # Capitalize the first letter of the article -- Trac #6991.
- title = title[0].capitalize() + title[1:]
-
- # Replace underscores with spaces in title.
- title = title.replace("_", " ")
-
- # Redirect to Wikipedia if the article text is empty (e.g. an image link)
- if article_text == "":
- self.send_response(301)
- self.send_header("Location",
- "http://es.wikipedia.org/wiki/" + title.encode('utf8'))
- self.end_headers()
- return
-
- # Pass ?raw=1 in the URL to see the raw wikitext (post expansion, unless noexpand=1 is also set).
- if self.params.get('raw', 0):
- self.send_response(200)
- self.send_header("Content-Type", "text/plain; charset=utf-8")
- self.end_headers()
-
- self.wfile.write(article_text.encode('utf8'))
- else:
- htmlout = HTMLOutputBuffer()
-
- self.send_response(200)
- self.send_header("Content-Type", "text/xml; charset=utf-8")
- self.end_headers()
-
- htmlout.write(
- '<?xml version="1.0"?>'\
- '<!DOCTYPE html PUBLIC '\
- '"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" '\
- '"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" '\
- '[ <!ENTITY mathml "http://www.w3.org/1998/Math/MathML"> ]> ')
-
- htmlout.write('<html xmlns="http://www.w3.org/1999/xhtml"> ')
-
- htmlout.write("<head>")
- htmlout.write("<title>%s</title>" % title.encode('utf8'))
-
- htmlout.write("<style type='text/css' media='screen, projection'>"
- "@import '/static/common.css';"\
- "@import '/static/monobook.css';"\
- "@import '/static/styles.css';"\
- "@import '/static/shared.css';"\
- "</style>")
-
- htmlout.write("</head>")
-
- htmlout.write("<body>")
-
- self.write_wiki_html(htmlout, title, article_text)
-
- htmlout.write('<center>Contenido disponible bajo los términos de la <a href="/static/es-gfdl.html">Licencia de documentación libre de GNU</a>. <br/> Wikipedia es una marca registrada de la organización sin ánimo de lucro Wikimedia Foundation, Inc.<br/><a href="/static/acerca.html">Acerca de Wikipedia</a> </center>')
- htmlout.write("</body>")
- htmlout.write("</html>")
-
- html = htmlout.getvalue()
-
- # Fix any non-XHTML tags using tidy.
- process = subprocess.Popen(('bin/tidy', '-q', '-config', 'bin/tidy.conf', '-numeric', '-utf8', '-asxhtml'), stdin=subprocess.PIPE, stdout=subprocess.PIPE)
- (xhtml, err) = process.communicate(html)
- if len(xhtml):
- html = xhtml
- else:
- print "FAILED to tidy '%s'" % title
-
- self.wfile.write(html)
-
- def send_searchresult(self, title):
- self.send_response(200)
- self.send_header("Content-Type", "text/html; charset=utf-8")
- self.end_headers()
-
- self.wfile.write("<html><head><title>Resultados de la búsqueda sobre '%s'</title></head>" % title.encode('utf8'))
-
- self.wfile.write("<style type='text/css' media='screen, projection'>"\
- "@import '/static/monobook.css';</style>")
-
- self.wfile.write("</head>")
-
- self.wfile.write("<body>")
-
- self.wfile.write("<h1>Resultados de la búsqueda sobre '%s'.</h1>" % title.encode('utf8'))
- self.wfile.write("<ul>")
-
- num_results = wp.wp_search(title.encode('utf8'))
- for i in xrange(0, num_results):
- result = unicode(wp.wp_result(i), 'utf8')
- if not result.startswith("Plantilla:"):
- self.wfile.write('<li><a href="/wiki/%s">%s</a></li>' %
- (result.encode('utf8'), result.encode('utf8')))
-
- self.wfile.write("</ul>")
-
- self.wfile.write("</body></html>")
-
- def send_image(self, path):
- if os.path.exists('es_PE/images/' + path.encode('utf8')):
- # If image exists locally, serve it as normal.
- SimpleHTTPRequestHandler.do_GET(self)
- else:
- # If not, redirect to wikimedia.
- redirect_url = "http://upload.wikimedia.org/wikipedia/commons/%s" \
- % path.encode('utf8')
- self.send_response(301)
- self.send_header("Location", redirect_url.encode('utf8'))
- self.end_headers()
-
- def handle_feedback(self, feedtype, article):
- with codecs.open("feedback.log", "a", "utf-8") as f:
- f.write(feedtype +"\t"+ article +"\t" + self.client_address[0] +"\n")
- f.close()
- self.send_response(200)
- self.send_header("Content-Type", "text/html; charset=utf-8")
- self.end_headers()
-
- if feedtype == "render":
- strtype = "un error de presentación"
- elif feedtype == "report":
- strtype = "material inapropriado"
-
- self.wfile.write("<html><title>Comentario recibido</title>Gracias por reportar %s en la pagina <b>%s</b>.</html>" % (strtype, article.encode('utf8')))
-
- def do_GET(self):
- real_path = urllib.unquote(self.path)
- real_path = unicode(real_path, 'utf8')
-
- (real_path, sep, param_text) = real_path.partition('?')
- self.params = {}
- for p in param_text.split('&'):
- (key, sep, value) = p.partition('=')
- self.params[key] = value
-
- # Wiki requests return article contents or redirect to Wikipedia.
- m = re.match(r'^/wiki/(.+)$', real_path)
- if m:
- self.send_article(m.group(1))
- return
-
- # Search requests return search results.
- m = re.match(r'^/search$', real_path)
- if m:
- self.send_searchresult(self.params.get('q', ''))
- return
-
- # Image requests are handled locally or are referenced from Wikipedia.
- m = re.match(r'^/es_PE/images/(.+)$', real_path)
- if m:
- self.send_image(m.group(1))
- return
-
- # Static requests handed off to SimpleHTTPServer.
- m = re.match(r'^/(static|generated)/(.*)$', real_path)
- if m:
- SimpleHTTPRequestHandler.do_GET(self)
- return
-
- # Feedback links.
- m = re.match(r'^/(report|render)$', real_path)
- if m:
- self.handle_feedback(m.group(1), self.params.get('q', ''))
- return
-
- # Any other request redirects to the index page.
- self.send_response(301)
- self.send_header("Location", "/static/")
- self.end_headers()
-
-def load_db(dbname):
- wp.wp_load_dump(
- dbname + '.processed',
- dbname + '.locate.db',
- dbname + '.locate.prefixdb',
- dbname + '.blocks.db')
-
-def run_server(path, port):
- index = ArticleIndex('%s.index.txt' % path)
-
- httpd = BaseHTTPServer.HTTPServer(('', port),
- lambda *args: WikiRequestHandler(index, *args))
-
- if __name__ == '__main__':
- httpd.serve_forever()
- else:
- from threading import Thread
- server = Thread(target=httpd.serve_forever)
- server.setDaemon(True)
- server.start()
-
- # Tell the world that we're ready to accept request.
- print 'ready'
-
-
-if __name__ == '__main__':
- load_db(sys.argv[1])
-
- run_server(sys.argv[1], int(sys.argv[2]))
diff --git a/setup.py b/setup.py
deleted file mode 100755
index 788c03b..0000000
--- a/setup.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2007, One Laptop Per Child
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-from sugar.activity import bundlebuilder
-
-bundlebuilder.start('Wikipedia')
-
diff --git a/static/acerca.html b/static/acerca.html
deleted file mode 100644
index 93d1649..0000000
--- a/static/acerca.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-<meta http-equiv="Content-Type" content="text/html;charset=utf8">
-<body>
-Wikipedia es un proyecto para escribir comunitariamente enciclopedias libres en todos los idiomas. El concepto wiki permite crear colectivamente documentos web sin que sea necesaria la revisión del contenido antes de su aceptación para ser publicado en la red. La versión en espanol comenzó en mayo de 2001. Tres años después, en septiembre de 2004, unos 10.000 editores activos trabajaban en 1.000.000 de artículos en más de 50 idiomas.
-<p>
-Todo el texto de Wikipedia, y la mayoría de imágenes y otros contenidos, está cubierto por la Licencia de documentación libre GNU (GFDL). Las contribuciones permanecen como propiedad de sus creadores y editores, mientras que la licencia GFDL asegura el carácter de libre distribución y reproducción de los artículos (véase la nota de copyright y de Limitación general de responsabilidad).
-</body>
-</html>
diff --git a/static/audio.png b/static/audio.png
deleted file mode 100755
index 1c56bdc..0000000
--- a/static/audio.png
+++ /dev/null
Binary files differ
diff --git a/static/biology.png b/static/biology.png
deleted file mode 100644
index 7af35af..0000000
--- a/static/biology.png
+++ /dev/null
Binary files differ
diff --git a/static/bullet.gif b/static/bullet.gif
deleted file mode 100644
index b43de48..0000000
--- a/static/bullet.gif
+++ /dev/null
Binary files differ
diff --git a/static/common.css b/static/common.css
deleted file mode 100644
index 5188437..0000000
--- a/static/common.css
+++ /dev/null
@@ -1,538 +0,0 @@
-/* Common CSS for all skins */
-/*<pre><nowiki>*/
-
-/* Estilos para el CommonsTicker ([[Wikiproyecto:CommonsTicker]])
- According to the CSS specs, @import rules must precede any other CSS rules in a stylesheet,
- so this creates the need to place it in its own stylesheet for these purposes. */
-/*@import "/w/index.php?title=Wikiproyecto:CommonsTicker/styles.css&action=raw&ctype=text/css&smaxage=2678400";*/
-
-/*InterProject */
-
-.interProject {
- display:none;
- clear: both;
- border-top: 2px dotted #AAAAAA;
- margin-top: 2em;
-}
-
-/* Evitar la aparición del subrayado al pasar sobre la imagen cuande se usa {{tl|clic}} */
-.clic a:active, .clic a:hover {text-decoration:none}
-
-
-/* Style for "notices" */
-.notice {
- text-align: justify;
- margin: 1em;
- padding: 0.2em;
-}
-
-#disambig {
- border-top: 3px double #cccccc;
- border-bottom: 3px double #cccccc;
-}
-
-#spoiler {
- border-top: 2px solid #ddd;
- border-bottom:2px solid #ddd;
-}
-
-/* Standard talk template style */
-
-.Talk-Notice {
- border: 1px solid #C0C090;
- background-color: #F8EABA;
- margin-bottom: 3px;
- width: 85%;
- border-spacing: 3px;
- margin-left: auto;
- margin-right: auto;
-}
-
-/* Make template background appear correctly on all browsers */
-.Talk-Notice td {
- background: inherit;
-}
-
-/* Choose whether to have AD/BC dates or CE/BCE dates*/
-
-/* First, the default : display both : See templates ADCE and BCEBC for how these are used*/
-.Use_Default_Date_Convention { display: inline; }
-.Use_AD_and_BC { display: none; }
-.Use_BCE_and_CE { display: none; }
-
-/* If you want to display AD and BC add the following to User:You/monobook.css page */
-/*
-.Use_Default_Date_Convention { display: none; }
-.Use_AD_and_BC { display:inline; }
-.Use_BCE_and_CE { display:none; }
-*/
-
-/*If you want to display CE and BCE add the following to User:You/monobook.css page */
-/*
-.Use_Default_Date_Convention { display: none; }
-.Use_AD_and_BC { display:none; }
-.Use_BCE_and_CE {display:inline; }
-*/
-
-/*Add formatting to make sure that "external references" from [[Template:Ref]] do
- not get URL expansion, not even when printed. The mechanism up to MediaWiki 1.4 was
- that the HTML code contained a SPAN following the anchor A; this SPAN had the class
- "urlexpansion", which was not displayed on screen, but was shown when the medium was
- "print". The rules below ensure (a) that there is no extra padding to the right of
- the anchor (displayed as "[<number>]"), (b) that there is no "external link arrow" for
- the link, and (c) that this SPAN of class "urlexpansion" is never shown.
- ~~~~
-*/
-
-.plainlinksneverexpand {
- background: none ! important;
- padding: 0 ! important;
-}
-
-.plainlinksneverexpand .urlexpansion {
- display : none ! important;
-}
-
-/* Make sure that ext links displayed within "plainlinksneverexpand" don't get
- the arrow...
-*/
-.plainlinksneverexpand a {
- background: none !important;
- padding: 0 !important
-}
-
-/* styles for geography infoboxes, e.g. countries, national subdivisions, cities, etc. */
-
-.InfoDerecha {
- clear: right;
- float: right;
- margin: 0 0 1em 1em;
-}
-
-.infobox.geography {
- border: 1px solid #ccd2d9;
- text-align: left;
- border-collapse: collapse;
- line-height: 1.2em;
- font-size: 90%;
-}
-
-.infobox.geography td,
-.infobox.geography th {
- border-top: solid 1px #ccd2d9;
- padding: 0.4em 0.2em 0.4em 0.8em;
-}
-.infobox.geography .mergedtoprow td,
-.infobox.geography .mergedtoprow th {
- border-top: solid 1px #ccd2d9;
- padding: 0.4em 0.2em 0.2em 0.8em;
-}
-
-.infobox.geography .mergedrow td,
-.infobox.geography .mergedrow th {
- border: 0;
- padding: 0 0.2em 0.2em 0.8em;
-}
-
-.infobox.geography .mergedbottomrow td,
-.infobox.geography .mergedbottomrow th {
- border-top: 0;
- border-bottom: solid 1px #ccd2d9;
- padding: 0 0.2em 0.4em 0.8em;
-}
-
-.infobox.geography .maptable td,
-.infobox.geography .maptable th {
- border: 0;
- padding: 0 0 0 0;
-}
-
-/* With MediaWiki 1.5, the mechanism has changed: instead of a SPAN of class "urlexpansion"
- following the anchor A, the anchor itself now has class "external autonumber" and the
- expansion is inserted when printing (see the common printing style sheet at
- http://en.wikipedia.org/skins-1.5/common/commonPrint.css) using the ":after" pseudo-
- element of CSS. We have to switch this off for links due to Template:Ref!
-
-*/
-.plainlinksneverexpand a.external.text:after {
- display: none !important;
-}
-.plainlinksneverexpand a.external.autonumber:after {
- display: none !important;
-}
-
-/* Merge template style */
-
-.messagebox {
- border: 1px solid #aaaaaa;
- background-color: #f9f9f9;
- width: 85%;
- margin: 0 auto 1em auto;
- padding: .2em;
- text-align: justify;
- font-size: 90%;
-}
-.messagebox.merge {
- border: 1px solid #cf9fff;
- background-color: #f5edf5;
- text-align: center;
-}
-.messagebox.cleanup {
- border: 1px solid #9f9fff;
- background-color: #efefff;
- text-align: center;
-}
-.messagebox.standard-talk {
- border: 1px solid #c0c090;
- background-color: #f8eaba;
- text-align: center;
-}
-
-.messagebox.warning {
- border: 1px solid #fcc;
- background-color: #fee;
- text-align: center;
- font-size: 100%;
-}
-
-/* Article message box template styles */
-table.ambox {
- margin: 0 10%; /* Will not overlap with other elements */
- border-collapse: collapse;
- background: #fbfbfb;
- border: 1px solid #aaa;
- border-left: 10px solid #1e90ff; /* Default "notice" blue */
-}
-table.ambox th.ambox-text, table.ambox td.ambox-text { /* The message body cell(s) */
- padding: 0.25em 0.5em; /* 0.5em left/right */
- width: 100%; /* Make all templates the same width regardless of text size */
-}
-table.ambox td.ambox-image { /* The left image cell */
- padding: 2px 0px 2px 0.5em; /* 0.5em left, 0px right */
- text-align: center;
-}
-table.ambox td.ambox-imageright { /* The right image cell */
- padding: 2px 4px 2px 0px; /* 0px left, 4px right */
- text-align: center;
-}
-table.ambox-notice {
- border-left: 10px solid #1e90ff; /* Blue */
-/* border-right: 10px solid #1e90ff; */ /* If you want two blue bars */
-}
-table.ambox-delete,
-table.ambox-serious {
- border-left: 10px solid #b22222; /* Red */
-}
-table.ambox-content {
- border-left: 10px solid #f28500; /* Orange */
-}
-table.ambox-style {
- border-left: 10px solid #f4c430; /* Yellow */
-}
-table.ambox-merge {
- border-left: 10px solid #9932cc; /* Purple */
-}
-table.ambox-growth {
- border-left: 10px solid #228b22; /* Green */
-}
-table.ambox-protection {
- border-left: 10px solid #bba; /* Gray */
-}
-table.ambox.ambox-mini { /* Small floating box variant */
- float: right;
- clear: right;
- margin: 0 0 0 1em;
- width: 25%;
-}
-@media print { /* Do not print article message box */
- .ambox {
- display: none;
- }
-}
-
-/* Infobox template style */
-.infobox {
- border: 1px solid #aaa;
- background-color: #f9f9f9;
- color: black;
- margin-bottom: 0.5em;
- margin-left: 1em;
- padding: 0.2em;
- float: right;
- clear: right;
-}
-.infobox td,
-.infobox th {
- vertical-align: top;
-}
-.infobox caption {
- font-size: larger;
- margin-left: inherit;
-}
-.infobox.bordered {
- border-collapse: collapse;
-}
-.infobox.bordered td,
-.infobox.bordered th {
- border: 1px solid #aaa;
-}
-.infobox.bordered .borderless td,
-.infobox.bordered .borderless th {
- border: 0;
-}
-
-.infobox.sisterproject {
- width: 20em;
- font-size: 90%;
-}
-
-@media print {
- .infobox.sisterproject {
- display: none;
- }
-}
-
-/* Importo formato para versos de WikiSource
-pre.verse {
- background-color: #ffffff;
- font-family:sans-serif;
- line-height: 150%;
- border: none;
- padding-left: 2em;
- margin: 0;
- white-space: pre;
-}
-
-.IconoPlantillaMantenimiento {
- float:left;
- margin-left: 1em;
- margin-right: 1em;
-}
-
-/* Support for Template:IPA, Template:Unicode and Template:Polytonic. The inherit declaration
- resets the font for all browsers except MSIE6. The empty comment must remain. */
-.IPA {
- font-family: Chrysanthi Unicode, Doulos SIL, Gentium, GentiumAlt, Code2000,
- TITUS Cyberbit Basic, DejaVu Sans, Bitstream Vera Sans,
- Bitstream Cyberbit, Arial Unicode MS, Lucida Sans Unicode,
- Hiragino Kaku Gothic Pro, Matrix Unicode;
- font-family /**/:inherit;
-}
-.Unicode {
- font-family: TITUS Cyberbit Basic, Code2000, Doulos SIL, Chrysanthi Unicode,
- Bitstream Cyberbit, Bitstream CyberBase, Thryomanes,
- Gentium, GentiumAlt, Visual Geez Unicode, Lucida Grande,
- Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode;
- font-family /**/:inherit;
-}
-.polytonic {
- font-family: Athena, Gentium, Palatino Linotype, Arial Unicode MS,
- Lucida Sans Unicode, Lucida Grande, Code2000;
- font-family /**/:inherit;
-}
-
-/** Estilos para tablas.
- ** EXPERIMENTAL **
- la idea es, si se quiere que la primera columna de la tabla esté alineada
- a la derecha, la segunda centrada y la tercera a la izquierda, usar
- {| class="col1der col2cen col3izq"
- en vez de repetir "style='text-align:right'", etc, en '''cada''' celda
-**/
-table.col1der TD:first-child { text-align:right; }
-table.col1izq TD:first-child { text-align:left; }
-table.col1cen TD:first-child { text-align:center; }
-
-table.col2der TD:first-child + TD { text-align:right; }
-table.col2izq TD:first-child + TD { text-align:left; }
-table.col2cen TD:first-child + TD { text-align:center; }
-
-table.col3der TD:first-child + TD + TD { text-align:right; }
-table.col3izq TD:first-child + TD + TD { text-align:left; }
-table.col3cen TD:first-child + TD + TD { text-align:center; }
-
-table.col4der TD:first-child + TD + TD + TD { text-align:right; }
-table.col4izq TD:first-child + TD + TD + TD { text-align:left; }
-table.col4cen TD:first-child + TD + TD + TD { text-align:center; }
-
-table.col5der TD:first-child + TD + TD + TD + TD { text-align:right; }
-table.col5izq TD:first-child + TD + TD + TD + TD { text-align:left; }
-table.col5cen TD:first-child + TD + TD + TD + TD { text-align:center; }
-
-/* hiddenStructure importado de w:en para permitir esconder automáticamente
- los parámetros vacíos en tablas */
-.hiddenStructure {
- display: none;
- speak: none;
-}
-
-/* Ayudita para [[Especial:Allpages]]: los redirects aparecen en cursiva */
-.allpagesredirect {font-style: italic;}
-
-/* Put a checker background at the image description page only visible
- if the image has transparent background */
-
-#file img {
- background: url(http://upload.wikimedia.org/wikipedia/commons/5/5d/Checker-16x16.png)
- repeat;
-}
-
-form#upload,.UploadFormShowed {display: none;}
-
-/* Estilo para controlar el tamaño del texto citado.
- Quien quiera cambiar el suyo no tiene más que editar su propia monobook.css */
-
-.citado {
- font-size: 90%;
- padding: 0.1em;
-}
-
-
-/* Disponibilidad para tareas de mantenimiento/Tablas por día/semana */
-
-table.user-availability {
- text-align:center;
- border:1px solid #333366;
-}
-table.user-availability th {
- font-size:110%
-}
-table.user-availability .toprow td+td {
- width:30px;
- height:10px;
- background-color:#eeeeee;
- border:1px solid #aaaaaa
-}
-table.user-availability .off {
- font-size:80%;
- border:1px solid #aaaaaa;
- background-color:#ffffff;
-}
-table.user-availability .onn {
- font-size:80%;
- border:1px solid #aaaaaa;
- background-color:#ccffcc;
-}
-table.user-availability .wrk {
- font-size:80%;
- border:1px solid #aaaaaa;
- background-color:#ccccff;
-}
-table.user-availability .cll {
- font-size:80%;
- border:1px solid #aaaaaa;
- background-color:#ffffdd;
-}
-table.user-availability .key {
- font-size:90%;
- border-top:1px dashed black;
- text-align:right
-}
-table.user-availability .key span {
- padding:2px
-}
-
-/* Change the external link icon to an Adobe icon for all PDF files */
-/* (in browsers that support these CSS selectors, like Mozilla and Opera) */
-#bodyContent a[href$=".pdf"].external,
-#bodyContent a[href*=".pdf?"].external,
-#bodyContent a[href*=".pdf#"].external,
-#bodyContent a[href$=".PDF"].external,
-#bodyContent a[href*=".PDF?"].external,
-#bodyContent a[href*=".PDF#"].external {
- background: url(http://upload.wikimedia.org/wikipedia/commons/thumb/2/23/Icons-mini-file_acrobat.gif/15px-Icons-mini-file_acrobat.gif) center right no-repeat;
- padding-right: 16px;
-}
-
-/* Change the external link icon to an Adobe icon anywhere the PDFlink class */
-/* is used (notably Template:PDFlink). This works in IE, unlike the above. */
-span.PDFlink a {
- background: url(http://upload.wikimedia.org/wikipedia/commons/thumb/2/23/Icons-mini-file_acrobat.gif/15px-Icons-mini-file_acrobat.gif) center right no-repeat !important;
- padding-right: 17px !important;
-}
-
-/* make the list of references look smaller */
-ol.references {
- font-size: 100%;
-}
-
-.references-small { font-size: 90%;}
-
-.references-2column {
- font-size: 90%;
-}
-
-/* Highlight clicked reference in blue to help navigation */
-
-ol.references > li:target {
-background-color: #DEF;
-}
-
-sup.reference:target {
-background-color: #DEF;
-}
-
-/*** Llamadas al pie:
- esto oculta los corchetes
- (en los navegadores que entienden css)
-*/
-
-.corchete-llamada { display /**/: none; }
-
-/* Ocultar para los no bibliotecarios */
-.para_biblios { display: none }
-
-.rotate_0 { display: block }
-.rotate_1, .rotate_2, .rotate_3, .rotate_4, .rotate_5, .rotate_6, .rotate_7, .rotate_8, .rotate_9 { display: none }
-/* Geographical coordinates
-
-To display coordinates using the notation in the source code, write this in your User:Username/monobook.css:
- .geo-default { display: inline } .geo-nondefault { display: none }
- .geo-dec { display: inline } .geo-dms { display: inline }
-
-To display coordinates using decimal notation, write this in your User:Username/monobook.css:
- .geo-default { display: inline } .geo-nondefault { display: inline }
- .geo-dec { display: inline } .geo-dms { display: none }
-
-To display coordinates using DMS notation, write this in your User:Username/monobook.css:
- .geo-default { display: inline } .geo-nondefault { display: inline }
- .geo-dec { display: none } .geo-dms { display: inline }
-
-To display coordinates in both decimal and DMS notation, write this in your User:Username/monobook.css:
- .geo-default { display: inline } .geo-nondefault { display: inline }
- .geo-dec { display: inline } .geo-dms { display: inline }
- .geo-multi-punct { display: inline }
-
-See [[Template:Coor link]] for how these are used.
-
-Note that the classes "geo", "longitude", and "latitude" are not just styles but also used by the [[Geo microformat]], so the names should not be changed.
-
-*/
-
-.geo-default { display: inline; }
-.geo-nondefault { display: none; }
-.geo-dms { display: inline; }
-.geo-dec { display: inline; }
-.geo-multi-punct { display: none; }
-
-.longitude .latitude {
- white-space: nowrap;
-}
-
-/* This is used for the Geo microformat, but no style is needed for now other than .geo-dec. */
-.geo { }
-
-/***** end Geo-related */
-
-/*</nowiki></pre>*/
-
-/* [[Plantilla:Muchasref]] */
-@media screen, projection {
-
- .listareferencias {
- border: 1px solid #AAAAAA;
- height: 220px;
- overflow: auto;
- padding: 3px;
- }
-
-}
diff --git a/static/discussionitem_icon.gif b/static/discussionitem_icon.gif
deleted file mode 100755
index baec471..0000000
--- a/static/discussionitem_icon.gif
+++ /dev/null
Binary files differ
diff --git a/static/document.png b/static/document.png
deleted file mode 100755
index b48138e..0000000
--- a/static/document.png
+++ /dev/null
Binary files differ
diff --git a/static/earth.png b/static/earth.png
deleted file mode 100644
index ff3abea..0000000
--- a/static/earth.png
+++ /dev/null
Binary files differ
diff --git a/static/es-gfdl.html b/static/es-gfdl.html
deleted file mode 100644
index 6767eff..0000000
--- a/static/es-gfdl.html
+++ /dev/null
@@ -1,421 +0,0 @@
-<html>
-<meta http-equiv="Content-Type" content="text/html;charset=utf8">
-<head>
-<title>Texto de la Licencia de documentación libre de GNU</title>
-</head>
-<body>
-
-<h4>Texto de la Licencia de documentación libre de GNU</h4>
-
-El texto que se reproduce debajo es una copia del texto de la Licencia de documentación libre GNU, bajo la que se encuentra el contenido de la Wikipedia y cuyo texto oficial se encuentra en http://www.gnu.org/copyleft/fdl.html
-Ésta última es la correcta en caso de diferencias entre las mismas.
-
-No es posible hacer traduciones oficiales de la licencia, la versión en inglés es la única con validez jurídica. No obstante, tiene disponible una traducción no oficial al español de la Licencia de documentación libre de GNU.
-
-Las condiciones de licenciamiento del texto de la licencia es el descrito en la misma. No se encuentra sometida a la GFDL como los artículos.
-
-<hr>
-
-
-<pre>
- GNU Free Documentation License
- Version 1.2, November 2002
-
-
- Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document "free" in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License. Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein. The "Document", below,
-refers to any such manual or work. Any member of the public is a
-licensee, and is addressed as "you". You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (Thus, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License. If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant. The Document may contain zero
-Invariant Sections. If the Document does not identify any Invariant
-Sections then there are none.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License. A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-An image format is not Transparent if used for any substantial amount
-of text. A copy that is not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML, PostScript or PDF designed for human modification. Examples of
-transparent image formats include PNG, XCF and JPG. Opaque formats
-include proprietary formats that can be read and edited only by
-proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML, PostScript or PDF produced by some word
-processors for output purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-A section "Entitled XYZ" means a named subunit of the Document whose
-title either is precisely XYZ or contains XYZ in parentheses following
-text that translates XYZ in another language. (Here XYZ stands for a
-specific section name mentioned below, such as "Acknowledgements",
-"Dedications", "Endorsements", or "History".) To "Preserve the Title"
-of such a section when you modify the Document means that it remains a
-section "Entitled XYZ" according to this definition.
-
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document. These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
-
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has fewer than five),
- unless they release you from this requirement.
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section Entitled "History", Preserve its Title, and add
- to it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section Entitled "History" in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the "History" section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.
-K. For any section Entitled "Acknowledgements" or "Dedications",
- Preserve the Title of the section, and preserve in the section all
- the substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.
-M. Delete any section Entitled "Endorsements". Such a section
- may not be included in the Modified Version.
-N. Do not retitle any existing section to be Entitled "Endorsements"
- or to conflict in title with any Invariant Section.
-O. Preserve any Warranty Disclaimers.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections Entitled "History"
-in the various original documents, forming one section Entitled
-"History"; likewise combine any sections Entitled "Acknowledgements",
-and any sections Entitled "Dedications". You must delete all sections
-Entitled "Endorsements".
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an "aggregate" if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included in an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License, and all the license notices in the
-Document, and any Warranty Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers. In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled "Acknowledgements",
-"Dedications", or "History", the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
- Copyright (c) YEAR YOUR NAME.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.2
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
- A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the "with...Texts." line with this:
-
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
-
-If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
-</pre>
-
-</body>
-</html>
diff --git a/static/external.png b/static/external.png
deleted file mode 100755
index 419c06f..0000000
--- a/static/external.png
+++ /dev/null
Binary files differ
diff --git a/static/file_icon.gif b/static/file_icon.gif
deleted file mode 100755
index 847f648..0000000
--- a/static/file_icon.gif
+++ /dev/null
Binary files differ
diff --git a/static/headbg.jpg b/static/headbg.jpg
deleted file mode 100644
index 5491c6e..0000000
--- a/static/headbg.jpg
+++ /dev/null
Binary files differ
diff --git a/static/humanities.png b/static/humanities.png
deleted file mode 100644
index 34736c1..0000000
--- a/static/humanities.png
+++ /dev/null
Binary files differ
diff --git a/static/index.html b/static/index.html
deleted file mode 100644
index 11aa428..0000000
--- a/static/index.html
+++ /dev/null
@@ -1,278 +0,0 @@
-<html>
-<meta http-equiv="Content-Type" content="text/html;charset=utf8">
-<head><title>Wikipedia: portada en su laptop</title></head>
-<center>
-
-<table>
-<tr><td width=45% style="background:#F1FAFF; border:2px solid #C6E4F2;">
-<span style="font-size:110%; font-weight:bold"><a href="/wiki/Wikipedia">Wikipedia</a>: la <a href="/wiki/Enciclopedia">enciclopedia</a> libre
-</td>
-<td width=10% style="background:#F1FAFF; border:2px solid #C6E4F2;"><center><img alt="" src="/static/wikipedia.png" height=40px border="0" /></center></td>
-<td width=45% style="background:#F1FAFF; border:2px solid #C6E4F2;"><center><a href="/static/acerca.html">Acerca de Wikipedia</a></center>
-</td>
-</tr>
-
-</table>
-
-<table>
-<tr>
-<td width=50% style="background:#F1FAFF; border:2px solid #C6E4F2;">
-<table><tr><td>
-<img alt="" src="/static/phys_science.png" width="60" border="0" /></td>
-<td><span align="center" style="font-size:100%"><a href="/wiki/Ciencia" title="Ciencia">Ciencia</a>: <a href="/wiki/Astronom%C3%ADa" title="Astronomía">Astronomía</a>, <a href="/wiki/F%C3%ADsica" title=Física>Física</a> y <a href="/wiki/Qu%C3%ADmica" title=Química">Química</a></span>
-
-<hr />
-
-<center>
-<a href="/wiki/Estrella" title="Estrella">Estrella</a>
-· <a href="/wiki/Luna" title="Luna">Luna</a>
-· <a href="/wiki/Planeta" title="Planeta">Planeta</a>
-· <a href="/wiki/Sol" title="Sol">Sol</a>
-· <a href="/wiki/Universo" title="Universo">Universo</a>
-<br />
-<a href="/wiki/Calor" title="Calor">Calor</a>
-· <a href="/wiki/Color" title="Color">Color</a>
-· <a href="/wiki/Energ%C3%ADa" title="Energía">Energía</a>
-· <a href="/wiki/Fuerza" title="Fuerza">Fuerza</a>
-· <a href="/wiki/Luz" title="Luz">Luz</a>
-<br />
-<a href="/wiki/Movimiento" title="Movimiento">Movimiento</a>
-· <a href="/wiki/Sonido" title="Sonido">Sonido</a>
-· <a href="/wiki/Tiempo" title="Tiempo">Tiempo</a>
-<br />
-<a href="/wiki/Agua" title="Agua">Agua</a>
-· <a href="/wiki/%C3%81tomo" title="Ãtomo">Ãtomo</a>
-· <a href="/wiki/Tabla_peri%C3%B3dica_de_los_elementos" title="Elementos">Elementos</a>
-· <a href="/wiki/Fuego" title="Fuego">Fuego</a>
-<br />
-<a href="/wiki/Materia" title="Materia">Materia</a>
-· <a href="/wiki/Medici%C3%B3n" title="Medición">Medición</a>
-· <a href="/wiki/Metal" title="Metal">Metal</a>
-</center>
-</td></tr></table>
-</td>
-
-<td style="background:#F1FAFF; border:2px solid #C6E4F2;">
-
-<table><tr><td>
-<img alt="" src="/static/biology.png" width="60" border="0" />
-</td><td>
-<span style="font-size:100%"><a href="/wiki/Ciencia" title="Ciencia">Ciencia</a>: <a href="/wiki/Biolog%C3%ADa" name=Biología>Biología</a> y <a href="/wiki/Medicina" name="Medicina">Medicina</a></span>
-<hr />
-<center>
-<a href="/wiki/Animalia" title="Animalia">Animalia</a>
-· <a href="/wiki/Bacteria" title="Bacteria">Bacteria</a>
-· <a href="/wiki/C%C3%A9lula" title="Célula">Célula</a>
-· <a href="/wiki/Fungi" title="Fungi">Fungi</a>
-<br />
-<a href="/wiki/Plantae" title="Plantae">Plantae</a>
-· <a href="/wiki/Ser vivo" title="Ser vivo">Ser vivo</a>
-· <a href="/wiki/Virus" title="Virus">Virus</a>
-<br />
-<a href="/wiki/Anatom%C3%ADa" title="Anatomía">Anatomía</a>
-· <a href="/wiki/Cerebro" title="Cerebro">Cerebro</a>
-· <a href="/wiki/Muerte" title="Muerte">Muerte</a>
-· <a href="/wiki/Salud" title="Salud">Salud</a>
-<br />
-<a href="/wiki/Homo sapiens" title="Seres humanos">Seres humanos</a>
-· <a href="/wiki/Vida" title="Vida">Vida</a>
-<br />
-<a href="/wiki/Agricultura" title="Agricultura">Agricultura</a>
-· <a href="/wiki/Ecolog%C3%ADa" title="Ecología">Ecología</a>
-· <a href="/wiki/Naturaleza" title="Naturaleza">Naturaleza</a>
-</center>
-</td></tr></table>
-</td>
-</tr>
-
-<tr>
-<td width=50% style="background:#F1FAFF; border:2px solid #C6E4F2">
-
-<table><tr><td>
-<img alt="" src="/static/socialscience.png" width="60" border="0" />
-</td><td>
-<span style="font-size:100%"><a href="/wiki/Ciencias Sociales" title="Ciencias Sociales">Ciencias Sociales</a></span>
-
-<hr />
-<center>
-<a href="/wiki/Antropolog%C3%ADa" name="Antropología">Antropología</a>
-· <a href="/wiki/Arqueolog%C3%ADa" name="Arqueología">Arqueología</a>
-· <a href="/wiki/Sociolog%C3%ADa" title="Sociología">Sociología</a>
-<br />
-<a href="/wiki/Derecho" title="Derecho">Derecho</a>
-· <a href="/wiki/Gobierno" title="Gobierno">Gobierno</a>
-· <a href="/wiki/Pa%C3%ADs" title="País">País</a>
-· <a href="/wiki/Pol%C3%ADtica" title="Política">Política</a>
-<br />
-<a href="/wiki/Comercio" title="Comercio">Comercio</a>
-· <a href="/wiki/Dinero" title="Dinero">Dinero</a>
-· <a href="/wiki/Econom%C3%ADa" title="Economía">Economía</a>
-<br />
-<a href="/wiki/Amor" title="Amor">Amor</a>
-· <a href="/wiki/Emoci%C3%B3n" title="Emoción">Emoción</a>
-· <a href="/wiki/Psicolog%C3%ADa" title="Psicología">Psicología</a>
-· <a href="/wiki/Sue%C3%B1o" title="Sueño">Sueño</a>
-</center>
-</td></tr></table>
-</td>
-
-<td style="background:#F1FAFF; border:2px solid #C6E4F2">
-
-<table><tr><td>
-<img alt="" src="/static/society.png" width="60" border="0" />
-</td><td>
-<span style="font-size:100%"><a href="/wiki/Cultura" title="Cultura">Cultura</a> y <a href="/wiki/Sociedad" title="Sociedad">Sociedad</span>
-
-<hr />
-<center>
-<a href="/wiki/Alimento" title="Alimento">Alimento</a>
-· <a href="/wiki/Educaci%C3%B3n" title="Educación">Educación</a>
-· <a href="/wiki/Familia" title="Familia">Familia</a>
-· <a href="/wiki/Indumentaria" title="Ropa">Ropa</a>
-<br />
-<a href="/wiki/Ciudad" title="Ciudad">Ciudad</a>
-· <a href="/wiki/Comunidad" title="Comunidad">Comunidad</a>
-· <a href="/wiki/Tradici%C3%B3n" name="Tradición">Tradición</a>
-<br />
-
-<a href="/wiki/Deporte" title="Deporte">Deporte</a>
-· <a href="/wiki/Humor" title="Humor">Humor</a>
-· <a href="/wiki/Juego" title="Juego">Juego</a>
-
-</center>
-</td></tr></table>
-</td>
-</tr>
-
-<tr>
-<td width=50% style="background:#F1FAFF; border:2px solid #C6E4F2">
-<table><tr><td>
-
-<img alt="" src="/static/humanities.png" width="60" border="0" />
-</td><td>
-<span style="font-size:100%"><a href="/wiki/Humanidades" title="Humanidades">Humanidades</span>
-<hr />
-<center>
-<a href="/wiki/Alfabeto" title="Alfabeto">Alfabeto</a>
-· <a href="/wiki/Comunicaci%C3%B3n" title="Comunicación">Comunicación</a>
-· <a href="/wiki/Lenguaje" title="Lenguaje">Lenguaje</a>
-<br />
-<a href="/wiki/Medio de comunicación" title="Medio de comunicación">Medio de comunicación</a>
-
-<br />
-<a href="/wiki/Filosof%C3%ADa" title="Filosofía">Filosofía</a>
-· <a href="/wiki/Historia" title="Historia">Historia</a>
-· <a href="/wiki/Historia universal" title="Historia universal">Historia universal</a>
-<br />
-<a href="/wiki/Mitolog%C3%ADa" title="Mitología">Mitología</a>
-· <a href="/wiki/Religi%C3%B3n" title="Religión">Religión</a>
-<br />
-
-<a href="/wiki/Arte" title="Arte">Arte</a>
-· <a href="/wiki/Arquitectura" title="Arquitectura">Arquitectura</a>
-· <a href="/wiki/Arte Visual" title="Dibujo">Dibujo</a>
-· <a href="/wiki/Escultura" title="Escultura">Escultura</a>
-
-<br />
-<a href="/wiki/Cine" title="Cine">Cine</a>
-· <a href="/wiki/Danza" title="Danza">Danza</a>
-· <a href="/wiki/Literatura" title="Literatura">Literatura</a>
-<br /><a href="/wiki/M%C3%BAsica" title="Música">Música</a>
-· <a href="/wiki/Poes%C3%ADa" title="Poesía">Poesía</a>
-· <a href="/wiki/Teatro" title="Teatro">Teatro</a>
-
-</center>
-
-</td></tr></table>
-</td>
-
-<td style="background:#F1FAFF; border:2px solid #C6E4F2">
-<table><tr><td>
-<img alt="" src="/static/math.png" width="60" order="0" />
-</td><td>
-<span style="font-size:100%"><a href="/wiki/Matem%C3%A1tica" name="Matemática">Matemática</a> y <a href="/wiki/L%C3%B3gica" name=Lógica>Lógica</A></span>
-<hr />
-<center>
-<a href="/wiki/Aritm%C3%A9tica" name="Aritmética">Aritmética</a>
-· <a href="/wiki/Geometr%C3%ADa" title="Geometría">Geometría</a>
-· <a href="/wiki/N%C3%BAmero" title="Número">Número</a>
-<br />
-<a href="/wiki/Suma" name="Suma">Suma</a>
-· <a href="/wiki/Resta" title="Resta">Resta</a>
-· <a href="/wiki/Fracci%C3%B3n" title="Fracción">Fracción</a>
-<br />
-<a href="/wiki/Multiplicaci%C3%B3n" title="Multiplicación">Multiplicación</a>
-· <a href="/wiki/Divisi%C3%B3n_%28matem%C3%A1ticas%29" title="División">División</a>
-</center>
-</td></tr></table>
-</td>
-</tr>
-
-<tr>
-<td width=50% style="background:#F1FAFF; border:2px solid #C6E4F2">
-<table><tr><td>
-
-<img alt="" src="/static/technology.png" width="60" border="0" />
-</td><td>
-<span style="font-size:100%"><a href="/wiki/Tecnolog%C3%ADa">Tecnología</a></span>
-<hr />
-<center>
-<a href="/wiki/Computadora" title="Computadora">Computadora</a>
-· <a href="/wiki/Electr%C3%B3nica" title="Electrónica">Electrónica</a>
-· <a href="/wiki/Internet" title="Internet">Internet</a>
-
-<br />
-<a href="/wiki/Radio %28medio de comunicaci%C3%B3n%29" title="Radio">Radio</a>
-· <a href="/wiki/Telecomunicaci%C3%B3n" title="Telecomunicación">Telecomunicación</a>
-· <a href="/wiki/Televisi%C3%B3n" title="Televisión">Televisión</a>
-<br />
-<a href="/wiki/Avi%C3%B3n" title="Avión">Avión</a>
-· <a href="/wiki/Autom%C3%B3vil" title="Automóvil">Automóvil</a>
-· <a href="/wiki/Barco" title="Barco">Barco</a>
-· <a href="/wiki/Tren" title="Tren">Tren</a>
-<br />
-<a href="/wiki/Combustible" title="Combustible">Combustible</a>
-· <a href="/wiki/Electricidad" title="Electricidad">Electricidad</a>
-· <a href="/wiki/Ingenier%C3%ADa" title="Ingeniería">Ingeniería</a>
-
-</center>
-</td></tr></table>
-</td>
-
-<td style="background:#F1FAFF; border:2px solid #C6E4F2">
-<table><tr><td>
-<img alt="" src="/static/earth.png" width="60" border="0" />
-</td><td>
-<span style="font-size:100%"><a href="/wiki/Tierra" title="Tierra">Tierra</a> y <a href="/wiki/Geografía" title="Geografía">Geografía</a></span>
-<hr />
-<center>
-<a href="/wiki/Continente" title="Continente">Continente</a>
-
-· <a href="/wiki/Geolog%C3%ADa" title="Geología">Geología</a>
-· <a href="/wiki/Mineral" title="Mineral">Mineral</a>
-· <a href="/wiki/Oc%C3%A9ano" title="Océano">Océano</a>
-<br />
-<a href="/wiki/Clima" title="Clima">Clima</a>
-· <a href="/wiki/Desastre natural" title="Desastre natural">Desastre natural</a>
-· <a href="/wiki/Meteorolog%C3%ADa" title="Meteorología">Meteorología</a>
-
-<br />
-<a href="/wiki/Am%C3%A9rica del Norte" title="América del Norte">América del Norte</a>
-· <a href="/wiki/Am%C3%A9rica del Sur" title="América del Sur">América del Sur</a>
-<br />
-<a href="/wiki/Africa" title="Africa">Africa</a>
-· <a href="/wiki/Ant%C3%A1rtida" title="Antártida">Antártida</a>
-· <a href="/wiki/Asia" title="Asia">Asia</a>
-· <a href="/wiki/Europa" title="Europa">Europa</a>
-· <a href="/wiki/Ocean%C3%ADa" title="Oceanía">Oceanía</a>
-</center>
-</td></tr></table>
-</td>
-</tr>
-
-
-</table>
-</center>
-</html>
-
-
diff --git a/static/link_icon.gif b/static/link_icon.gif
deleted file mode 100755
index 815ccb1..0000000
--- a/static/link_icon.gif
+++ /dev/null
Binary files differ
diff --git a/static/lock_icon.gif b/static/lock_icon.gif
deleted file mode 100755
index 8a87e28..0000000
--- a/static/lock_icon.gif
+++ /dev/null
Binary files differ
diff --git a/static/magnify-clip.png b/static/magnify-clip.png
deleted file mode 100644
index 992aa2e..0000000
--- a/static/magnify-clip.png
+++ /dev/null
Binary files differ
diff --git a/static/mail_icon.gif b/static/mail_icon.gif
deleted file mode 100755
index 50a87a9..0000000
--- a/static/mail_icon.gif
+++ /dev/null
Binary files differ
diff --git a/static/math.png b/static/math.png
deleted file mode 100644
index 0b81508..0000000
--- a/static/math.png
+++ /dev/null
Binary files differ
diff --git a/static/monobook.css b/static/monobook.css
deleted file mode 100644
index 91be270..0000000
--- a/static/monobook.css
+++ /dev/null
@@ -1,1821 +0,0 @@
-/*
-** MediaWiki 'monobook' style sheet for CSS2-capable browsers.
-** Copyright Gabriel Wicke - http://wikidev.net/
-** License: GPL (http://www.gnu.org/copyleft/gpl.html)
-**
-** Loosely based on http://www.positioniseverything.net/ordered-floats.html by Big John
-** and the Plone 2.0 styles, see http://plone.org/ (Alexander Limi,Joe Geldart & Tom Croucher,
-** Michael Zeltner and Geir Bækholt)
-** All you guys rock :)
-*/
-
-#column-content {
- width: 100%;
- float: right;
- margin: 0 0 .6em -12.2em;
- padding: 0;
-}
-#content {
- margin: 2.8em 0 0 12.2em;
- padding: 0 1em 1em 1em;
- position: relative;
- z-index: 2;
-}
-#column-one {
- padding-top: 160px;
-}
-#content {
- background: white;
- color: black;
- border: 1px solid #aaa;
- border-right: none;
- line-height: 1.5em;
-}
-/* the left column width is specified in class .portlet */
-
-/* Font size:
-** We take advantage of keyword scaling- browsers won't go below 9px
-** More at http://www.w3.org/2003/07/30-font-size
-** http://style.cleverchimp.com/font_size_intervals/altintervals.html
-*/
-
-/*FIXME: This body section has been hacked to look right with mwlib.
-A better solution is to fix mwlib to use the rest of the styles
-in this stylesheet*/
-body {
- font: small sans-serif;
- background: #ffffff 0 0 no-repeat;
- color: black;
- margin: 1em;
- padding: 0;
-}
-
-/* scale back up to a sane default */
-#globalWrapper {
- font-size: 127%;
- width: 100%;
- margin: 0;
- padding: 0;
-}
-.visualClear {
- clear: both;
-}
-
-/* general styles */
-
-table {
- font-size: 100%;
- color: black;
- /* we don't want the bottom borders of <h2>s to be visible through
- floated tables */
- background-color: white;
-}
-fieldset table {
- /* but keep table layouts in forms clean... */
- background: none;
-}
-a {
- text-decoration: none;
- color: #002bb8;
- background: none;
-}
-a:visited {
- color: #5a3696;
-}
-a:active {
- color: #faa700;
-}
-a:hover {
- text-decoration: underline;
-}
-a.offsite {
- color: green;
-}
-a.stub {
- color: #772233;
-}
-a.new, #p-personal a.new {
- color: #ba0000;
-}
-a.new:visited, #p-personal a.new:visited {
- color: #a55858;
-}
-
-img {
- border: none;
- vertical-align: middle;
-}
-p {
- margin: .4em 0 .5em 0;
- line-height: 1.5em;
-}
-p img {
- margin: 0;
-}
-
-hr {
- height: 1px;
- color: #aaa;
- background-color: #aaa;
- border: 0;
- margin: .2em 0 .2em 0;
-}
-
-h1, h2, h3, h4, h5, h6 {
- color: black;
- background: none;
- font-weight: normal;
- margin: 0;
- padding-top: .5em;
- padding-bottom: .17em;
- border-bottom: 1px solid #aaa;
-}
-h1 { font-size: 188%; }
-h1 .editsection { font-size: 53%; }
-h2 { font-size: 150%; }
-h2 .editsection { font-size: 67%; }
-h3, h4, h5, h6 {
- border-bottom: none;
- font-weight: bold;
-}
-h3 { font-size: 132%; }
-h3 .editsection { font-size: 76%; font-weight: normal; }
-h4 { font-size: 116%; }
-h4 .editsection { font-size: 86%; font-weight: normal; }
-h5 { font-size: 100%; }
-h5 .editsection { font-weight: normal; }
-h6 { font-size: 80%; }
-h6 .editsection { font-size: 125%; font-weight: normal; }
-
-ul {
- line-height: 1.5em;
- list-style-type: square;
- margin: .3em 0 0 1.5em;
- padding: 0;
- list-style-image: url(bullet.gif);
-}
-ol {
- line-height: 1.5em;
- margin: .3em 0 0 3.2em;
- padding: 0;
- list-style-image: none;
-}
-li {
- margin-bottom: .1em;
-}
-dt {
- font-weight: bold;
- margin-bottom: .1em;
-}
-dl {
- margin-top: .2em;
- margin-bottom: .5em;
-}
-dd {
- line-height: 1.5em;
- margin-left: 2em;
- margin-bottom: .1em;
-}
-
-fieldset {
- border: 1px solid #2f6fab;
- margin: 1em 0 1em 0;
- padding: 0 1em 1em;
- line-height: 1.5em;
-}
-fieldset.nested {
- margin: 0 0 0.5em 0;
- padding: 0 0.5em 0.5em;
-}
-legend {
- padding: .5em;
- font-size: 95%;
-}
-form {
- border: none;
- margin: 0;
-}
-
-textarea {
- width: 100%;
- padding: .1em;
-}
-
-input.historysubmit {
- padding: 0 .3em .3em .3em !important;
- font-size: 94%;
- cursor: pointer;
- height: 1.7em !important;
- margin-left: 1.6em;
-}
-select {
- vertical-align: top;
-}
-abbr, acronym, .explain {
- border-bottom: 1px dotted black;
- color: black;
- background: none;
- cursor: help;
-}
-q {
- font-family: Times, "Times New Roman", serif;
- font-style: italic;
-}
-/* disabled for now
-blockquote {
- font-family: Times, "Times New Roman", serif;
- font-style: italic;
-}*/
-code {
- background-color: #f9f9f9;
-}
-pre {
- padding: 1em;
- border: 1px dashed #2f6fab;
- color: black;
- background-color: #f9f9f9;
- line-height: 1.1em;
-}
-
-/*
-** the main content area
-*/
-
-#siteSub {
- display: none;
-}
-#jump-to-nav {
- display: none;
-}
-
-#contentSub, #contentSub2 {
- font-size: 84%;
- line-height: 1.2em;
- margin: 0 0 1.4em 1em;
- color: #7d7d7d;
- width: auto;
-}
-span.subpages {
- display: block;
-}
-
-/* Some space under the headers in the content area */
-#bodyContent h1, #bodyContent h2 {
- margin-bottom: .6em;
-}
-#bodyContent h3, #bodyContent h4, #bodyContent h5 {
- margin-bottom: .3em;
-}
-.firstHeading {
- margin-bottom: .1em;
- /* These two rules hack around bug 2013 (fix for more limited bug 11325).
- When bug 2013 is fixed properly, they should be removed. */
- line-height: 1.2em;
- padding-bottom: 0;
-}
-
-/* user notification thing */
-.usermessage {
- background-color: #ffce7b;
- border: 1px solid #ffa500;
- color: black;
- font-weight: bold;
- margin: 2em 0 1em;
- padding: .5em 1em;
- vertical-align: middle;
-}
-#siteNotice {
- text-align: center;
- font-size: 95%;
- padding: 0 .9em;
-}
-#siteNotice p {
- margin: 0;
- padding: 0;
-}
-.success {
- color: green;
- font-size: larger;
-}
-.error {
- color: red;
- font-size: larger;
-}
-.errorbox, .successbox {
- font-size: larger;
- border: 2px solid;
- padding: .5em 1em;
- float: left;
- margin-bottom: 2em;
- color: #000;
-}
-.errorbox {
- border-color: red;
- background-color: #fff2f2;
-}
-.successbox {
- border-color: green;
- background-color: #dfd;
-}
-.errorbox h2, .successbox h2 {
- font-size: 1em;
- font-weight: bold;
- display: inline;
- margin: 0 .5em 0 0;
- border: none;
-}
-
-.catlinks {
- border: 1px solid #aaa;
- background-color: #f9f9f9;
- padding: 5px;
- margin-top: 1em;
- clear: both;
-}
-/* currently unused, intended to be used by a metadata box
-in the bottom-right corner of the content area */
-.documentDescription {
- /* The summary text describing the document */
- font-weight: bold;
- display: block;
- margin: 1em 0;
- line-height: 1.5em;
-}
-.documentByLine {
- text-align: right;
- font-size: 90%;
- clear: both;
- font-weight: normal;
- color: #76797c;
-}
-
-/* emulate center */
-.center {
- width: 100%;
- text-align: center;
-}
-*.center * {
- margin-left: auto;
- margin-right: auto;
-}
-/* small for tables and similar */
-.small, .small * {
- font-size: 94%;
-}
-table.small {
- font-size: 100%;
-}
-
-/*
-** content styles
-*/
-
-#toc,
-.toc,
-.mw-warning {
- border: 1px solid #aaa;
- background-color: #f9f9f9;
- padding: 5px;
- font-size: 95%;
-}
-#toc h2,
-.toc h2 {
- display: inline;
- border: none;
- padding: 0;
- font-size: 100%;
- font-weight: bold;
-}
-#toc #toctitle,
-.toc #toctitle,
-#toc .toctitle,
-.toc .toctitle {
- text-align: center;
-}
-#toc ul,
-.toc ul {
- list-style-type: none;
- list-style-image: none;
- margin-left: 0;
- padding-left: 0;
- text-align: left;
-}
-#toc ul ul,
-.toc ul ul {
- margin: 0 0 0 2em;
-}
-#toc .toctoggle,
-.toc .toctoggle {
- font-size: 94%;
-}
-
-.mw-warning {
- margin-left: 50px;
- margin-right: 50px;
- text-align: center;
-}
-
-/* images */
-div.floatright, table.floatright {
- clear: right;
- float: right;
- position: relative;
- margin: 0 0 .5em .5em;
- border: 0;
-/*
- border: .5em solid white;
- border-width: .5em 0 .8em 1.4em;
-*/
-}
-div.floatright p { font-style: italic; }
-div.floatleft, table.floatleft {
- float: left;
- clear: left;
- position: relative;
- margin: 0 .5em .5em 0;
- border: 0;
-/*
- margin: .3em .5em .5em 0;
- border: .5em solid white;
- border-width: .5em 1.4em .8em 0;
-*/
-}
-div.floatleft p { font-style: italic; }
-/* thumbnails */
-div.thumb {
- margin-bottom: .5em;
- border-style: solid;
- border-color: white;
- width: auto;
-}
-div.thumbinner {
- border: 1px solid #ccc;
- padding: 3px !important;
- background-color: #f9f9f9;
- font-size: 94%;
- text-align: center;
- overflow: hidden;
-}
-html .thumbimage {
- border: 1px solid #ccc;
-}
-html .thumbcaption {
- border: none;
- text-align: left;
- line-height: 1.4em;
- padding: 3px !important;
- font-size: 94%;
-}
-div.magnify {
- float: right;
- border: none !important;
- background: none !important;
-}
-div.magnify a, div.magnify img {
- display: block;
- border: none !important;
- background: none !important;
-}
-div.tright {
- clear: right;
- float: right;
- border-width: .5em 0 .8em 1.4em;
-}
-div.tleft {
- float: left;
- clear: left;
- margin-right: .5em;
- border-width: .5em 1.4em .8em 0;
-}
-img.thumbborder {
- border: 1px solid #dddddd;
-}
-.hiddenStructure {
- display: none;
-}
-
-/*
-** classes for special content elements like town boxes
-** intended to be referenced directly from the wiki src
-*/
-
-/*
-** User styles
-*/
-/* table standards */
-table.rimage {
- float: right;
- position: relative;
- margin-left: 1em;
- margin-bottom: 1em;
- text-align: center;
-}
-.toccolours {
- border: 1px solid #aaa;
- background-color: #f9f9f9;
- padding: 5px;
- font-size: 95%;
-}
-div.townBox {
- position: relative;
- float: right;
- background: white;
- margin-left: 1em;
- border: 1px solid gray;
- padding: .3em;
- width: 200px;
- overflow: hidden;
- clear: right;
-}
-div.townBox dl {
- padding: 0;
- margin: 0 0 .3em;
- font-size: 96%;
-}
-div.townBox dl dt {
- background: none;
- margin: .4em 0 0;
-}
-div.townBox dl dd {
- margin: .1em 0 0 1.1em;
- background-color: #f3f3f3;
-}
-
-/*
-** edit views etc
-*/
-.special li {
- line-height: 1.4em;
- margin: 0;
- padding: 0;
-}
-
-/*
-** keep the whitespace in front of the ^=, hides rule from konqueror
-** this is css3, the validator doesn't like it when validating as css2
-*/
-#bodyContent a.external,
-#bodyContent a[href ^="gopher://"] {
- background: url(external.png) center right no-repeat;
- padding-right: 13px;
-}
-#bodyContent a[href ^="https://"],
-.link-https {
- background: url(lock_icon.gif) center right no-repeat;
- padding-right: 16px;
-}
-#bodyContent a[href ^="mailto:"],
-.link-mailto {
- background: url(mail_icon.gif) center right no-repeat;
- padding-right: 18px;
-}
-#bodyContent a[href ^="news://"] {
- background: url(news_icon.png) center right no-repeat;
- padding-right: 18px;
-}
-#bodyContent a[href ^="ftp://"],
-.link-ftp {
- background: url(file_icon.gif) center right no-repeat;
- padding-right: 18px;
-}
-#bodyContent a[href ^="irc://"],
-.link-irc {
- background: url(discussionitem_icon.gif) center right no-repeat;
- padding-right: 18px;
-}
-#bodyContent a.external[href $=".ogg"], #bodyContent a.external[href $=".OGG"],
-#bodyContent a.external[href $=".mid"], #bodyContent a.external[href $=".MID"],
-#bodyContent a.external[href $=".midi"], #bodyContent a.external[href $=".MIDI"],
-#bodyContent a.external[href $=".mp3"], #bodyContent a.external[href $=".MP3"],
-#bodyContent a.external[href $=".wav"], #bodyContent a.external[href $=".WAV"],
-#bodyContent a.external[href $=".wma"], #bodyContent a.external[href $=".WMA"],
-.link-audio {
- background: url("audio.png") center right no-repeat;
- padding-right: 13px;
-}
-#bodyContent a.external[href $=".ogm"], #bodyContent a.external[href $=".OGM"],
-#bodyContent a.external[href $=".avi"], #bodyContent a.external[href $=".AVI"],
-#bodyContent a.external[href $=".mpeg"], #bodyContent a.external[href $=".MPEG"],
-#bodyContent a.external[href $=".mpg"], #bodyContent a.external[href $=".MPG"],
-.link-video {
- background: url("video.png") center right no-repeat;
- padding-right: 13px;
-}
-#bodyContent a.external[href $=".pdf"], #bodyContent a.external[href $=".PDF"],
-#bodyContent a.external[href *=".pdf#"], #bodyContent a.external[href *=".PDF#"],
-#bodyContent a.external[href *=".pdf?"], #bodyContent a.external[href *=".PDF?"],
-.link-document {
- background: url("document.png") center right no-repeat;
- padding-right: 12px;
-}
-
-/* disable interwiki styling */
-#bodyContent a.extiw,
-#bodyContent a.extiw:active {
- color: #36b;
- background: none;
- padding: 0;
-}
-#bodyContent a.external {
- color: #36b;
-}
-/* this can be used in the content area to switch off
-special external link styling */
-#bodyContent .plainlinks a {
- background: none !important;
- padding: 0 !important;
-}
-/*
-** Structural Elements
-*/
-
-/*
-** general portlet styles (elements in the quickbar)
-*/
-.portlet {
- border: none;
- margin: 0 0 .5em;
- padding: 0;
- float: none;
- width: 11.6em;
- overflow: hidden;
-}
-.portlet h4 {
- font-size: 95%;
- font-weight: normal;
- white-space: nowrap;
-}
-.portlet h5 {
- background: transparent;
- padding: 0 1em 0 .5em;
- display: inline;
- height: 1em;
- text-transform: lowercase;
- font-size: 91%;
- font-weight: normal;
- white-space: nowrap;
-}
-.portlet h6 {
- background: #ffae2e;
- border: 1px solid #2f6fab;
- border-style: solid solid none solid;
- padding: 0 1em 0 1em;
- text-transform: lowercase;
- display: block;
- font-size: 1em;
- height: 1.2em;
- font-weight: normal;
- white-space: nowrap;
-}
-.pBody {
- font-size: 95%;
- background-color: white;
- color: black;
- border-collapse: collapse;
- border: 1px solid #aaa;
- padding: 0 .8em .3em .5em;
-}
-.portlet h1,
-.portlet h2,
-.portlet h3,
-.portlet h4 {
- margin: 0;
- padding: 0;
-}
-.portlet ul {
- line-height: 1.5em;
- list-style-type: square;
- list-style-image: url(bullet.gif);
- font-size: 95%;
-}
-.portlet li {
- padding: 0;
- margin: 0;
-}
-
-/*
-** Logo properties
-*/
-
-#p-logo {
- top: 0;
- left: 0;
- position: absolute; /*needed to use z-index */
- z-index: 3;
- height: 155px;
- width: 12em;
- overflow: visible;
-}
-#p-logo h5 {
- display: none;
-}
-#p-logo a,
-#p-logo a:hover {
- display: block;
- height: 155px;
- width: 12.2em;
- background-repeat: no-repeat;
- background-position: 35% 50% !important;
- text-decoration: none;
-}
-
-/*
-** Search portlet
-*/
-#p-search {
- position: relative;
- z-index: 3;
-}
-input.searchButton {
- margin-top: 1px;
- font-size: 95%;
-}
-#searchGoButton {
- padding-left: .5em;
- padding-right: .5em;
- font-weight: bold;
-}
-#searchInput {
- width: 10.9em;
- margin: 0;
- font-size: 95%;
-}
-#p-search .pBody {
- padding: .5em .4em .4em .4em;
- text-align: center;
-}
-
-/*
-** the personal toolbar
-*/
-#p-personal {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 0;
-}
-#p-personal {
- width: 100%;
- white-space: nowrap;
- padding: 0;
- margin: 0;
- border: none;
- background: none;
- overflow: visible;
- line-height: 1.2em;
-}
-#p-personal h5 {
- display: none;
-}
-#p-personal .portlet,
-#p-personal .pBody {
- z-index: 0;
- padding: 0;
- margin: 0;
- border: none;
- overflow: visible;
- background: none;
-}
-/* this is the ul contained in the portlet */
-#p-personal ul {
- border: none;
- line-height: 1.4em;
- color: #2f6fab;
- padding: 0 2em 0 3em;
- margin: 0;
- text-align: right;
- list-style: none;
- z-index: 0;
- background: none;
- cursor: default;
-}
-#p-personal li {
- z-index: 0;
- border: none;
- padding: 0;
- display: inline;
- color: #2f6fab;
- margin-left: 1em;
- line-height: 1.2em;
- background: none;
-}
-#p-personal li a {
- text-decoration: none;
- color: #005896;
- padding-bottom: .2em;
- background: none;
-}
-#p-personal li a:hover {
- background-color: white;
- padding-bottom: .2em;
- text-decoration: none;
-}
-#p-personal li.active a:hover {
- background-color: transparent;
-}
-/* the icon in front of the user name, single quotes
-in bg url to hide it from iemac */
-li#pt-userpage,
-li#pt-anonuserpage,
-li#pt-login {
- background: url(user.gif) top left no-repeat;
- padding-left: 20px;
- text-transform: none;
-}
-#p-personal ul {
- text-transform: lowercase;
-}
-#p-personal li.active {
- font-weight: bold;
-}
-/*
-** the page-related actions- page/talk, edit etc
-*/
-#p-cactions {
- position: absolute;
- top: 1.3em;
- left: 11.5em;
- margin: 0;
- white-space: nowrap;
- width: 76%;
- line-height: 1.1em;
- overflow: visible;
- background: none;
- border-collapse: collapse;
- padding-left: 1em;
- list-style: none;
- font-size: 95%;
-}
-#p-cactions ul {
- list-style: none;
-}
-#p-cactions li {
- display: inline;
- border: 1px solid #aaa;
- border-bottom: none;
- padding: 0 0 .1em 0;
- margin: 0 .3em 0 0;
- overflow: visible;
- background: white;
-}
-#p-cactions li.selected {
- border-color: #fabd23;
- padding: 0 0 .2em 0;
- font-weight: bold;
-}
-#p-cactions li a {
- background-color: #fbfbfb;
- color: #002bb8;
- border: none;
- padding: 0 .8em .3em;
- position: relative;
- z-index: 0;
- margin: 0;
- text-decoration: none;
-}
-#p-cactions li.selected a {
- z-index: 3;
- padding: 0 1em .2em!important;
- background-color: white;
-}
-#p-cactions .new a {
- color: #ba0000;
-}
-#p-cactions li a:hover {
- z-index: 3;
- text-decoration: none;
- background-color: white;
-}
-#p-cactions h5 {
- display: none;
-}
-#p-cactions li.istalk {
- margin-right: 0;
-}
-#p-cactions li.istalk a {
- padding-right: .5em;
-}
-#p-cactions #ca-addsection a {
- padding-left: .4em;
- padding-right: .4em;
-}
-/* offsets to distinguish the tab groups */
-li#ca-talk {
- margin-right: 1.6em;
-}
-li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print {
- margin-left: 1.6em;
-}
-#p-cactions .pBody {
- font-size: 1em;
- background-color: transparent;
- color: inherit;
- border-collapse: inherit;
- border: 0;
- padding: 0;
-}
-#p-cactions .hiddenStructure {
- display: none;
-}
-#p-cactions li a {
- text-transform: lowercase;
-}
-
-/*
-** the remaining portlets
-*/
-#p-tbx,
-#p-lang {
- position: relative;
- z-index: 3;
-}
-
-/* TODO: #t-iscite is only used by the Cite extension, come up with some
- * system which allows extensions to add to this file on the fly
- */
-#t-ispermalink, #t-iscite {
- color: #999;
-}
-/*
-** footer
-*/
-#footer {
- background-color: white;
- border-top: 1px solid #fabd23;
- border-bottom: 1px solid #fabd23;
- margin: .6em 0 1em 0;
- padding: .4em 0 1.2em 0;
- text-align: center;
- font-size: 90%;
-}
-#footer li {
- display: inline;
- margin: 0 1.3em;
-}
-#f-poweredbyico, #f-copyrightico {
- margin: 0 8px;
- position: relative;
- top: -2px; /* Bump it up just a tad */
-}
-#f-poweredbyico {
- float: right;
- height: 1%;
-}
-#f-copyrightico {
- float: left;
- height: 1%;
-}
-
-/* js pref toc */
-#preftoc {
- margin: 0;
- padding: 0;
- width: 100%;
- clear: both;
-}
-#preftoc li {
- background-color: #f0f0f0;
- color: #000;
-}
-#preftoc li {
- margin: 1px -2px 1px 2px;
- float: left;
- padding: 2px 0 3px 0;
- border: 1px solid #fff;
- border-right-color: #716f64;
- border-bottom: 0;
- position: relative;
- white-space: nowrap;
- list-style-type: none;
- list-style-image: none;
- z-index: 3;
-}
-#preftoc li.selected {
- font-weight: bold;
- background-color: #f9f9f9;
- border: 1px solid #aaa;
- border-bottom: none;
- cursor: default;
- top: 1px;
- padding-top: 2px;
- margin-right: -3px;
-}
-#preftoc > li.selected {
- top: 2px;
-}
-#preftoc a,
-#preftoc a:active {
- display: block;
- color: #000;
- padding: 0 .7em;
- position: relative;
- text-decoration: none;
-}
-#preftoc li.selected a {
- cursor: default;
- text-decoration: none;
-}
-#prefcontrol {
- padding-top: 2em;
- clear: both;
-}
-#preferences {
- margin: 0;
- border: 1px solid #aaa;
- clear: both;
- padding: 1.5em;
- background-color: #F9F9F9;
-}
-.prefsection {
- border: none;
- padding: 0;
- margin: 0;
-}
-.prefsection fieldset {
- border: 1px solid #aaa;
- float: left;
- margin-right: 2em;
-}
-.prefsection legend {
- font-weight: bold;
-}
-.prefsection table, .prefsection legend {
- background-color: #F9F9F9;
-}
-.mainLegend {
- display: none;
-}
-div.prefsectiontip {
- font-size: x-small;
- padding: .2em 2em;
- color: #666;
-}
-.btnSavePrefs {
- font-weight: bold;
- padding-left: .3em;
- padding-right: .3em;
-}
-
-.preferences-login {
- clear: both;
- margin-bottom: 1.5em;
-}
-
-.prefcache {
- font-size: 90%;
- margin-top: 2em;
-}
-
-div#userloginForm form,
-div#userlogin form#userlogin2 {
- margin: 0 3em 1em 0;
- border: 1px solid #aaa;
- clear: both;
- padding: 1.5em 2em;
- background-color: #f9f9f9;
- float: left;
-}
-
-div#userloginForm table,
-div#userlogin form#userlogin2 table {
- background-color: #f9f9f9;
-}
-
-div#userloginForm h2,
-div#userlogin form#userlogin2 h2 {
- padding-top: 0;
-}
-
-div#userlogin .captcha,
-div#userloginForm .captcha {
- border: 1px solid #bbb;
- padding: 1.5em 2em;
- background-color: white;
-}
-
-
-#userloginprompt, #languagelinks {
- font-size: 85%;
-}
-
-#login-sectiontip {
- font-size: 85%;
- line-height: 1.2;
- padding-top: 2em;
-}
-
-#userlogin .loginText, #userlogin .loginPassword {
- width: 12em;
-}
-
-#userloginlink a, #wpLoginattempt, #wpCreateaccount {
- font-weight: bold;
-}
-
-/*
-** IE/Mac fixes, hope to find a validating way to move this
-** to a separate stylesheet. This would work but doesn't validate:
-** @import("IEMacFixes.css");
-*/
-/* tabs: border on the a, not the div */
-* > html #p-cactions li { border: none; }
-* > html #p-cactions li a {
- border: 1px solid #aaa;
- border-bottom: none;
-}
-* > html #p-cactions li.selected a { border-color: #fabd23; }
-/* footer icons need a fixed width */
-* > html #f-poweredbyico,
-* > html #f-copyrightico { width: 88px; }
-* > html #bodyContent,
-* > html #bodyContent pre {
- overflow-x: auto;
- width: 100%;
- padding-bottom: 25px;
-}
-
-/* more IE fixes */
-/* float/negative margin brokenness */
-* html #footer {margin-top: 0;}
-* html #column-content {
- display: inline;
- margin-bottom: 0;
-}
-* html div.editsection { font-size: smaller; }
-#pagehistory li.selected { position: relative; }
-
-/* Mac IE 5.0 fix; floated content turns invisible */
-* > html #column-content {
- float: none;
-}
-* > html #column-one {
- position: absolute;
- left: 0;
- top: 0;
-}
-* > html #footer {
- margin-left: 13.2em;
-}
-.redirectText {
- font-size: 150%;
- margin: 5px;
-}
-
-.printfooter {
- display: none;
-}
-
-.not-patrolled {
- background-color: #ffa;
-}
-div.patrollink {
- clear: both;
- font-size: 75%;
- text-align: right;
-}
-span.newpage, span.minor, span.bot {
- font-weight: bold;
-}
-span.unpatrolled {
- font-weight: bold;
- color: red;
-}
-
-.sharedUploadNotice {
- font-style: italic;
-}
-
-span.updatedmarker {
- color: black;
- background-color: #0f0;
-}
-
-table.gallery {
- border: 1px solid #ccc;
- margin: 2px;
- padding: 2px;
- background-color: white;
-}
-
-table.gallery tr {
- vertical-align: top;
-}
-
-table.gallery td {
- vertical-align: top;
- background-color: #f9f9f9;
- border: solid 2px white;
-}
-/* Keep this temporarily so that cached pages will display right */
-table.gallery td.galleryheader {
- text-align: center;
- font-weight: bold;
-}
-table.gallery caption {
- font-weight: bold;
-}
-
-div.gallerybox {
- margin: 2px;
-}
-
-div.gallerybox div.thumb {
- text-align: center;
- border: 1px solid #ccc;
- margin: 2px;
-}
-
-div.gallerytext {
- overflow: hidden;
- font-size: 94%;
- padding: 2px 4px;
-}
-
-span.comment {
- font-style: italic;
-}
-
-span.changedby {
- font-size: 95%;
-}
-
-.previewnote {
- text-indent: 3em;
- color: #c00;
- border-bottom: 1px solid #aaa;
- padding-bottom: 1em;
- margin-bottom: 1em;
-}
-
-.previewnote p {
- margin: 0;
- padding: 0;
-}
-
-.editExternally {
- border: 1px solid gray;
- background-color: #ffffff;
- padding: 3px;
- margin-top: 0.5em;
- float: left;
- font-size: small;
- text-align: center;
-}
-.editExternallyHelp {
- font-style: italic;
- color: gray;
-}
-
-.toggle {
- margin-left: 2em;
- text-indent: -2em;
-}
-
-/* Classes for EXIF data display */
-table.mw_metadata {
- font-size: 0.8em;
- margin-left: 0.5em;
- margin-bottom: 0.5em;
- width: 300px;
-}
-
-table.mw_metadata caption {
- font-weight: bold;
-}
-
-table.mw_metadata th {
- font-weight: normal;
-}
-
-table.mw_metadata td {
- padding: 0.1em;
-}
-
-table.mw_metadata {
- border: none;
- border-collapse: collapse;
-}
-
-table.mw_metadata td, table.mw_metadata th {
- text-align: center;
- border: 1px solid #aaaaaa;
- padding-left: 0.1em;
- padding-right: 0.1em;
-}
-
-table.mw_metadata th {
- background-color: #f9f9f9;
-}
-
-table.mw_metadata td {
- background-color: #fcfcfc;
-}
-
-table.collapsed tr.collapsable {
- display: none;
-}
-
-
-/* filetoc */
-ul#filetoc {
- text-align: center;
- border: 1px solid #aaaaaa;
- background-color: #f9f9f9;
- padding: 5px;
- font-size: 95%;
- margin-bottom: 0.5em;
- margin-left: 0;
- margin-right: 0;
-}
-
-#filetoc li {
- display: inline;
- list-style-type: none;
- padding-right: 2em;
-}
-
-input#wpSummary {
- width: 80%;
-}
-
-/* @bug 1714 */
-input#wpSave, input#wpDiff {
- margin-right: 0.33em;
-}
-
-#editform .editOptions {
- display: inline;
-}
-
-#wpSave {
- font-weight: bold;
-}
-
-/* Classes for article validation */
-
-table.revisionform_default {
- border: 1px solid #000000;
-}
-
-table.revisionform_focus {
- border: 1px solid #000000;
- background-color:#00BBFF;
-}
-
-tr.revision_tr_default {
- background-color:#EEEEEE;
-}
-
-tr.revision_tr_first {
- background-color:#DDDDDD;
-}
-
-p.revision_saved {
- color: green;
- font-weight:bold;
-}
-
-#mw_trackbacks {
- border: solid 1px #bbbbff;
- background-color: #eeeeff;
- padding: 0.2em;
-}
-
-
-/* Allmessages table */
-
-#allmessagestable th {
- background-color: #b2b2ff;
-}
-
-#allmessagestable tr.orig {
- background-color: #ffe2e2;
-}
-
-#allmessagestable tr.new {
- background-color: #e2ffe2;
-}
-
-#allmessagestable tr.def {
- background-color: #f0f0ff;
-}
-
-
-/* noarticletext */
-div.noarticletext {
- border: 1px solid #ccc;
- background: #fff;
- padding: .2em 1em;
- color: #000;
-}
-
-div#searchTargetContainer {
- left: 10px;
- top: 10px;
- width: 90%;
- background: white;
-}
-
-div#searchTarget {
- padding: 3px;
- margin: 5px;
- background: #F0F0F0;
- border: solid 1px blue;
-}
-
-div#searchTarget ul li {
- list-style: none;
-}
-
-div#searchTarget ul li:before {
- color: orange;
- content: "\00BB \0020";
-}
-
-div#searchTargetHide {
- float:right;
- border:solid 1px black;
- background:#DCDCDC;
- padding:2px;
-}
-
-div.multipageimagenavbox {
- border: solid 1px silver;
- padding: 4px;
- margin: 1em;
- -moz-border-radius: 6px;
- background: #f0f0f0;
-}
-
-div.multipageimagenavbox div.thumb {
- border: none;
- margin-left: 2em;
- margin-right: 2em;
-}
-
-div.multipageimagenavbox hr {
- margin: 6px;
-}
-
-table.multipageimage td {
- text-align: center;
-}
-
-/** Special:Version */
-
-table#sv-ext, table#sv-hooks, table#sv-software {
- margin: 1em;
- padding:0em;
-}
-
-#sv-ext td, #sv-hooks td, #sv-software td,
-#sv-ext th, #sv-hooks th, #sv-software th {
- border: 1px solid #A0A0A0;
- padding: 0 0.15em 0 0.15em;
-}
-#sv-ext th, #sv-hooks th, #sv-software th {
- background-color: #F0F0F0;
- color: black;
- padding: 0 0.15em 0 0.15em;
-}
-tr.sv-space{
- height: 0.8em;
- border:none;
-}
-tr.sv-space td { display: none; }
-
-/*
- Table pager (e.g. Special:Imagelist)
- - remove underlines from the navigation link
- - collapse borders
- - set the borders to outsets (similar to Special:Allmessages)
- - remove line wrapping for all td and th, set background color
- - restore line wrapping for the last two table cells (description and size)
-*/
-.TablePager_nav a { text-decoration: none; }
-.TablePager { border-collapse: collapse; }
-.TablePager, .TablePager td, .TablePager th {
- border: 1px solid #aaaaaa;
- padding: 0 0.15em 0 0.15em;
-}
-.TablePager th { background-color: #eeeeff }
-.TablePager td { background-color: #ffffff }
-.TablePager tr:hover td { background-color: #eeeeff }
-
-.imagelist td, .imagelist th { white-space: nowrap }
-.imagelist .TablePager_col_links { background-color: #eeeeff }
-.imagelist .TablePager_col_img_description { white-space: normal }
-.imagelist th.TablePager_sort { background-color: #ccccff }
-
-.templatesUsed { margin-top: 1.5em; }
-
-.mw-summary-preview {
- margin: 0.1em 0;
-}
-
-/* Friendlier slave lag warnings */
-div.mw-lag-warn-normal,
-div.mw-lag-warn-high {
- padding: 3px;
- text-align: center;
- margin: 3px auto;
-}
-div.mw-lag-warn-normal {
- border: 1px solid #FFCC66;
- background-color: #FFFFCC;
-}
-div.mw-lag-warn-high {
- font-weight: bold;
- border: 2px solid #FF0033;
- background-color: #FFCCCC;
-}
-
-/* Recreating-deleted-page/reupload file warning and log entries */
-div#mw-upload-deleted-warn,
-div#mw-recreate-deleted-warn {
- padding: 3px;
- margin-bottom: 3px;
- border: 2px solid #2F6FAB;
-}
-div#mw-upload-deleted-warn ul li,
-div#mw-recreate-deleted-warn ul li {
- font-size: 90%;
-}
-.MediaTransformError {
- background-color: #ccc;
- padding: 0.1em;
-}
-.MediaTransformError td {
- text-align: center;
- vertical-align: middle;
- font-size: 90%;
-}
-
-/** Special:Search stuff */
-div#mw-search-interwiki-caption {
- text-align: center;
- font-weight: bold;
- font-size: 95%;
-}
-
-.mw-search-interwiki-project {
- font-size: 97%;
- text-align: left;
- padding-left: 0.2em;
- padding-right: 0.15em;
- padding-bottom: 0.2em;
- padding-top: 0.15em;
- background: #cae8ff;
-}
-
-span.searchmatch {
- font-weight: bold;
- color: red;
-}
-
-/* God-damned hack for the crappy layout */
-.os-suggest {
- font-size: 127%;
-}
-/**
- * CSS in this file is used by *all* skins (that have any CSS at all). Be
- * careful what you put in here, since what looks good in one skin may not in
- * another, but don't ignore the poor non-Monobook users either.
- */
-.mw-plusminus-null { color: #aaa; }
-
-.texvc { direction: ltr; unicode-bidi: embed; }
-img.tex { vertical-align: middle; }
-span.texhtml { font-family: serif; }
-
-/* Stop floats from intruding into edit area in previews */
-#toolbar, #wpTextbox1 { clear: both; }
-
-div#mw-js-message {
- margin: 1em 5%;
- padding: 0.5em 2.5%;
- border: solid 1px #ddd;
- background-color: #fcfcfc;
-}
-
-/* Edit section links */
-.editsection {
- float: right;
- margin-left: 5px;
-}
-
-/**
- * File histories
- */
-table.filehistory {
- border:1px solid #ccc;
- border-collapse:collapse;
-}
-
-table.filehistory th,
-table.filehistory td {
- padding: 0 0.2em 0 0.2em;
- vertical-align:top;
- border:1px solid #ccc;
-}
-table.filehistory th {
- text-align: left;
-}
-table.filehistory td.mw-imagepage-filesize,
-table.filehistory th.mw-imagepage-filesize {
- white-space:nowrap;
-}
-
-/*
- * rev_deleted stuff
- */
-li span.deleted, span.history-deleted {
- text-decoration: line-through;
- color: #888;
- font-style: italic;
-}
-
-/**
- * Forms
- */
-body.ltr td.mw-label { text-align: right; }
-body.ltr td.mw-input { text-align: left; }
-body.ltr td.mw-submit { text-align: left; }
-body.rtl td.mw-label { text-align: left; }
-body.rtl td.mw-input { text-align: right; }
-body.rtl td.mw-submit { text-align: right; }
-
-td.mw-label { vertical-align: top; }
-td.mw-submit { white-space: nowrap; }
-
-/**
- * Image captions
- */
-body.rtl .thumbcaption { text-align:right; }
-body.rtl .magnify { float:left; }
-
-body.ltr .thumbcaption { text-align:left; }
-body.ltr .magnify { float:right; }
-
-/**
- * Hidden categories
- */
-.mw-hidden-cats-hidden { display: none; }
-.catlinks-allhidden { display: none; }
-
-/* Convenience links to edit block and delete reasons */
-p.mw-ipb-conveniencelinks, p.mw-filedelete-editreasons, p.mw-delete-editreasons {
- font-size: 90%;
- float: right;
-}
-
-/* Search results */
-div.searchresult {
- font-size: 95%;
- width:38em;
-}
-.mw-search-results li {
- padding-bottom: 1em;
-}
-.mw-search-result-data {
- color: green;
- font-size: 97%;
-}
-
-div#mw-search-interwiki {
- float: right;
- width: 18em;
- border-style: solid;
- border-color: #AAAAAA;
- border-width: 1px;
- margin-top: 2ex;
-}
-
-div#mw-search-interwiki li {
- font-size: 95%;
-}
-
-.mw-search-interwiki-more {
- float: right;
- font-size: 90%;
-}
-
-span.searchalttitle {
- font-size: 95%;
-}
-
-div.searchdidyoumean {
- font-size: 127%;
- padding-bottom:1ex;
- padding-top:1ex;
-}
-
-/*
- * UserRights stuff
- */
-.mw-userrights-disabled {
- color: #888;
-}
-
-table.mw-userrights-groups * td,table.mw-userrights-groups * th {
- padding-right: 1.5em;
-}
-
-/*
- * OpenSearch ajax suggestions
- */
-.os-suggest {
- overflow: auto;
- overflow-x: hidden;
- position: absolute;
- top: 0px;
- left: 0px;
- width: 0px;
- background-color: white;
- border-style: solid;
- border-color: #AAAAAA;
- border-width: 1px;
- z-index:99;
- visibility:hidden;
- font-size:95%;
-}
-
-table.os-suggest-results {
- font-size: 95%;
- cursor: pointer;
- border: 0;
- border-collapse: collapse;
- width: 100%;
-}
-
-td.os-suggest-result, td.os-suggest-result-hl {
- white-space: nowrap;
- background-color: white;
- background-color: Window;
- color: black;
- color: WindowText;
- padding: 2px;
-}
-td.os-suggest-result-hl,
-td.os-suggest-result-hl-webkit {
- background-color: #4C59A6;
- color: white;
-}
-td.os-suggest-result-hl {
- /* System colors are misimplemented in Safari 3.0 and earlier,
- making highlighted text illegible... */
- background-color: Highlight;
- color: HighlightText;
-}
-
-.os-suggest-toggle {
- position: relative;
- left: 1ex;
- font-size: 65%;
-}
-.os-suggest-toggle-def {
- position: absolute;
- top: 0px;
- left: 0px;
- font-size: 65%;
- visibility: hidden;
-}
-
-/* Page history styling */
-/* the auto-generated edit comments */
-.autocomment { color: gray; }
-#pagehistory .history-user {
- margin-left: 0.4em;
- margin-right: 0.2em;
-}
-#pagehistory span.minor { font-weight: bold; }
-#pagehistory li { border: 1px solid white; }
-#pagehistory li.selected {
- background-color: #f9f9f9;
- border: 1px dashed #aaa;
-}
-
-table.mw-listgrouprights-table {
- border: 1px solid #ccc;
- border-collapse: collapse;
-}
-
-table.mw-listgrouprights-table tr {
- vertical-align: top;
-}
-
-table.mw-listgrouprights-table td, table.mw-listgrouprights-table th {
- padding: 0.5em 0.2em 0.5em 0.2em;
- border: 1px solid #ccc;
-}
-
-/* Special:SpecialPages styling */
-h4.mw-specialpagesgroup {
- background-color: #dcdcdc;
- padding: 2px;
- margin: .3em 0em 0em 0em;
-}
-
-#shared-image-dup, #shared-image-conflict {
- font-style: italic;
-}
diff --git a/static/news_icon.png b/static/news_icon.png
deleted file mode 100755
index dd1541d..0000000
--- a/static/news_icon.png
+++ /dev/null
Binary files differ
diff --git a/static/outgoing_link.gif b/static/outgoing_link.gif
deleted file mode 100644
index d508fc4..0000000
--- a/static/outgoing_link.gif
+++ /dev/null
Binary files differ
diff --git a/static/pedia.css b/static/pedia.css
deleted file mode 100644
index 3e814ef..0000000
--- a/static/pedia.css
+++ /dev/null
@@ -1,1250 +0,0 @@
-/* ############# misc #################*/
-body, p, li, ul, a {
- margin:0px;
- padding:0px;
-}
-
-body {
- background-color:#F4F5E7;
- font-family:arial;
- font-size:10pt;
-}
-
-img {
- border:0;
- }
-
-* {
- font-size:10pt;
- }
-
-h1, h1 * {
- font-size:20pt;
- }
-
-h2, h2 * {
- font-size:14pt;
- }
-
-h3, h3 * {
- font-size:13pt;
- }
-
-.invisible {
- display: none;
-}
-
-/* ############### base ########### */
-
-* a, * a:hover, * a:visited, * a:active {
- color:rgb(29,48,161);
- }
-
-
-
-#header {
- text-align:right;
- height:74px;
- padding:0px;
- margin:0px;
- table-layout:fixed;
- overflow:hidden;
-}
-
-#main_nav {
- padding-top:5px;
- margin-right:20px;
- height:47px !important;
- /* height:50px !important; */
- height:54px;
- /* height:57px; */
-}
-
-#main_nav a {
- font-size:10pt;
- font-weight:bold;
- color: black;
- text-decoration:none;
-}
-
-#main_nav ul {
- line-height:12pt;
-}
-
-#main_nav li {
- display:inline;
-}
-
-#tab_nav {
- position:absolute;
- /* top:60px !important;
- top:57px; */
-
- top:66px !important;
- top:63px;
- right:30px;
- border:0px;
- }
-
-
-#errorarea, #busyarea {
- position:absolute;
- top:40%;
- left:30%;
- width:40%;
- height:10%;
- border:2px solid rgb(196,196,196);
- background-color: rgb(255,136,0);
- text-align:center;
- }
-
-head:first-child+body #busyarea { /* this is a hack to prevent IE to read this*/
- position:fixed;
- }
-
-#busyarea {
- /* background-color:#F4F5E7; */
- background-color:white;
- }
-
-#errorarea {
- background-color: rgb(255,136,0);
- }
-
-a#errorclose {
- color:black;
- font-weight:bold;
- }
-
-/* ######### misc table formatting ################*/
-
-/*
-#managebook table {
- padding:0px;
- margin:0px;
- border-collapse:collapse;
- border-spacing:0px;
- }
-*/
-
-.roundbox, .roundbox tr, .roundbox td, .roundbox img, .clean, #tab_nav img, .snippet img {
- padding:0px;
- margin:0px;
- border:0px;
- border-collapse:collapse;
- border-spacing:0px;
- /* border-style:hidden; */
-}
-
-.tablefull {
- margin:0px;
- border:0px;
- border-spacing:0px;
- width:100%;
- padding:5px;
-}
-
-/*
-.roundbox td {
- background-color:white;
-}
-*/
-
-.roundboxContent {
- background-color:white;
- }
-
-/* ################## managebook ################## */
-
-#book_nav {
- line-height:16pt;
- font-size:10pt;
-}
-
-#book_nav input {
- margin:0px;
- vertical-align:bottom;
- font-size:10pt;
- width:220px;
-}
-
- .link {
- color:black;
- margin-right:15px;
-}
-#book_nav img {
- border:0px;
- padding:0px;
- margin:0px;
- margin-left:10px;
- margin-right:10px;
- vertical-align:bottom;
-}
-.info li {
- list-style-type:square;
-}
-
-#info li {
- list-style-type:square;
- margin-left:35px;
-}
-
-#info h2 {
- margin:10px;
- margin-top:15px;
- }
-
-#info h2 a {
- color:black;
- }
-
-#info h3 {
- margin-bottom:5px;
- }
-
-#info p {
- margin:10px;
- }
-
-#tab_nav .info {
- border:1px solid rgb(128,128,128);
- font-size:8pt;
- padding-left:20px;
-}
-
-.no_list_style li{
- list-style-type:none !important;
-}
-
-#info h3 {
- margin-left:10px;
- }
-
-/* ################## main ################### */
-
-#main {
- margin-top:0px;
- margin-right:0px;
-}
-
-#main_content {
- padding-left:10px;
- padding-right:0px;
- padding-top:5px;
-}
-
-#fromsearch {
- margin-right:350px;
- margin-bottom:10px;
- margin-left:10px;
- /* background-color: rgb(200, 220, 255); */
- background-color:rgb(240,240,240);
- border:2px solid rgb(251,88,33);
- padding:5px;
- }
-
-#wikipagecontent {
- padding: 0px 10px;
- }
-
-#add_pages {
- float:right;
- margin:0px;
- background-color:white;
- border:0px;
-}
-
-#add_pages img {
- border:0px;
- margin:5px 10px;
-}
-
-/* ******************** wikipedia article formatting ******************* */
-
-#main {
- font-family: "Trebuchet MS", Trebuchet, Verdana, sans-serif;
- /* font-family: Palatino Linotype, Book Antiqua, Palatino; */
- font-size:10pt;
- overflow:hidden;
-}
-
-#main h1 {
- font-size:20pt;
- margin-bottom:30px;
- margin-right:10px;
- border-bottom:1px solid rgb(128,128,128);
-}
-
-#main h2 {
- z-index:-1;
- font-size:14pt;
- margin-right:20px;
- border-bottom:1px solid rgb(128,128,128);
-}
-
-#main h3 {
- margin-top:10px;
- margin-bottom:5px;
- font-size:13pt;
-}
-
-
-#main p {
- margin-top:5px;
-}
-
-#main a {
- text-decoration:none;
-}
-
-#main a:hover {
- text-decoration:underline;
-}
-
-#main ul {
- margin: 5px 15px;
-}
-#main ul li {
- list-style-type:square;
- margin-left:20px;
-}
-
-
-#main table {
- empty-cells:show;
- background-color:white;
- margin:10px;
-}
-
-
-
-#main th {
- font-weight:bold;
- }
-
-
-#main .deadlink, #main .deadlink:hover {
- text-decoration:none;
- color:black;
- }
-
-
-#main .infobox {
- float:right;
- border:1px solid grey;
- padding:2px;
- }
-
-#main .infobox td {
- padding:2px 4px;
- }
-
-#main .bordered {
- border-collapse:collapse;
- }
-
-#main .bordered td {
- border:1px solid grey;
- }
-
-#main .borderless *, #main .borderless {
- border:0 !important;
- }
-
-
-#main .infobox * {
- font-size: 8pt;
- }
-
-#main sub, #main sup {
- font-size: 8pt;
- margin-right:3px;
- }
-
-
-#main .small * {
- font-size:8pt;
- }
-
-
-.border {
- border:1px solid rgb(128,128,128);
- border-collapse:collapse;
-}
-
-.image {
- margin:10px;
- padding:2px;
- border:1px solid rgb(128,128,128);
- background:white;
-}
-
-.clear {
- clear:both;
- }
-
-.right {
- clear:right;
- float:right;
-}
-
-/*
-.right + .right {
- clear:right;
- }
-*/
-
-.left {
- clear:left;
- float:left;
-}
-
-/*
-.left + .left {
- clear:left;
- }
-*/
-
-#main .formula {
- vertical-align:middle;
- }
-
-
-.imagecaption {
- display:block;
- font-size:8pt;
- padding:2px;
-}
-
-.imagecaption *{
- font-size:8pt;
-}
-
-/* .wikitable, .wikitable tr, */
-
-.wikitable {
- border-collapse:collapse;
-}
-
-.wikitable td {
- border:1px solid black;
- border-spacing:0px;
- padding:0px 2px;
- }
-
-.toccolours {
- border:1px solid black;
- }
-
-
-/* ###### misc... ##### */
-
-.addButton img {
- width:12px;
- height:12px;
- border:0;
- margin-right:10px;
- }
-
-.addButton div {
- margin-right:10px;
- width:12px;
- display:inline;
- }
-
-
-.addButton a {
- margin-left:0px;
- }
-
-
-/* ############## pagelist ####################### */
-
-#pagelist {
- padding:10px;
- }
-
-#collTitle {
- /* margin-left:10px; */
- font-size:12pt;
- font-weight:bold;
- border-bottom:1px solid rgb(128,128,128);
- }
-
-#collEditTable {
- margin:10px 0px;
- }
-
-.box_content {
- margin:10px 0px;
- font-size:9pt;
-}
-
-#collInfo {
- margin-top:10px;
- font-size:10pt;
- }
-
-.del_col {
- /* width:2em; */
- width:21px;
- padding:0px 2px;
- }
-
-.priceInfo {
- margin-bottom:10px;
- font-size:8pt;
- }
-
-#collNumPages {
- margin-top:10px;
-}
-
-#collNumPages, #collPrice {
- font-weight:bold;
- }
-
-#clearbook {
- margin-top:10px;
- }
-
-
-div.uitable table{
- border-collapse: collapse;
- /* border:1px solid rgb(196,196,196); */
- cursor:pointer;
-}
-
-div.uitable table tbody tr {
- padding:3px;
- margin:3px;
-}
-
-/*
-div.uitable table tbody tr.ui_hover td{
- background-color:#BACFE4;
-}
-*/
-
-div.uitable table tbody tr.ui_active td {
- /* background-color:#F4F5E7; */
- font-weight:bold;
-
-}
-
-div.uitable td {
- padding:0px 2px;
- }
-
-div.uitable td:hover {
- text-decoration:underline;
- background-color:#BACFE4;
- }
-
-
-/* ############################# index.html ########################### */
-
-#home_left, #home_right {
- padding:0px 10px;
- }
-
-#home_right span {
- /* font-style:italic; */
- border-bottom:1px solid rgb(128,128,128);
-
-}
-
-#home_right .heading {
- width:450px;
- border-bottom:1px solid rgb(128,128,128);
- }
-
-
-#home_right li {
- margin-left:20px;
- font-style:normal;
- font-weight: normal;
- }
-
-#home_left p, #home_right p {
- margin:0px 0px;
- }
-
-#home_right h1 {
- font-size:14pt;
- /* color:rgb(64,64,64); */
- color:rgb(32,32,32);
- margin-right:15px;
- margin-top:0px;
- text-decoration:underline;
- }
-
-#home_right h2 {
- font-size:14pt;
- color:rgb(64,64,64);
- color:rgb(32,32,32);
- margin-right:15px;
- display:inline;
- }
-
-#home_right ul {
- margin-bottom:10px;
- list-style-type:square;
- }
-
-
-#home_left h2 {
- font-size:14pt;
- color:rgb(64,64,64);
- color:rgb(32,32,32);
- margin-top:5px;
- margin-bottom:5px;
- }
-
-#home_left li {
- list-style-type:none;
- margin-bottom:5px;
- margin-left:0px;
- padding-left:0px;
- }
-
-#home_left .title {
- font-weight:bold;
- font-style:italic;
- }
-
-#home_left td {
- padding:3px 2px;
- }
-
-
-
-#finish_book {
- line-height:18pt;
- }
-
-#finish_book .label {
- font-weight:bold;
- vertical-align:bottom;
- text-align:right;
- padding-right:5px;
- }
-
-#finish_book .input {
- vertical-align:bottom;
- text-align:left;
- padding-left:5px;
- }
-
-#finish_book input {
- padding: 0px 5px;
- margin:2px 0px;
- width:400px;
- }
-
-#booktitle {
- font-size:14pt;
-}
-
-#bookeditor {
- font-size:12pt;
- }
-
-
-#finish_book table {
- margin-bottom:5px;
-}
-
-#wp_footer {
- clear:both;
- float:right;
- margin-top:10px;
- margin-bottom:10px;
- padding:5px;
- /* border:2px solid rgb(230,230,230); */
- border:2px solid rgb(251,88,33);
- background-color:rgb(240,240,240);
- }
-
-/* ++++++++++++++++++ order ++++++++++++++ */
-
-#order_pay h2 {
- margin-top:0px;
- }
-
-#order_content h2, #order_content h3, #showbook_content h2, #showbook_content h3 {
- margin:5px 0px;
- }
-
-#order_content h3, #showbook_content h3 {
- margin-top:15px;
- }
-
-
-#order_content li, #showbook_content li {
- margin-right:10px;
- list-style-type:none;
- border-bottom:1px dotted grey;
- }
-
-#order_content, #order_pay, #showbook_content {
- margin:10px;
- }
-
-#order_content a, #showbook_content a {
- text-decoration:none;
- }
-
-#order_content a:hover, #showbook_content a:hover {
- text-decoration:underline;
- }
-
-#cost .label, #ship .label, #contact_form .label {
- text-align:right;
- vertical-align:top;
- }
-#cost .value #ship .value, #contact_form .value {
- text-align:left;
- }
-
-#cost td, #ship td, #contact_form td {
- padding:2px 5px;
- }
-
-#cost {
- border:1px solid grey;
- }
-
-#ship input, #ship textarea, #ship select {
- width:250px;
- }
-
-#terms_ok {
- margin-left:10px;
- }
-
-#terms_ok input {
- margin-left:0px;
-
- }
-
-#contact_form input, #contact_form select {
- width: 250px;
- }
-
- #contact_form textarea {
- width:400px;
- }
-
-#contact h2 {
- margin-top:0px;
- }
-
-
-.tooltip {
- background-color: rgb(255, 250, 200);
- border: 1px solid black;
- position: absolute;
- z-index: 10000;
- width: 200px;
- padding:2px;
- text-align:center;
-}
-
-.snippet {
- background-color: rgb(200, 220, 255);
- border: 1px solid black;
- padding: 5px;
- z-index: 10000;
- position: absolute;
- font-size: 10px;
-}
-
-#snippetid, #snippetid * {
- font-size: 10pt;
- font-style:normal;
- font-weight:normal;
-}
-
-#snippetid em {
- font-style:italic;
- }
-
-#snippetid strong {
- font-weight:bold;
- }
-
-
-.hasborder {
- border: 2px solid rgb(220,220,220);
-}
-
-.noborder {
- border-width: 0px;
- border: 2px solid white;
-}
-
-.greyedout {
- color: rgb(127, 127, 127);
-}
-
-.notgreyedout {
- color: black;
-}
-
-#terms dt {
- margin-top:10px;
- font-weight:bold;
- }
-
-#terms .toc li {
- margin-left:15px;
- list-style-type:none;
- }
-
-#terms p {
- margin-top:10px;
-
- }
-
-
-#terms p, #terms dt, #terms dd, #terms li, #terms a, #terms strong{
- font-size:8pt;
- }
-
-#terms h2, #terms h2 a {
- font-size:12pt;
- color:black;
- }
-
-#terms h3 {
- font-size:10pt;
- }
-
-#terms li {
- list-style-type:square;
- }
-
-#refreshproposals {
- padding:5px;
- margin:5px;
- margin-right:0px;
- }
-
-
-.site_link {
- border-bottom:1px dotted black;
- color:black;
- text-decoration:none;
-}
-
-.site_link:hover {
- text-decoration:none !important;
- }
-
-
-.topcats, .topcats * {
- font-weight:bold;
- list-style-type:none !important;
- margin:0px;
- padding:0px;
- font-size:12pt;
- border-bottom:1px solid rgb(128,128,128);
- margin-top:5px;
- }
-
-.topcats {
- margin-right:5px;
-}
-
-.subcats {
- margin-right:0px;
- }
-
-
-#preview {
- margin:10px;
- }
-
-#preview h1 {
- margin-top:0px;
- margin-bottom:10px;
- }
-
-#adobe_info {
- float:right;
- width:33%;
- border:1px solid rgb(128,128,128);
- border:1px solid rgb(196,196,196);
- margin:10px;
- margin-right:0px;
- margin-top:0px;
- padding:5px;
-
- }
-
-#generating {
- margin:0px;
- }
-
-#finished p {
- margin-bottom:10px;
- }
-
-#affiliate {
- padding:5px;
- padding-top:0px;
- }
-#affiliate p{
- margin-bottom:10px;
- }
-
-#affiliate li {
- list-style-type:square;
- margin-left:25px;
- }
-#affiliate ul {
- margin-bottom:10px;
-}
-
-#affiliatetable td{
- padding:10px;
- }
-
-#affiliatetable li {
- list-style-type:none;
- }
-
-#affiliatetable input {
- margin-left:0px;
- }
-
-.affiliatebox {
- float:left;
- width:45%;
- margin:10px;
- /* padding:10px; */
- /* border:2px solid rgb(210,210,210); */
- /* border:2px solid rgb(251,88,33); */
- }
-
-.affiliateboxcontent {
- margin:10px;
- }
-
-.affiliatebox h2 {
- margin:0px;
- margin-bottom:10px;
- }
-
-.affiliatebox ul li {
- list-style-type:square;
- margin-left:15px;
- }
-
-.affiliatebox .nobullets li {
- list-style-type:none;
- margin-left:0px;
- }
-
-
-
-#welcome {
- padding:10px;
- padding-top:5px;
- margin:0px;
- }
-
-#welcome h1 {
- margin:0px;
- margin-bottom:10px;
- font-size:16pt;
- color:rgb(32,32,32);
- }
-
-
-#home_howto td{
- padding:5px;
- vertical-align:top;
- }
-
-#home_howto .step_num {
- font-size:20pt;
- color:rgb(128,128,128);
- float:left;
- margin:5px;
- }
-
-#home_howto li {
- list-style-type:square;
- margin-left:20px;
- }
-
-#news .newsitem {
- margin: 10px;
- max-width:500px;
- }
-
-#news .newsitem h3 {
- font-size:12pt;
- margin-bottom:5px;
- margin-top:10px;
- }
-
-.newsitem + .newsitem {
- border-top:1px dotted rgb(128,128,128);
- }
-
-#news .date {
- float:right;
- margin-top:5px;
- margin-left:10px;
- font-size:8pt;
- }
-
-.deadlink {
- color:black;
-}
-
-.smalltext, .smalltext em, .smalltext * {
- font-size:8pt !important;
- }
-
-.template_warningsmart {
- border:3px solid red;
-}
-.template_warningmanual{
- border:3px solid orange;
- }
-
-.template_warningsmart * {
- background-color:rgb(210,210,210);
- }
-
-.template_warningmanual * {
- background-color:rgb(230,230,230);
- }
-
-
- #startcats {
- padding:5px;
- }
-
- #startcats h2, #startcats h3 {
- margin:5px 0px;
- }
-
-#startcats .topcats {
- margin-bottom:5px;
-}
-
-#startcats .topcats *, #startcats .subcats * {
- text-decoration:none;
- }
-
-#startcats .topcats a {
- border-bottom:0;
- }
-
-.startcatbox {
- width:30%;
- float:left;
- padding:10px;
- padding-bottom:0px;
- }
-
-.startcatbox h3 {
- border-bottom:1px solid rgb(128,128,128);
- }
-
-
-#lowpagecount, #highpagecount {
- margin:10px 0px;
- padding:10px;
- border:2px solid rgb(251,88,33);
- background-color:rgb(240,240,240);
- }
-
-#highpagecount {
- margin-left:10px;
- }
-
-
-#examplebook {
- padding:10px;
- }
-
-#examplebook li {
- list-style-type: none;
- text-align:center;
- margin-bottom:5px;
- }
-
-#examplebook .book_img img {
- border:1px dotted rgb(128,128,128);
- padding:2px;
- }
-
-#examplebook .info {
- float:right;
- border:1px dotted rgb(128,128,128);
- padding:5px;
- }
-
-#examplebook .navigation {
- position:absolute;
- margin:15px 0px;
- border:1px dotted rgb(128,128,128);
- padding:5px 15px;
- }
-
-#examplebook .navigation li {
- text-align:left;
- }
-
-#examplebook .navigation a {
- text-decoration:none;
- }
-
-#examplebook .navigation a:hover {
- text-decoration:underline;
- }
-
-
-
-
-
-
-/* ######## pssearch */
-
-
-
-.pssnippet strong {
- font-weight:normal;
- }
-
-.pssnippet li {
- margin-left:15px;
- }
-
-.pssnippethl {
- background-color: rgb(196, 224, 255);
-}
-
-
-#pssearch a {
- color:rgb(28,53,110);
- }
-
-/*
-#pssearch li {
- margin-bottom:10px;
- list-style-type:square;
- }
-*/
-
-li.result {
- margin-bottom:10px;
- list-style-type:square;
- }
-
-#pssearch .details, #pssearch .details * {
- font-size:8pt;
- }
-
-.marginbox {
- padding:5px 10px;
- }
-
-#searchresultlist .result {
- margin: 0px 5px;
- padding: 8px 0px;
- list-style-type:none;
- border-bottom:1px dotted rgb(128,128,128);
- /* border-top:1px dotted rgb(128,128,128);*/
- /*background:rgb(245, 250, 250);*/
-}
-
-/*
-.alternate {
- background: rgb(234, 238, 245);
-}
-*/
-
-.clustered {
- margin-left: 40px;
-}
-
-.resultdetails * {
- text-align:middle;
- }
-
-/* display styles for snippets search result snippet*/
-.pssnippet hr {
- display:none;
-}
-
-.pssnippet li {
- margin-left:15px;
-}
-
-/* end filter */
-
-#categories li {
- list-style-type: none;
-}
-
-#categories h2 {
- margin:0px;
- font-size: 12pt;
- }
-
-#categories a:hover {
- background-color:rgb(1,160,199);
- color:white;
- text-decoration:none;
-}
-
-#pssearch .subcats {
- margin-bottom:0px;
- margin-left:15px;
- list-style-type:none;
-}
-
-#searchselection {
- margin-left:10px;
- vertical-align:middle;
-}
-
-#searchselection input {
- color:green;
- margin-left:10px;
- margin-right:5px;
- vertical-align:middle;
-}
-
-.searchresulturl {
- color: rgb(0, 96, 120);
-}
-
-.psformat {
- font-size: 8pt;
-}
-
-.psrf {
- float: right;
-}
-
-.pscategorylink, .psarticlelink {
- white-space: nowrap;
-}
-
-.matchedcategories {
- border: 1px dotted grey;
- /*background-color: rgb(245, 245, 245);*/
- margin-left: 10px;
- margin-right: 10px;
- margin-bottom: 15px;
- padding: 4px;
-}
-
diff --git a/static/phys_science.png b/static/phys_science.png
deleted file mode 100644
index e2c0c7e..0000000
--- a/static/phys_science.png
+++ /dev/null
Binary files differ
diff --git a/static/required.gif b/static/required.gif
deleted file mode 100755
index bd71976..0000000
--- a/static/required.gif
+++ /dev/null
Binary files differ
diff --git a/static/shared.css b/static/shared.css
deleted file mode 100644
index d841985..0000000
--- a/static/shared.css
+++ /dev/null
@@ -1,242 +0,0 @@
-/**
- * CSS in this file is used by *all* skins (that have any CSS at all). Be
- * careful what you put in here, since what looks good in one skin may not in
- * another, but don't ignore the poor non-Monobook users either.
- */
-.mw-plusminus-null { color: #aaa; }
-
-.texvc { direction: ltr; unicode-bidi: embed; }
-img.tex { vertical-align: middle; }
-span.texhtml { font-family: serif; }
-
-/* Stop floats from intruding into edit area in previews */
-#toolbar, #wpTextbox1 { clear: both; }
-
-div#mw-js-message {
- margin: 1em 5%;
- padding: 0.5em 2.5%;
- border: solid 1px #ddd;
- background-color: #fcfcfc;
-}
-
-/* Edit section links */
-.editsection {
- float: right;
- margin-left: 5px;
-}
-
-/**
- * File histories
- */
-table.filehistory {
- border:1px solid #ccc;
- border-collapse:collapse;
-}
-
-table.filehistory th,
-table.filehistory td {
- padding: 0 0.2em 0 0.2em;
- vertical-align:top;
- border:1px solid #ccc;
-}
-table.filehistory th {
- text-align: left;
-}
-table.filehistory td.mw-imagepage-filesize,
-table.filehistory th.mw-imagepage-filesize {
- white-space:nowrap;
-}
-
-/*
- * rev_deleted stuff
- */
-li span.deleted, span.history-deleted {
- text-decoration: line-through;
- color: #888;
- font-style: italic;
-}
-
-/**
- * Forms
- */
-body.ltr td.mw-label { text-align: right; }
-body.ltr td.mw-input { text-align: left; }
-body.ltr td.mw-submit { text-align: left; }
-body.rtl td.mw-label { text-align: left; }
-body.rtl td.mw-input { text-align: right; }
-body.rtl td.mw-submit { text-align: right; }
-
-td.mw-label { vertical-align: top; }
-td.mw-submit { white-space: nowrap; }
-
-/**
- * Image captions
- */
-body.rtl .thumbcaption { text-align:right; }
-body.rtl .magnify { float:left; }
-
-body.ltr .thumbcaption { text-align:left; }
-body.ltr .magnify { float:right; }
-
-/**
- * Hidden categories
- */
-.mw-hidden-cats-hidden { display: none; }
-.catlinks-allhidden { display: none; }
-
-/* Convenience links to edit block and delete reasons */
-p.mw-ipb-conveniencelinks, p.mw-filedelete-editreasons, p.mw-delete-editreasons {
- font-size: 90%;
- float: right;
-}
-
-/* Search results */
-div.searchresult {
- font-size: 95%;
- width:38em;
-}
-.mw-search-results li {
- padding-bottom: 1em;
-}
-.mw-search-result-data {
- color: green;
- font-size: 97%;
-}
-
-div#mw-search-interwiki {
- float: right;
- width: 18em;
- border-style: solid;
- border-color: #AAAAAA;
- border-width: 1px;
- margin-top: 2ex;
-}
-
-div#mw-search-interwiki li {
- font-size: 95%;
-}
-
-.mw-search-interwiki-more {
- float: right;
- font-size: 90%;
-}
-
-span.searchalttitle {
- font-size: 95%;
-}
-
-div.searchdidyoumean {
- font-size: 127%;
- padding-bottom:1ex;
- padding-top:1ex;
-}
-
-/*
- * UserRights stuff
- */
-.mw-userrights-disabled {
- color: #888;
-}
-
-table.mw-userrights-groups * td,table.mw-userrights-groups * th {
- padding-right: 1.5em;
-}
-
-/*
- * OpenSearch ajax suggestions
- */
-.os-suggest {
- overflow: auto;
- overflow-x: hidden;
- position: absolute;
- top: 0px;
- left: 0px;
- width: 0px;
- background-color: white;
- border-style: solid;
- border-color: #AAAAAA;
- border-width: 1px;
- z-index:99;
- visibility:hidden;
- font-size:95%;
-}
-
-table.os-suggest-results {
- font-size: 95%;
- cursor: pointer;
- border: 0;
- border-collapse: collapse;
- width: 100%;
-}
-
-td.os-suggest-result, td.os-suggest-result-hl {
- white-space: nowrap;
- background-color: white;
- background-color: Window;
- color: black;
- color: WindowText;
- padding: 2px;
-}
-td.os-suggest-result-hl,
-td.os-suggest-result-hl-webkit {
- background-color: #4C59A6;
- color: white;
-}
-td.os-suggest-result-hl {
- /* System colors are misimplemented in Safari 3.0 and earlier,
- making highlighted text illegible... */
- background-color: Highlight;
- color: HighlightText;
-}
-
-.os-suggest-toggle {
- position: relative;
- left: 1ex;
- font-size: 65%;
-}
-.os-suggest-toggle-def {
- position: absolute;
- top: 0px;
- left: 0px;
- font-size: 65%;
- visibility: hidden;
-}
-
-/* Page history styling */
-/* the auto-generated edit comments */
-.autocomment { color: gray; }
-#pagehistory .history-user {
- margin-left: 0.4em;
- margin-right: 0.2em;
-}
-#pagehistory span.minor { font-weight: bold; }
-#pagehistory li { border: 1px solid white; }
-#pagehistory li.selected {
- background-color: #f9f9f9;
- border: 1px dashed #aaa;
-}
-
-table.mw-listgrouprights-table {
- border: 1px solid #ccc;
- border-collapse: collapse;
-}
-
-table.mw-listgrouprights-table tr {
- vertical-align: top;
-}
-
-table.mw-listgrouprights-table td, table.mw-listgrouprights-table th {
- padding: 0.5em 0.2em 0.5em 0.2em;
- border: 1px solid #ccc;
-}
-
-/* Special:SpecialPages styling */
-h4.mw-specialpagesgroup {
- background-color: #dcdcdc;
- padding: 2px;
- margin: .3em 0em 0em 0em;
-}
-
-#shared-image-dup, #shared-image-conflict {
- font-style: italic;
-}
diff --git a/static/socialscience.png b/static/socialscience.png
deleted file mode 100644
index a989732..0000000
--- a/static/socialscience.png
+++ /dev/null
Binary files differ
diff --git a/static/society.png b/static/society.png
deleted file mode 100644
index e8ffbd1..0000000
--- a/static/society.png
+++ /dev/null
Binary files differ
diff --git a/static/styles.css b/static/styles.css
deleted file mode 100644
index e40e1c4..0000000
--- a/static/styles.css
+++ /dev/null
@@ -1,61 +0,0 @@
-/*<pre><nowiki>*/
-
- /************************/
- /* CommonsTicker styles */
- /************************/
-
- /* Estilos para el CommonsTicker. Es cargado por MediaWiki:Common.css
- Esta página DEBE ESTAR PROTEGIDA */
-
- /* links */
- .tickerDiffLink { } /* diff links in ticker */
- .tickerMiscLink { } /* misc links in ticker */
- /* remove list bullets */
- .tickerList ul, .tickerList ul li { list-style: none; text-indent:-2em; margin-left:2em; text-align:left; }
- .tickerList ul ul, .tickerList ul ul li { list-style: none; text-indent:0; margin-left:1.5em; text-align:left; }
-
- /* per-type styles */
- .tickerEntry_deleted { } /* entry for image deletion */
- .tickerEntry_restored { } /* entry for restored image */
- .tickerEntry_replaced { } /* entry for image replacement */
- .tickerEntry_tagged { } /* entry for adding/removing problem tags */
- .tickerEntry_redir { } /* entry for critical redirection (fot tag redirects) */
- .tickerEntry_recat { } /* entry for critical re-categorization (for tag categories) */
- .tickerEntry_notify { } /* entry for global notifications */
- .tickerEntry_changed { } /* entry for generic change */
-
- /* per-status styles */
- .tickerStatus_done { text-decoration:line-through; } /* strike through when entry has been handeled */
-
- /* per-action styles */
- .tickerAction_deleted:before { content:" Eliminada "; color: #FF0000; font-family:monospace; font-weight:bold; font-size:80%; }
- .tickerAction_restored:before { content:" Recuperada "; color: #00BB00; font-family:monospace; font-weight:bold; font-size:80%; }
- .tickerAction_deletedRev:before { content:" -Anterior "; color: #DDAAAA; font-family:monospace; font-weight:bold; font-size:80%; }
- .tickerAction_replaced:before { content:" Reemplazada "; color: #CC88FF; font-family:monospace; font-weight:bold; font-size:100%; }
- .tickerAction_replacedOwn:before { content:" UPDT "; color: #EEAAFF; font-family:monospace; font-weight:bold; font-size:100%; }
- .tickerAction_addedBad:before { content:" +VfD "; color: #FF8800; font-family:monospace; font-weight:bold; font-size:100%; }
- .tickerAction_removedBad:before { content:" -VfD "; color: #00BB00; font-family:monospace; font-weight:bold; font-size:100%; }
- .tickerAction_addedGood:before { content:" +OK "; color: #00BB00; font-family:monospace; font-weight:bold; font-size:100%; }
- .tickerAction_removedGood:before { content:" -OK "; color: #FF8800; font-family:monospace; font-weight:bold; font-size:100%; }
-
- /* ticker usage list */
- .tickerUsage { font-size:80%; }
-
- /* entry applies to a template used by multiple images */
- .tickerTemplateEntry { font-weight: bold; }
-
- /* entry applies to sub-entries, i.e. images that use a specific template */
- .tickerSubEntry { }
-
- /* minor entry styles */
- .tickerMinorEntry { color:#666; } /* minor entry */
- .tickerMinorEntry a,
- .tickerMinorEntry a:link,
- .tickerMinorEntry a:visited { color:#669; }
- #bodyContent .tickerMinorEntry a.extiw,
- #bodyContent .tickerMinorEntry a.extiw:link,
- #bodyContent .tickerMinorEntry a.extiw:visited { color:#669; }
-
- .tachado { text-decoration:line-through; } /* Una forma fácil de escribirlo */
-
-/*</nowiki></pre>*/ \ No newline at end of file
diff --git a/static/technology.png b/static/technology.png
deleted file mode 100644
index 4613eeb..0000000
--- a/static/technology.png
+++ /dev/null
Binary files differ
diff --git a/static/user.gif b/static/user.gif
deleted file mode 100755
index bc93439..0000000
--- a/static/user.gif
+++ /dev/null
Binary files differ
diff --git a/static/video.png b/static/video.png
deleted file mode 100755
index 38103da..0000000
--- a/static/video.png
+++ /dev/null
Binary files differ
diff --git a/static/wikipedia.png b/static/wikipedia.png
deleted file mode 100644
index 470345a..0000000
--- a/static/wikipedia.png
+++ /dev/null
Binary files differ
diff --git a/tools/CountLinks.pl b/tools/CountLinks.pl
deleted file mode 100755
index 571abc0..0000000
--- a/tools/CountLinks.pl
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-my $pagelist = $ARGV[0];
-my $redirectlist = $ARGV[1];
-my $pagelinks = $ARGV[2];
-
-my %pagecounts = ();
-open(PAGE,$pagelist) or die;
-while(<PAGE>) {
- chomp;
- $pagecounts{$_} = 0;
-}
-close(PAGE);
-
-my %redirects = ();
-open(REDIR,$redirectlist) or die;
-while (<REDIR>) {
- if (/\[\[(.*?)\]\]\s*\[\[(.*?)\]\]/) {
- $redirects{$1} = $2;
- } else {
- die "redirects line is weird:\n$_\n";
- }
-}
-close(REDIR);
-
-open(LINKS,$pagelinks);
-while (<LINKS>) {
- my @data = split;
- my $currpage = shift(@data);
- $currpage =~ s/_/ /g;
- unless (exists ($pagecounts{$currpage})) {
- next;
- }
- foreach my $link (@data) {
- $link =~ s/_/ /g;
- if (exists ($redirects{$link})) {
- if (exists ($pagecounts{$redirects{$link}})) {
- $pagecounts{$redirects{$link}}++;
- } else {
-#print "Weird: $link redirects to $redirects{$link}, but this one isn't on the pagelist?\n";
- }
- }
- if (exists $pagecounts{$link}) {
- $pagecounts{$link}++;
- } else {
-#print "$link does not exist on pagelist\n";
- }
- }
-}
-
-foreach my $page (keys %pagecounts) {
- if (exists $redirects{$page}) {
- if (exists $pagecounts{$redirects{$page}} and exists $pagecounts{$page}) {
- if ($pagecounts{$page} >= 1) {
- print "$pagecounts{$redirects{$page}}\t[[$page]]\n";
- } else {
- print "$pagecounts{$page}\t[[$page]]\n";
- }
- }
- } else {
- print "$pagecounts{$page}\t[[$page]]\n";
- }
-}
diff --git a/tools/GetPageCounts.pl b/tools/GetPageCounts.pl
deleted file mode 100755
index 5b29f9e..0000000
--- a/tools/GetPageCounts.pl
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/perl
-
-use URI::Escape;
-use warnings;
-use strict;
-
-# using the traffic stats, get pagecounts for articles
-# count pagecounts of redirect pages towards the main page,
-# report counts for redirect as the counts of their main page
-
-# page list and redirect list generated from GetPages.pl
-my $pagelist = $ARGV[0];
-my $redirectlist = $ARGV[1];
-# traffic stats from file provided by Henrik
-my $trafficlist = $ARGV[2];
-
-# read in page list, store as keys in a "page counts" hash
-# values initally zero, traffic numbers added to them
-open(PAGES,$pagelist) or die;
-my %pagecounts = ();
-while (<PAGES>) {
- chomp;
- $pagecounts{$_} = 0;
-}
-close(PAGES);
-
-# read in redirect list, store as hash key, value pairs
-open(REDIRECTS,$redirectlist) or die;
-my %redirects = ();
-while (<REDIRECTS>) {
- if (/\[\[(.*)\]\]\s*\[\[(.*)\]\]/) {
- $redirects{$1} = $2;
- }
-}
-close(REDIRECTS);
-
-# read traffic stats
-open(TRAFFIC,$trafficlist) or die;
-while (<TRAFFIC>) {
- my @data = split;
- my $page = $data[1];
- $page = uri_unescape($page); # pages need to be unescaped
- $page =~ s/_/ /g; # and underscores converted
- if (exists $redirects{$page}) { # if redirect, also add count towards main page
- if (exists $pagecounts{$redirects{$page}}) {
- $pagecounts{$redirects{$page}} += $data[2];
- }
- }
- if (exists $pagecounts{$page}) { # add count to this page
- $pagecounts{$page} += $data[2];
- } else {
- #print "$page doesn't exist on page list!\n";
- }
-}
-
-# now output traffic amounts, not ordered
-foreach my $page (keys %pagecounts) {
- # If redirect, print target page's traffic score
- if (exists $redirects{$page}) {
- if (exists $pagecounts{$redirects{$page}}) {
- print "$pagecounts{$redirects{$page}}\t[[$page]]\n";
- }
- } elsif (exists $pagecounts{$page}) {
- print "$pagecounts{$page}\t[[$page]]\n";
- }
-}
-
diff --git a/tools/GetPages.pl b/tools/GetPages.pl
deleted file mode 100755
index 39f9c65..0000000
--- a/tools/GetPages.pl
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/perl
-# ./GetPages.pl
-# Create list of pages and redirects for a wikipedia snapshot.
-# Usage: Takes in a wikipedia snapshot as STDIN. First and second
-# arguments give the "page list" and "redirect list" output locations.
-# For example:
-# bzcat ./eswiki-20080416-pages-articles.xml.bz2 | ./GetPages all_pages all_redirects
-
-use strict;
-use warnings;
-
-my $pages = $ARGV[0];
-my $redirects = $ARGV[1];
-
-# open output files
-open(PAGES,">$pages") or die;
-open(REDIR,">$redirects") or die;
-
-# Keep list of redirects as key, value hash pairs
-my %redirects = ();
-my $currpage = ""; # will store current page title
-my $inpage = 0;
-while (<STDIN>) {
- if (/<title>(.*?)<\/title>/) { # start of new page!
- my $pagetitle = $1;
- $currpage = $1;
- print PAGES "$currpage\n"; # print page name to page list file
- $inpage = 0; # this should have been zeroed anyway...
- }
- if (/.*?<text xml.*?>(.*)/) {
- s/.*?<text xml.*?>//;
- $inpage = 1; # keep track of when we've entered page text
- }
- if ((/#REDIRECT:?\s*\[\[\s*(.*?)\s*\]\]/i) and $inpage) { # this is a redirect
- my $bracketed = $1;
- if ($bracketed =~ /:Categ/i) {
- $bracketed =~ s/:(Categ)/$1/i;
- }
- my $redirectpage = $bracketed;
- if ($bracketed =~ /(.*?)\s*[#\|]/) {
- $redirectpage = $1;
- }
- $redirectpage = capitalize($redirectpage); # first of page names needs to be capitalized
- $redirectpage =~ s/_/ /g; # don't use underscores
- unless (exists $redirects{$currpage}) {
- # it turns out some pages have multiple redirects on them;
- # in wikipedia and in this program the first one listed "wins".
- $redirects{$currpage} = $redirectpage;
- print REDIR "[[$currpage]]\t[[$redirectpage]]\n"; # print redirect to redirect list file
- }
- }
- if (/<\/text>/) { # out of text
- $inpage = 0;
- }
-}
-
-# capitalize: takes in a string, capitalizes the first letter
-sub capitalize {
- my $word = shift;
- my $firstletter = substr($word,0,1);
- if ($firstletter =~ /[a-z]/) {
- my $newletter = uc($firstletter);
- substr($word,0,1) = $newletter;
- }
- # This is kind of a hack. I need to capitalize
- # the first letters when they're accented. - mad
- unless ($firstletter =~ /[a-zA-Z]/) {
- $firstletter = substr($word,0,2);
- if ($firstletter eq "á") {
- my $newletter = "Ã";
- substr($word,0,2) = $newletter;
- } elsif ($firstletter eq "ñ") {
- my $newletter = "Ñ";
- substr($word,0,2) = $newletter;
- } elsif ($firstletter eq "é") {
- my $newletter = "É";
- substr($word,0,2) = $newletter;
- } elsif ($firstletter eq "ó") {
- my $newletter = "Ó";
- substr($word,0,2) = $newletter;
- }
- }
- #print "$word\n";
- return $word;
-}
diff --git a/tools/GetPagesAboveThreshold.pl b/tools/GetPagesAboveThreshold.pl
deleted file mode 100755
index 295f2e7..0000000
--- a/tools/GetPagesAboveThreshold.pl
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/perl
-
-use warnings;
-use strict;
-
-my $pagecounts = $ARGV[0];
-my $threshold = $ARGV[1];
-my $out = $ARGV[2];
-
-my $outpages = $out . "_pages";
-my $outlinks = $out . "_links";
-
-open(IN,$pagecounts) or die "$pagecounts not available for reading!";
-open(PAGES,">$outpages") or die "$outpages not available for writing!";
-
-
-my @removepages = ("Wikipedia:","Ayuda:","Wikiproyecto:","MediaWiki:","Plantilla:","WP:","Portal:");
-
-while (<IN>) {
- if (/(\d+).*\[\[(.*)\]\]/) {
- if ($1 > $threshold) {
- my $page = $2;
- my $good = 1;
- foreach my $remove (@removepages) {
- if ($page =~ /^$remove/) {
- $good = 0;
- }
- }
- if ($page eq "Portada") {
- $good = 0;
- }
- if ($good == 1) {
- print PAGES "$2\n";
- }
- }
- } else {
- die "WEIRD $_\n";
- }
-}
-close(IN);
-
-
diff --git a/tools/GetTemplates.pl b/tools/GetTemplates.pl
deleted file mode 100755
index a0d5ee8..0000000
--- a/tools/GetTemplates.pl
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/perl
-
-use warnings;
-use strict;
-
-my $allpagelist = $ARGV[0];
-my $redirects = $ARGV[1];
-my $pagelist = $ARGV[2];
-my $out = $ARGV[3];
-
-open(OUT,">$out") or die;
-
-my %allpages = ();
-open(PAGE,$allpagelist) or die;
-while (<PAGE>) {
- chomp;
- $allpages{$_} = 0;
-}
-close(PAGE);
-
-my %redirects = ();
-open(REDIR,$redirects) or die;
-while(<REDIR>) {
- if (/\[\[(.*)\]\].*\[\[(.*)\]\]/) {
- $redirects{$1} = $2;
- }
-}
-
-my %pages = ();
-open(PAGE,$pagelist) or die;
-while(<PAGE>) {
- chomp;
- $pages{$_} = 0;
-}
-close(PAGE);
-
-my %templates = ();
-
-my $currpage = "";
-while (<STDIN>) {
- if (/<title>(.*?)<\/title>/) {
- $currpage = $1;
- unless (exists $pages{$currpage}) {
- next;
- }
- my $intext = 0;
- my $readmore = 1;
- my $pagetext = "";
- while ($readmore) {
- if (/<text xml:space="preserve">(.*)/) {
- $intext = 1;
- $_ = $1;
- }
- if (/(.*)<\/text>/) {
- $intext = 0;
- $readmore = 0;
- $pagetext = $pagetext . $1;
- } elsif ($intext) {
- $pagetext = $pagetext . $_;
- if (length($pagetext) > 300000) {
- last;
- }
- }
- $_ = <STDIN>;
- }
- $pagetext =~ s/\n/ <newline> /g;
- $pagetext =~ s/(?<!=\{)\{({^\{\}}*?)\s*\}(?!\})//g; # remove all singleton brackets "links" so I can ignore them
- $pagetext =~ s/({^\{})\{({^\{})/$1$2/g; # remove stranded left brackets
- $pagetext =~ s/({^\}})\}({^\}})/$1$2/g; # remove stranded right brackets
- #print "\"$currpage\"";
- while ($pagetext =~ /.*?\{\{\s*([^\{\}]*?)\s*\}\}/s) {
- my $bracketed = $1;
- my $template = $bracketed;
- $pagetext =~ s/(.*?)\{\{\s*([^\{\}]*?)\s*\}\}//s;
- if ($bracketed =~ /^(.*?)\s*[<\|]/) {
- $template = $1;
- }
- if ($template =~ /DEFAULTSORT/) {
- next;
- }
- if ($template =~ /Plantilla:\s*(.*)/i) {
- $template = $1;
- }
- $template = capitalize($template);
- $template =~ s/_/ /g;
- $template = "Plantilla:" . $template;
- unless (exists $allpages{$template}) {
- next;
- }
- if (exists $templates{$template}) {
- #$templates{$template}++;
- } else {
- $templates{$template} = 1;
- print OUT "$template\n";
- }
- if (exists $redirects{$template}) {
- if (exists $templates{$redirects{$template}}) {
- } else {
- $templates{$redirects{$template}} = 1;
- print OUT "$redirects{$template}\n";
- }
- }
- }
- }
-
-}
-
-my @sorted = sort {$templates{$b} <=> $templates{$a}} keys %templates;
-
-#foreach my $temp (@sorted) {
-# print OUT "[[$temp]]\t$templates{$temp}\n";
-#}
-
-
-sub capitalize {
- my $word = shift;
- #print "$word to ";
- my $firstletter = substr($word,0,1);
- if ($firstletter =~ /[a-z]/) {
- my $newletter = uc($firstletter);
- substr($word,0,1) = $newletter;
- }
- unless ($firstletter =~ /[a-zA-Z]/) {
- $firstletter = substr($word,0,2);
- if ($firstletter eq "á") {
- my $newletter = "Ã";
- substr($word,0,2) = $newletter;
- } elsif ($firstletter eq "ñ") {
- my $newletter = "Ñ";
- substr($word,0,2) = $newletter;
- } elsif ($firstletter eq "é") {
- my $newletter = "É";
- substr($word,0,2) = $newletter;
- } elsif ($firstletter eq "ó") {
- my $newletter = "Ó";
- substr($word,0,2) = $newletter;
- }
- }
- #print "$word\n";
- return $word;
-}
-
diff --git a/tools/PageLinks.pl b/tools/PageLinks.pl
deleted file mode 100755
index b8df811..0000000
--- a/tools/PageLinks.pl
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/usr/bin/perl
-# create a file recording the outgoing links for each page
-# each line of the file represents a page and it's links,
-# the first is the page name, all following are articles it links to
-# inputs are page list and redirects list, and wikipedia snapshot as stdin, eg.:
-# bzcat ../../eswiki-20080416-pages-articles.xml.bz2 | ./PageLinks.pl top70k_pages all_redirects >| top70k_links
-# NOTE - This program is slow to run. It's a little faster if you run with
-# a smaller page list, so you don't bother assessing links for pages already excluded
-
-use strict;
-use warnings;
-
-# input
-my $pages = $ARGV[0];
-my $redirects = $ARGV[1];
-
-my %pagerank = ();
-# read in pages as keys in a hash
-open (PAGE,$pages);
-while (<PAGE>) {
- chomp;
- $pagerank{$_} = 0;
-}
-close(PAGE);
-
-my %redirects = ();
-# read in redirects as key, value pairs in a hash
-open (REDIR,$redirects);
-while (<REDIR>) {
- if (/\[\[(.*?)\]\]\s*\[\[(.*?)\]\]/) {
- $redirects{$1} = $2;
- } else {
- die "redirects line is weird:\n$_\n";
- }
-}
-close(REDIR);
-
-my $currpage = "";
-my $intext = 0;
-my $counter = 0;
-while (<STDIN>) {
- if (/<title>(.*?)<\/title>/) { # new page
- $counter++;
- $currpage = $1;
- if (exists $redirects{$currpage}) {
- next;
- } elsif (exists $pagerank{$currpage}) {
- $currpage =~ s/ /_/g;
- print "$currpage ";
- } else {
- next;
- }
- #if (0 == $counter % 100) {
- # print "Working on ${counter}th page...\n";
- #}
- my $intext = 0;
- my $readmore = 1;
- my $pagetext = "";
- while ($readmore) { # read in all page text at once
- if (/<text xml:space="preserve">(.*)/) {
- $intext = 1;
- $_ = $1;
- }
- if (/(.*)<\/text>/) {
- $intext = 0;
- $readmore = 0;
- $pagetext = $pagetext . $1;
- } elsif ($intext) {
- $pagetext = $pagetext . $_;
- if (length($pagetext) > 300000) { # hack to hanging on ridiculously large pages
- #print "FAILPAGE! ";
- last;
- }
- }
- $_ = <STDIN>;
- }
- $pagetext =~ s/\n/ <newline> /g; # to make sure we don't miss multi-line stuff
- $pagetext =~ s/(?<!=\[)\[([^\[\]]*?)\s*\](?!\])//g; # remove all singleton brackets "links" so I can ignore them
- $pagetext =~ s/([^\[])\[([^\[])/$1$2/g; # remove stranded left brackets
- $pagetext =~ s/([^\]])\]([^\]])/$1$2/g; # remove stranded right brackets
-
- # now pull out each double bracketed object without brackets inside
- while ($pagetext =~ /^.*?\[\[\s*([^\[\]]*?)\s*\]\]/s) {
- my $match = $1;
- my $link = $match;
- if (not ($match =~ /^imagen?\W*:/i)) { # check that it's not an image
- if ($match =~ /^:Categ/i) { # remove preceding colon for category links
- $match =~ s/^:(Categ)/$1/;
- }
- if ($match =~ /^(.*?)\s*[#\|]/) { # check for pipes or subsections and ignore
- $link = $1;
- }
- my $link = capitalize($link);
- if (exists $pagerank{$link}) { # only print if it's a known page
- $link =~ s/ /_/g;
- print " $link";
- }
- }
- $pagetext =~ s/^(.*?)\[\[([^\[\]]*?)\s*\]\]/$1/s; # remove this match from pagetext
- }
- print "\n";
- }
-}
-
-sub capitalize {
- my $word = shift;
- my $firstletter = substr($word,0,1);
- if ($firstletter =~ /[a-z]/) {
- my $newletter = uc($firstletter);
- substr($word,0,1) = $newletter;
- }
- # This is kind of a hack. I need to capitalize
- # the first letters when they're accented. - mad
- unless ($firstletter =~ /[a-zA-Z]/) {
- $firstletter = substr($word,0,2);
- if ($firstletter eq "á") {
- my $newletter = "Ã";
- substr($word,0,2) = $newletter;
- } elsif ($firstletter eq "ñ") {
- my $newletter = "Ñ";
- substr($word,0,2) = $newletter;
- } elsif ($firstletter eq "é") {
- my $newletter = "É";
- substr($word,0,2) = $newletter;
- } elsif ($firstletter eq "ó") {
- my $newletter = "Ó";
- substr($word,0,2) = $newletter;
- }
- }
- #print "$word\n";
- return $word;
-}
diff --git a/tools/RankImages.pl b/tools/RankImages.pl
deleted file mode 100755
index eb2c8e4..0000000
--- a/tools/RankImages.pl
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-my $BASEMULT = 6;
-
-my $pageranks = $ARGV[0];
-my $basepages = $ARGV[1];
-my $imagerankfile = $ARGV[2];
-
-open(RANK,$pageranks) or die;
-my %pagerank = ();
-while (<RANK>) {
- if (/(\d*)\s.*\[\[(.*)\]\]/) {
- my $page = $2;
- my $number = $1;
- $pagerank{$page} = $number;
- } else {
- die "$_ is weird";
- }
-}
-close(RANK);
-
-open(BASE,$basepages) or die;
-my %bases = ();
-while (<BASE>) {
- chomp;
- $bases{$_} = 0;
-}
-close(BASE);
-
-my %imagerank = ();
-my %imagemax = ();
-
-open(OUT,">$imagerankfile") or die;
-my $currpage = "";
-while(<STDIN>) {
- if (/<title>(.*?)<\/title>/) {
- $currpage = $1;
- unless (exists $pagerank{$currpage}) {
- next;
- }
-#print "counting on page $currpage\n";
- my $intext = 0;
- my $readmore = 1;
- my $pagetext = "";
- my %thispageimages = ();
- my $mult = 1;
- if (exists $bases{$currpage}) {
- $mult = $BASEMULT;
- }
- while ($readmore) {
- if (/<text xml:space="preserve">(.*)/) {
- $intext = 1;
- $_ = $1;
- }
- if (/(.*)<\/text>/) {
- $intext = 0;
- $readmore = 0;
- $pagetext = $pagetext . $1;
- } elsif ($intext) {
- $pagetext = $pagetext . $_;
- }
- $_ = <STDIN>;
- }
- # now $pagetext contains all of this page
- # process pagetext...
-#print "pagetext:\n$pagetext\n";
- $pagetext =~ s/\n/ <newline> /g;
- while ($pagetext =~ /.*?&lt;nowiki&gt;.*&lt;\/nowiki&gt;/) {
- $pagetext =~ s/(.*?)&lt;nowiki&gt;.*&lt;\/nowiki&gt;/$1/;
- }
- $pagetext =~ s/(?<!=\[)\[\s*([^\[\]]*?)\s*\](?!\])//g; # remove all singleton brackets "links" so I can ignore them
- $pagetext =~ s/([^\[])\[([^\[])/$1$2/g; # remove stranded left brackets
- $pagetext =~ s/([^\]])\]([^\]])/$1$2/g; # remove stranded right brackets
-#print "processed pagetext:\n$pagetext\n";
-#print "done processing page\n";
- while ($pagetext =~ /^.*?\[\[\s*([^\[\]]*?)\s*\]\]/s) {
- my $match = $1;
-# print "MATCH $match\n";
- my $link = $match;
- if ($match =~ /^imagen?\s*:\s*(.*)/i) { # check if it's an image
- my $bracketed = $1;
- my $image = $bracketed;
- my $size = "None";
- if ($bracketed =~ /(.*?)\s*\|(.*)/) {
- $image = $1;
- my $remainder = $2;
- if ($remainder =~ /(\d+)\s*x\s*(\d+)\s*px.*\|/) {
- $size = $1; # take width if both are specified
- } elsif ($remainder =~ /(\d+)\s*px.*\|/) {
- $size = $1;
- } elsif ($remainder =~ /thumb.*\|/) {
- if ($remainder =~ /upright.*\|/) {
- $size = 140;
- } else {
- $size = 180; # thumb default to 180 width
- }
- } else {
- }
- }
- $image = capitalize($image);
- $image =~ s/_/ /g;
- if (exists $imagerank{$image}) {
- if (exists $thispageimages{$image}) {
- #print "Don't count $image more than once for $currpage...\n";
- } else {
- #print "Adding to image $image for $currpage...\n";
- $imagerank{$image} += ($mult * $pagerank{$currpage});
- $thispageimages{$image} = 1;
- }
- if ($imagemax{$image} ne "None") {
- if ($size eq "None") {
- $imagemax{$image} = $size;
- } elsif ($imagemax{$image} < $size) {
- $imagemax{$image} = $size;
- }
- }
- } else {
- #print "Creating entry for $image on $currpage...\n";
- $imagerank{$image} = ($mult * $pagerank{$currpage});
- $imagemax{$image} = $size;
- $thispageimages{$image} = 1;
- }
-#print "$match [[Imagen:$image]] $imagerank{$image} $pagerank{$currpage}\n";
-# print "remaining pagetext:\n$pagetext\n";
- }
- $pagetext =~ s/^(.*?)\[\[([^\[\]]*?)\s*\]\]/$1/s; # remove this match from pagetext
- }
- }
-}
-
-my @rankedimages = sort {$imagerank{$b} <=> $imagerank{$a}} keys %imagerank;
-
-foreach my $image (@rankedimages) {
-# print "[[Imagen:$image]]\n";
-# print "[[Imagen:$image]]\t$imagerank{$image}\n";
- print OUT "[[Imagen:$image]]\t$imagerank{$image}\t$imagemax{$image}\n";
-}
-
-sub capitalize {
- my $word = shift;
- #print "$word to ";
- my $firstletter = substr($word,0,1);
- my $newletter = uc($firstletter);
- substr($word,0,1) = $newletter;
- #print "$word\n";
- return $word;
-}
diff --git a/tools/RemoveBlacklist.pl b/tools/RemoveBlacklist.pl
deleted file mode 100755
index 2c969b6..0000000
--- a/tools/RemoveBlacklist.pl
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/perl
-
-my $blacklist = $ARGV[0];
-my $redirects = $ARGV[1];
-my $pages = $ARGV[2];
-
-open(BLACK,$blacklist) or die;
-my %blacklist = ();
-while (<BLACK>) {
- chomp;
- $blacklist{$_} = 0;
-}
-close(BLACK);
-
-my %redirects = ();
-open(REDIR,$redirects) or die;
-while (<REDIR>) {
- if (/\[\[(.*)\]\].*\[\[(.*)\]\]/) {
- $redirects{$1} = $2;
- }
-}
-close(REDIR);
-
-open(PAGE,$pages) or die;
-while (<PAGE>) {
- chomp;
- my $inblacklist = 0;
- if (exists $blacklist{$_}) {
- $inblacklist = 1;
- }
- if (exists $redirects{$_}) {
- if (exists $blacklist{$redirects{$_}}) {
- $inblacklist = 1;
- }
- }
- unless ($inblacklist) {
- print "$_\n";
- }
-}
-
diff --git a/tools/RemoveUnlinked.pl b/tools/RemoveUnlinked.pl
deleted file mode 100755
index 2b642bf..0000000
--- a/tools/RemoveUnlinked.pl
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-# remove unlinked pages from a list of pages
-# also remove any matching certain keywords
-# input: page list, redirect list (from GetPages.pl)
-# and page links (from PageLinks.pl)
-
-my $pagelist = $ARGV[0];
-my $redirectlist = $ARGV[1];
-my $pagelinks = $ARGV[2];
-
-# remove pages starting with these keywords
-my @removepages = ("Wikipedia:","Ayuda:","Wikiproyecto:","MediaWiki:","Plantilla:","WP:","Portal:", "Categoría");
-
-my %pagecounts = ();
-open(PAGE,$pagelist) or die;
-while(<PAGE>) {
- chomp;
- $pagecounts{$_} = 0;
-}
-close(PAGE);
-
-my %redirects = ();
-open(REDIR,$redirectlist) or die;
-while (<REDIR>) {
- if (/\[\[(.*?)\]\]\s*\[\[(.*?)\]\]/) {
- $redirects{$1} = $2;
- } else {
- die "redirects line is weird:\n$_\n";
- }
-}
-close(REDIR);
-
-open(LINKS,$pagelinks);
-while (<LINKS>) {
- my @data = split;
- my $currpage = shift(@data);
- $currpage =~ s/_/ /g;
- unless (exists ($pagecounts{$currpage})) {
- next;
- }
- foreach my $link (@data) {
- $link =~ s/_/ /g;
- if (exists ($redirects{$link})) {
- if (exists ($pagecounts{$redirects{$link}})) {
- $pagecounts{$redirects{$link}}++;
- } else {
-#print "Weird: $link redirects to $redirects{$link}, but this one isn't on the pagelist?\n";
- }
- }
- if (exists $pagecounts{$link}) {
- $pagecounts{$link}++;
- } else {
-#print "$link does not exist on pagelist\n";
- }
- }
-}
-
-foreach my $page (keys %pagecounts) {
- my $good = 1;
- foreach my $remove (@removepages) {
- if ($page =~ /^$remove/) {
- $good = 0;
- }
- }
- if (($pagecounts{$page} >= 1) and $good) {
- print "$page\n";
- }
-}
diff --git a/tools/get_images.py b/tools/get_images.py
deleted file mode 100755
index 10a694c..0000000
--- a/tools/get_images.py
+++ /dev/null
@@ -1,260 +0,0 @@
-from __future__ import with_statement
-import re
-#import server
-import md5
-import urllib
-import collections
-import os
-import subprocess
-
-BASEWORD = r"Image"
-
-BASE_URL="http://upload.wikimedia.org/wikipedia/commons"
-
-def get_source_url(filename):
- return "%s/%s" % (BASE_URL, get_endpath(filename))
-
-def get_dirs(filename):
- m = md5.new()
- m.update(filename)
- h = m.hexdigest()
- return (h[0], h[:2])
-
-def get_endpath(filename):
- d = get_dirs(filename)
- p = "%s/%s/%s" % (d[0], d[1], filename)
- return p
-
-def canonicalize_filename(wikiname):
- wikiname = wikiname.replace(' ', '_')
- wikiname = wikiname[0].upper() + wikiname[1:]
- return wikiname
-
-class WorkaroundURLopener(urllib.FancyURLopener):
- version = "OLPC_wikislicer/0.1"
-
-urllib._urlopener = WorkaroundURLopener()
-
-def download_image(filename, base_dir):
- source = get_source_url(filename)
- dirs = get_dirs(filename)
- destdir = "%s/%s/%s" % (base_dir, dirs[0], dirs[1])
- try:
- os.makedirs(destdir)
- except:
- pass #This just means that destdir already exists
- dest = "%s/%s" % (destdir, filename)
- try:
- urllib.urlretrieve(source,dest)
- except:
- print "Failed to download " + source
- return False
- return dest
-
-def make_svg_wrapper(name, width, height):
- s = '<svg xmlns="http://www.w3.org/2000/svg" version="1.2" xmlns:xlink="http://www.w3.org/1999/xlink" width="%(width)i" height="%(height)i" viewbox="0 0 %(width)i %(height)i"><image xlink:href="%(name)s" width="100%%" height="100%%" x="0" y="0"/></svg>' % {'name':name, 'width':width, 'height':height }
- return s
-
-def get_dims(path):
- try:
- p = subprocess.Popen(['identify','-format','%wx%h',path],stdout=subprocess.PIPE)
- p.wait()
- s = p.stdout.read()
- l = s.split('x')
- return (int(l[0]), int(l[1]))
- except:
- print "Failed to get dims"
- return False
-
-def download_and_process(imgdict, base_dir, thumb_width):
- for wikiname in imgdict:
- filename = canonicalize_filename(wikiname)
- d = download_image(filename, base_dir)
- if d:
- width = None
- height= None
- for p in imgdict[wikiname]:
- if p.width is not None:
- width = max(width, p.width)
- elif p.thumbnail:
- width = max(width, thumb_width)
- if p.height is not None:
- height = max(height, p.height)
- process_image(filename, width, height)
-
-MAXWIDTH=800
-MAXHEIGHT=800
-def process_image(d, width=None, height=None):
- vector = d[-3:].upper() == 'SVG'
- if vector:
- try:
- jpg_name = d + '.jpg'
- rsvg_command = ['rsvg-convert','--keep-aspect-ratio','--format=png','--output', jpg_name]
- if width is not None:
- rsvg_command.append('--width=%i' % width)
- if height is not None:
- rsvg_command.append('--height=%i' %height)
- rsvg_command.append(d)
- subprocess.check_call(rsvg_command)
- #jpg_name file now contains a png image; we want jpg to save space
- subprocess.check_call(['convert', "PNG:%s" % jpg_name, "-quality", "20", "JPEG:%s" % jpg_name])
- (width, height) = get_dims(jpg_name)
-
- svg_factor = 0.3 #favorability of SVG
- print "Processing vector image " + d
- jpg_size = os.stat(jpg_name).st_size
- svg_size = svg_factor * os.stat(d).st_size
- if svg_size > jpg_size:
- print "Replacing svg by a raster wrapper"
- endname = jpg_name.split('/')[-1]
- s = make_svg_wrapper(endname, width, height)
- f = open(d,'w')
- f.write(s)
- f.truncate()
- f.close()
- return jpg_size + os.stat(d).st_size
- else:
- print "Preserving svg as vector"
- os.remove(jpg_name)
- return os.stat(d).st_size
- except:
- print "Error: convert failed on " + d
- try:
- os.remove(d)
- os.remove(jpg_name)
- except:
- print "Error: failed to remove " + d
- return 0
-
- else:
- print "Processing raster image " + d
- try:
- if width is None:
- width = MAXWIDTH
- if height is None:
- height = MAXHEIGHT
- newsize = "%ix%i>" % (width, height)
- subprocess.check_call(['convert', d,"-flatten", "-resize", newsize, "-quality", "20", "JPEG:%s" % d])
- print "Succesfully resized " + d
- return os.stat(d).st_size
- except:
- print "Error: convert failed on " + d
- try:
- os.remove(d)
- except:
- print "Error: failed to remove " + d
- return 0
-
-def process_imagelist(list_filename, base_dir, imgword, maxsize=float('inf')):
- with open(list_filename) as f:
- print "opened " + list_filename
- totalsize = 0 #bytes
- searcher = r"\[\[(?:%s|%s):(.+?)\]\]\s+(\d+)\s+(.*?)\s+(.*?)$" % (BASEWORD, imgword)
- print searcher
- for line in f.readlines():
- m = re.search(searcher, line)
- if m is None:
- print "WARNING: Match didn't work on " + line
- wikiname = m.group(1)
- hits = m.group(2)
- width = m.group(3)
- height = m.group(4)
- print wikiname, hits, width, height
-
- if width == 'None':
- width = None
- else:
- width = int(width)
-
- if height == 'None':
- height = None
- else:
- height = int(height)
-
- filename = canonicalize_filename(wikiname)
- d = download_image(filename, base_dir)
- if d:
- s = process_image(d, width, height)
- totalsize += s
- print d + " occupies " + str(s) + " bytes; running total is " + str(totalsize)
- if totalsize > maxsize:
- break
-
-class ImageProps:
- thumbnail = False
- width = None
- height = None
- upright = False
-
- def __repr__(self):
- return "%s (%s, %s) %s" % (self.thumbnail, self.width, self.height, self.upright)
-
-class ImageFinder:
- def __init__(self, image_word):
- self.word = image_word
- self.db = server.WPWikiDB()
-
- def find_images(self, text):
- L = []
-
- #pattern = r"\[\[(?:%s|%s):(?P<filename>[^\|\]]+)(?:\|(?P<type>thumb|thumbnail)|(?P<width>\d+)(?:x(?P<height>\d+))?px|(?P<upright>upright)|(?:[^\|\[\]]|\[[^\|\[\]]*\]|\[\[[^\|\[\]]*\]\])*)*\]\]" % (BASEWORD, self.word)
- #pattern = r"\[\[(?:%s|%s):(?P<filename>[^\|\]]+)(?P<options>(?:[^\[\]]|\[[^\[\]]*\]|\[\[[^\[\]]*\]\])*)\]\]" % (BASEWORD, self.word)
- pattern = r"\[\[(?:%s|%s):\s*(?P<filename>[^\|\]]+?)\s*(?:\|(?P<options>(?:[^\[\]]|\[[^\[\]]*\]|\[\[[^\[\]]*\]\])*))?\]\]" % (BASEWORD, self.word)
- for match in re.finditer(pattern, text):
- if match:
- #d = match.groupdict(None)
- f = match.group('filename')
- p = ImageProps()
- for s in match.group('options').split('|'):
- if s == 'thumb' or s == 'thumbnail':
- p.thumbnail = True
- elif s == 'upright':
- p.upright = False
- elif s[-2:] == 'px':
- dims = s[:-2].split('x')
- if len(dims) > 0:
- p.width = int(dims[0])
- if len(dims) > 1:
- p.height = int(dims[1])
- print (f,p)
- L.append((f,p))
- return L
-
- def get_images_info(self, title):
- text = self.db.getExpandedArticle(title)
- return self.find_images(text)
-
- def list_images(self, title):
- props = self.get_images_info(title)
- filenames = [t[0] for t in props]
- return filenames
-
- def get_metadata_all(self, titles):
- d = collections.defaultdict(list)
- for t in titles:
- L = self.get_images_info(t)
- for (fname, props) in L:
- d[fname].append(props)
- return d
-
-def read_links(index):
- f = open(index)
- text = f.read()
- f.close()
- titles = []
- for match in re.finditer('href\s*=\s*[\'\"]/wiki/([^\'\"]+)[\'\"]', text):
- if match:
- titles.append(match.group(1))
- return titles
-
-def main_task(db_path, indexfile, image_word, base_dir, thumb_width):
- titles = read_links(indexfile)
- print titles
- server.load_db(db_path)
- p = ImageFinder(image_word)
- m = p.get_metadata_all(titles)
- print m
- download_and_process(m, base_dir, thumb_width)
-
-#main_task("/home/olpc/40ormore.xml.bz2", "../static/index.html", "Imagen", "/home/olpc/images", 180)
-process_imagelist("top70k_images", "../es_PE/images", "Imagen", 23000000)
diff --git a/woip/AUTHORS b/woip/AUTHORS
deleted file mode 100644
index d5d7b5d..0000000
--- a/woip/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-Patrick Collison <patrick@collison.ie>
-
-Some code from bzip2 and the FreeBSD implementation of locate has been used; more details are provided in README
diff --git a/woip/COPYING b/woip/COPYING
deleted file mode 100644
index d511905..0000000
--- a/woip/COPYING
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/woip/README b/woip/README
deleted file mode 100644
index 4c80aac..0000000
--- a/woip/README
+++ /dev/null
@@ -1,61 +0,0 @@
-This is all one huge hack, with lots of debug code and hacks left in place.
-
-==Get started==
-
-cd c
-./configure
-make
-cd ..
-
-Get a Wikipedia XML dump (e.g. enwiki-20071018-pages-articles.xml.bz2), and
-place it in root (wp) directory.
-
-cd sh
-./process ../<dump>
-cd ..
-
-The processing stage will take several hours (8 on 2.16GHz MBP). (If someone
-wants to speed it up, implement xmlprocess.rb in C.) Once this is done, you
-can delete the original dump. If you get sick of waiting, use a dump of
-the Simple English Wikipedia, which is several orders of magnitude smaller
-than the standard English dumps.
-
-When done:
-
-To run curses-based livesearch:
-cd sh
-./livesearch ../<dump>
-
-To run webserver:
-cd rb
-ruby -r server.rb -e 'WPServer.start_on(9000)' -- ../<dump>
-
-(Note that even though the above commands use the filename of the original dump,
-they don't actually depend on the file; just the processed versions created by
-sh/process)
-
-==Directory layout==
-
-rb/
- bzipreader.rb (ruby interface to c/bzipreader.c; supports streaming bz2 files)
- index.rb (generate an article-to-block index using bzipreader.rb)
- server.rb (Mongrel-based server for using WP dumps with a web browser)
- xmlprocess.rb (generate stripped, XML-less file from a vanilla WP dump)
-
-c/
- bzipreader (locate, extract and decompress arbitrary blocks of bz2 files; sometimes
- quite useful for purposes unrelated to this project)
- lsearcher (use locate(1) search databases in interesting ways)
- searcher (search a ternary search tree built with indexer)
- indexer (generate a ternary search tree)
- livesearch (use a curses-based interface to browse Wikipedia dumps)
-
-sh/
- test (run outdated tests)
- process (take a vanilla Wikipedia dump and create all the necessary support files)
-
-app/
- the iPhone application itself
-
-c/bzipreader.c is based on bzip2recover.c, part of the bzip2 distribution.
-c/lsearcher.c is based on fastfind.c, part of the FreeBSD implementation of locate(1).
diff --git a/woip/app/ArticleView.h b/woip/app/ArticleView.h
deleted file mode 100644
index 87347a0..0000000
--- a/woip/app/ArticleView.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#import <UIKit/UIKit.h>
-#import "WebKitView.h"
-#import "WPParser.h"
-#import "../c/wp.h"
-
-@interface ArticleView : UIView {
- WebKitView *wkv;
-
- wp_dump *dump;
- wp_article *article;
-}
--(void) setPolicyDelegate: (id) obj;
--(void) updateHTML: (NSString *) str;
--(void) setDump: (wp_dump *) d;
--(void) setWikiApp: (id) w;
-@end
diff --git a/woip/app/ArticleView.m b/woip/app/ArticleView.m
deleted file mode 100644
index 44718bc..0000000
--- a/woip/app/ArticleView.m
+++ /dev/null
@@ -1,83 +0,0 @@
-#import "ArticleView.h"
-
-@implementation ArticleView
-- (id) initWithFrame: (struct CGRect) frame
-{
- self = [super initWithFrame:frame];
-
- wkv = [[WebKitView alloc] initWithFrame: frame]; //CGRectMake(0, 0, frame.size.width, frame.size.height)];
- [wkv setPolicyDelegate: self];
-
- article = xalloc(sizeof(wp_article));
- init_article(article);
-
- [self addSubview: wkv];
-
- return self;
-}
-
-- (BOOL)respondsToSelector:(SEL)aSelector
-{
- NSLog(@"AV Request for selector: %@", NSStringFromSelector(aSelector));
- return [super respondsToSelector:aSelector];
-}
-
-- (void)webView:(WebView *)sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id)listener
-{
- NSLog(@"request: %@", request);
- NSLog(@"url: %@", [actionInformation objectForKey: @"WebActionOriginalURLKey"]);
-
- NSString *WebActionElementKey = @"WebActionElementKey";
- id key;
-
- for (key in actionInformation) {
- NSLog(@"key: %@, value: %@", key, [actionInformation objectForKey:key]);
- }
-
- if([actionInformation objectForKey: WebActionElementKey] != nil) {
- NSLog(@"loading article with url %@", [request URL]);
- NSLog(@"url path: %@", [[actionInformation objectForKey: @"WebActionOriginalURLKey"] path]);
- NSString *title = [[[[actionInformation objectForKey: @"WebActionOriginalURLKey"] path] substringFromIndex: 1]
- stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
- [self loadArticle: title];
- [listener use];
- } else
- [listener use];
-
- NSLog(@"webView:decidePolicyForNavigationAction: %@", [request URL]);
- NSLog(@"listener: %@", listener);
-}
-
-- (void) updateHTML: (NSString *) str
-{
- [wkv loadString: str];
-}
-
--(void) setDump: (wp_dump *) d {
- dump = d;
-}
-
--(void) notFound: (NSString *) title {
- [self loadArticle: title withContents: [NSString stringWithFormat: @"The article <strong>%@</strong> doesn't exist in this Wikipedia dump.", title]];
-}
-
--(void) loadArticle: (NSString *) title {
- NSString *cap = [NSString stringWithFormat: @"%c%@", toupper([title characterAtIndex: 0]), [title substringFromIndex: 1]];
- NSLog(@"cap: %@", cap);
- if(load_article(dump, [cap UTF8String], article) != -1)
- [self loadArticle: cap withContents: [NSString stringWithUTF8String: article->text]];
- else
- [self notFound: title];
-}
-
--(void) loadArticle: (NSString *) title fromBlock: (int) block {
- block_load_article(dump, [title UTF8String], block, article);
- [self loadArticle: title withContents: [NSString stringWithUTF8String: article->text]];
-}
-
-- (void) loadArticle: (NSString *) title withContents: (NSString *) contents {
- WPParser *wp = [[WPParser alloc] initWithMarkup: contents];
- NSString *css = @"body { font-family: Helvetica; width: 310px; padding: 5px; margin: 0; word-wrap: break-word }";
- [self updateHTML: [NSString stringWithFormat: @"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><style>%@</style></head><body><h1>%@</h1>%@</body></html>", css, title, [wp parsed]]];
-}
-@end
diff --git a/woip/app/Makefile b/woip/app/Makefile
deleted file mode 100644
index f27cf69..0000000
--- a/woip/app/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-CC=arm-apple-darwin-gcc
-LD=$(CC)
-LDFLAGS=-lobjc -framework CoreFoundation -framework CoreGraphics -framework WebKit -framework Foundation -framework UIKit -framework LayerKit -lbz2
-CFLAGS=-I/usr/local/arm-apple-darwin/include -DWP_INCLUDE -DDEBUG -g
-SEARCHVIEW=SearchView.o
-
-all: WikiApp
-
-WikiApp: WikiApp.o $(SEARCHVIEW) WebKitView.o main.o ArticleView.o SearchResult.o SearchBar.o WPParser.o ReadStream.o ../c/wp.o ../c/bzipreader.o ../c/safe.o ../c/lsearcher.o ../c/blocks.o
- $(LD) $(LDFLAGS) -o $@ $^
-
-%.o: %.m
- $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
-
-%.do: %.m
- cat $< | ../rb/objcproc.rb > _debug_$< && $(CC) -c $(CFLAGS) $(CPPFLAGS) _debug_$< -o $@
-
-clean:
- rm -f *.o WikiApp
-
-install:
- scp WikiApp root@192.168.1.105:
- ssh root@192.168.1.105 ./WikiApp
diff --git a/woip/app/ReadStream.h b/woip/app/ReadStream.h
deleted file mode 100644
index 96f8fe2..0000000
--- a/woip/app/ReadStream.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#import <Foundation/Foundation.h>
-
-@interface ReadStream : NSObject {
- NSString *str;
- int pos;
-}
-
--(ReadStream *) initWithString: (NSString *) str;
--(unichar) peek;
--(unichar) peekTwo;
--(unichar) read;
--(unichar) expect: (unichar) c;
--(BOOL) isAtEnd;
--(NSString *) readUpto: (unichar) c;
-
-@end
diff --git a/woip/app/ReadStream.m b/woip/app/ReadStream.m
deleted file mode 100644
index a02cfb2..0000000
--- a/woip/app/ReadStream.m
+++ /dev/null
@@ -1,71 +0,0 @@
-#import "ReadStream.h"
-
-@implementation ReadStream
-
--(ReadStream *) initWithString: (NSString *) s {
- [self init];
- str = s;
- pos = 0;
- return self;
-}
-
--(unichar) safeCharAtIndex: (int) i {
- return [self isAtEnd] ? 0 : [str characterAtIndex: i];
-}
-
--(unichar) peekBack {
- return [self safeCharAtIndex: pos - 1];
-}
-
--(unichar) peek {
- return [self safeCharAtIndex: pos];
-}
-
--(unichar) peekTwo {
- return [self safeCharAtIndex: pos + 1];
-}
-
--(unichar) read {
- unichar c = [self safeCharAtIndex: pos];
- pos++;
- return c;
-}
-
--(BOOL) isAtEnd {
- return pos == [str length];
-}
-
--(unichar) expect: (unichar) c {
- unichar r;
- if((r = [self read]) != c) NSLog(@"WARNING: expected %c at position %d, found %c", c, pos - 1, r);
- return r;
-}
-
--(NSString *) readUpto: (unichar) c {
- int found = pos;
-
- while(found != [str length] && [self safeCharAtIndex: found++] != c);
- //if(found == [str length]) return NULL; // not found
-
- found--;
- NSString *s = [str substringWithRange: NSMakeRange(pos, found - pos)];
- pos = found;
-
- return s;
-}
-
-/*-(NSString *) readUptoString: (NSString *) s {
- NSRange range = [str rangeOfString: s options: 0 range: NSMakeRange(pos, [str length] - pos)];
- NSString *text;
-
- if(range.location != NSNotFound) {
- text = [str substringToIndex: range.location];
- pos = range.location;
- } else {
- text = [str substringFromIndex: pos];
- }
-
- return text;
-}*/
-
-@end
diff --git a/woip/app/SearchBar.h b/woip/app/SearchBar.h
deleted file mode 100644
index 5baf2c2..0000000
--- a/woip/app/SearchBar.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#import <UIKit/UIKit.h>
-#import <CoreGraphics/CGAffineTransform.h>
-
-@interface SearchBar : UISearchField {
- struct CGRect bounds;
-}
-
--(void) show;
--(void) hide;
-
-@end
diff --git a/woip/app/SearchBar.m b/woip/app/SearchBar.m
deleted file mode 100644
index 667d765..0000000
--- a/woip/app/SearchBar.m
+++ /dev/null
@@ -1,69 +0,0 @@
-#import "SearchBar.h"
-
-@implementation SearchBar
-
--(SearchBar *) initWithFrame: (struct CGRect) rect {
- self = [super initWithFrame: rect];
-
- bounds = rect;
-
- [self setTextFont: @"font-family: Helvetica; font-size: 14px; padding-top: 5px; padding-left: 4px;"];
- [self setAutoCapsType: 0];
- [self setPreferredKeyboardType: 0];
- [self setAutoCorrectionType: 1]; //disabled
- [self setOpaque: 0];
- [self setClearButtonStyle: 1];
- //[self setPlaceholder: @"Search"];
- [self setDelegate: self];
- [self becomeFirstResponder];
-
- return self;
-}
-
-- (void) show
-{
- [self setTransform: CGAffineTransformMake(1,0,0,1,0,0)];
- [self setFrame: CGRectMake(-bounds.size.width, bounds.origin.y, bounds.size.width, bounds.size.height)];
-
- struct CGAffineTransform trans = CGAffineTransformMakeTranslation(bounds.size.width + 10, 0);
- UITransformAnimation *translate = [[UITransformAnimation alloc] initWithTarget: self];
- [translate setStartTransform: CGAffineTransformMake(1,0,0,1,0,0)];
- [translate setEndTransform: trans];
-
- UIAlphaAnimation *fade = [[UIAlphaAnimation alloc] initWithTarget: self];
- [fade setEndAlpha: 1];
- [fade setStartAlpha: 0];
-
- UIAnimator *animator = [[UIAnimator alloc] init];
- [animator addAnimation: translate withDuration: .3 start: YES];
- [animator addAnimation: fade withDuration: .3 start: YES];
-
-}
-
-- (void) hide
-{
- struct CGRect rect = [UIHardware fullScreenApplicationContentRect];
- rect.origin.x = rect.origin.y = 0;
-
- [self setTransform: CGAffineTransformMake(1,0,0,1,0,0)];
- [self setFrame: CGRectMake(0, bounds.origin.y, bounds.size.width, bounds.size.height)];
-
- struct CGAffineTransform trans = CGAffineTransformMakeTranslation(-(bounds.size.width + 10), 0);
-
- UITransformAnimation *translate = [[UITransformAnimation alloc] initWithTarget: self];
-
- [translate setStartTransform: CGAffineTransformMake(1,0,0,1,0,0)];
- [translate setEndTransform: trans];
-
- UIAlphaAnimation *fade = [[UIAlphaAnimation alloc] initWithTarget: self];
- [fade setEndAlpha: 0];
- [fade setStartAlpha: 1];
-
- UIAnimator *animator = [[UIAnimator alloc] init];
- [animator addAnimation: translate withDuration: .3 start: YES];
- [animator addAnimation: fade withDuration: .3 start: YES];
-}
-
-
-@end
-
diff --git a/woip/app/SearchResult.h b/woip/app/SearchResult.h
deleted file mode 100644
index 2c8d53a..0000000
--- a/woip/app/SearchResult.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#import <UIKit/UIKit.h>
-
-@interface SearchResult : UITableCell
-{
- NSString *article;
-}
--(void) setArticle: (NSString *) title;
--(NSString *) article;
-@end
diff --git a/woip/app/SearchResult.m b/woip/app/SearchResult.m
deleted file mode 100644
index 848c365..0000000
--- a/woip/app/SearchResult.m
+++ /dev/null
@@ -1,13 +0,0 @@
-#import "SearchResult.h"
-
-@implementation SearchResult
-
--(void) setArticle: (NSString *) title {
- article = title;
-}
-
--(NSString *) article {
- return article;
-}
-
-@end
diff --git a/woip/app/SearchView.h b/woip/app/SearchView.h
deleted file mode 100644
index 1025f56..0000000
--- a/woip/app/SearchView.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#import <UIKit/UIKit.h>
-#import <UIKit/UICompletionTable.h>
-#import <UIKit/UIProgressBar.h>
-#import "WebKitView.h"
-#import "SearchResult.h"
-#import "ArticleView.h"
-#import "../c/wp.h"
-
-@interface SearchView : UIView {
- NSMutableArray *results;
- ArticleView *aview;
- UIKeyboard *kbrd;
- UIProgressBar *prog;
- id parent;
- UICompletionTable *table;
- NSString *needle;
- NSThread *sthread;
- NSTimer *updater;
- NSLock *lock;
- int curResults;
- bool needRefresh;
-
- int nsearch;
- char *curNeedle;
-
- wp_dump *dump;
- wp_article *article;
-}
-
--(void) setArticleView: (ArticleView *) aview;
--(void) setParent: (id) parent;
--(void) setNeedle: (NSString *) needle;
--(void) runSearch: (char *) needle;
--(void) refreshResults;
-@end
diff --git a/woip/app/SearchView.m b/woip/app/SearchView.m
deleted file mode 100644
index 9936136..0000000
--- a/woip/app/SearchView.m
+++ /dev/null
@@ -1,179 +0,0 @@
-#import "SearchView.h"
-#import "WikiApp.h"
-
-#define MAXRES 10
-
-int nresults = 0;
-uint32_t blocks[MAXRES];
-char *matches[MAXRES];
-char *buf;
-
-bool chandleResult(char *s) {
- NSLog(@"chandleResult: %s", s);
- buf = xalloc(MAXSTR * sizeof(char));
- strcpy(buf, s);
-
- NSLog(@"buf: 0x%x, %s", buf, buf);
-
- char *blockpos = strrchr(buf, ' ');
- int c;
-
- if(nresults >= MAXRES) return false;
-
- if(blockpos) {
- *(blockpos - 1) = '\0';
- blockpos++;
-
- blocks[nresults] = atoi(blockpos);
-
- matches[nresults] = buf;
- } else
- fatal("invalid: '%s'", buf);
-
- NSLog(@"chandleResult returning...");
- return ++nresults < MAXRES;
-}
-
-void zeroResults() {
- int i;
- for(i = 0; i < nresults; i++) free(matches[i]);
- nresults = 0;
-}
-int numResults() { return nresults; }
-char *resultAt(int i) { return matches[i]; }
-uint32_t blockAt(int i) { return blocks[i]; }
-
-@implementation SearchView
-
--(void) initMatches {
- int i;
- for(i = 0; i < MAXRES; i++)
- matches[i] = xalloc(MAXSTR * sizeof(char));
- buf = NULL;
-}
-
--(id) initWithFrame: (struct CGRect) frame
-{
- self = [super initWithFrame: frame];
-
- curNeedle = xalloc(MAXSTR * sizeof(char));
- [self initMatches];
- sthread = nil;
- lock = [[NSRecursiveLock alloc] init];
-
- struct CGRect rect = [UIHardware fullScreenApplicationContentRect];
- //TODO: re-enable me when I want progress bar
- //table = [[UICompletionTable alloc] initWithFrame: CGRectMake(0, 0, frame.size.width, frame.size.height - 240)];
- table = [[UICompletionTable alloc] initWithFrame: CGRectMake(0, 0, frame.size.width, frame.size.height - 215)];
-
- [table setDelegate: self];
-
- [self addSubview: table];
-
- prog = [[UIProgressBar alloc] initWithFrame: CGRectMake(0, 180, 320, 20)];
- [prog setStyle: 0];
- [prog setProgress: 1.0];
- //[self addSubview: prog];
- //TODO: re-enable above to get progress bar
-
- kbrd = [[UIKeyboard alloc] initWithFrame: CGRectMake(0, 200, 320, 480)];
- [self addSubview: kbrd];
-
- dump = xalloc(sizeof(wp_dump));
-
- load_dump(dump,
- "/var/root/wp/processed",
- "/var/root/wp/locate.db",
- "/var/root/wp/locate.prefixdb",
- "/var/root/wp/blocks.db");
-
- updater = [NSTimer scheduledTimerWithTimeInterval: 1
- target: self
- selector: @selector(refreshResults:)
- userInfo: nil
- repeats: YES];
-
- return self;
-}
-
--(void) stopSearch {
- NSLog(@"stopSearch");
- kill_search();
- while(sthread && [sthread isExecuting]) {
- //usleep(100000);
- //NSLog(@"waiting for sthread");
- }
-}
-
-
--(void) runSearch {
- NSLog(@"runSearch with needle: '%s'", curNeedle);
- NSAutoreleasePool* pool = [NSAutoreleasePool new];
- search(&dump->index, curNeedle, &chandleResult, NULL, true, true);
- needRefresh = true;
- NSLog(@"search done");
- [pool release];
-}
-
--(void) refreshResults: (NSTimer *) timer {
- NSLog(@"refreshResults");
- [lock lock];
- if(needRefresh || (sthread && [sthread isExecuting])) {
- [table reloadData];
- if(needRefresh) needRefresh = false;
- }
- double d;
- search_progress(&dump->index, &d);
- [prog setProgress: d];
- [prog updateIfNecessary];
- [lock unlock];
-}
-
--(void) updateResults {
- NSLog(@"Updating results for '%@'", needle);
- [self stopSearch];
- zeroResults();
- curResults = 0;
- needRefresh = false;
-
- /* TODO: keep the table results that match the new needle */
- [table reloadData];
- [prog setProgress: 0.0];
-
- strncpy(curNeedle, [[needle capitalizedString] UTF8String], MAXSTR);
-
- sthread = [[NSThread alloc] initWithTarget: self selector: @selector(runSearch) object: nil];
- [sthread start];
-}
-
--(int) numberOfCompletionsInTable:(UICompletionTable *) t {
- return numResults();
-}
-
--(UITableCell *) table:(UITable *)t completionAtIndex: (int) index {
- return [NSString stringWithUTF8String: resultAt(index)];
-}
-
--(void) table: (UICompletionTable *) t didSelectCompletionAtIndex: (int) i {
- [aview loadArticle: [NSString stringWithUTF8String: resultAt(i)] fromBlock: blockAt(i)];
- [parent switchToArticle];
-}
-
-- (void) setParent: (WikiApp *) w {
- parent = w;
-}
-
--(void) setNeedle: (NSString *) s {
- [lock lock];
- needle = s;
-
- if([s length] > 0 && [s characterAtIndex: 0] != ' ')
- [self updateResults];
- [lock unlock];
-}
-
-- (void) setArticleView: (ArticleView *) a {
- aview = a;
- [aview setDump: dump];
-}
-@end
diff --git a/woip/app/WPParser.h b/woip/app/WPParser.h
deleted file mode 100644
index 5e659e2..0000000
--- a/woip/app/WPParser.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#import <Foundation/Foundation.h>
-#import "ReadStream.h"
-
-@interface WPParser : NSObject {
- ReadStream *raw;
- NSMutableString *html;
- BOOL italic;
- BOOL bold;
- int tmplLevel;
-}
-
--(WPParser *) initWithMarkup: (NSString *) markup;
--(void) parse;
--(NSString *) parsed;
-
-@end
diff --git a/woip/app/WPParser.m b/woip/app/WPParser.m
deleted file mode 100644
index 848ac46..0000000
--- a/woip/app/WPParser.m
+++ /dev/null
@@ -1,113 +0,0 @@
-#import "WPParser.h"
-
-@implementation WPParser
-
--(WPParser *) initWithMarkup: (NSString *) markup {
- [self init];
- raw = [[ReadStream alloc] initWithString: markup];
- return self;
-}
-
--(void) parseLink {
- NSString *linkText, *linkHref, *text;
-
- [raw expect: '['];
- [raw expect: '['];
- text = [raw readUpto: ']'];
- [raw expect: ']'];
- [raw expect: ']'];
-
- NSRange range = [text rangeOfString: @"|"];
- if(range.location != NSNotFound) {
- linkText = [text substringFromIndex: range.location + 1];
- linkHref = [text substringToIndex: range.location];
- } else
- linkText = linkHref = text;
-
- [html appendFormat: @"<a href=\"wp://localhost/%@\">%@</a>", linkHref, linkText];
-}
-
--(void) parseHeading {
- NSString *text;
-
- int level = 0;
- while([raw peek] == '=') { [raw read]; level++; }
- text = [raw readUpto: '='];
- while([raw peek] == '=') [raw read];
-
- [html appendFormat: @"<h%d>%@</h%d>", level, text, level];
-}
-
--(void) parseItalic {
- if(italic) {
- italic = NO;
- [html appendString: @"</i>"];
- } else {
- italic = YES;
- [html appendString: @"<i>"];
- }
-}
-
--(void) parseBold {
- [raw expect: '\''];
-
- if(bold) {
- bold = NO;
- [html appendString: @"</b>"];
- } else {
- bold = YES;
- [html appendString: @"<b>"];
- }
-}
-
--(void) parseBoldItalic {
- [raw expect: '\''];
- [raw expect: '\''];
-
- if([raw peek] == '\'') [self parseBold];
- else [self parseItalic];
-}
-
--(void) parseTemplateStart {
- [raw expect: '{'];
- [raw expect: '{'];
- tmplLevel++;
-}
-
--(void) parseTemplateEnd {
- [raw expect: '}'];
- [raw expect: '}'];
- tmplLevel--;
-}
-
--(void) parse {
- while(![raw isAtEnd]) {
- unichar c = [raw peek];
-
- if(c == '{' && [raw peekTwo] == '{')
- [self parseTemplateStart];
- else if(c == '}' && [raw peekTwo] == '}')
- [self parseTemplateEnd];
- else if(tmplLevel > 0)
- [raw read];
- else if(c == '[' && [raw peekTwo] == '[')
- [self parseLink];
- else if ([raw peekBack] == '\n' && [raw peek] == '=')
- [self parseHeading];
- else if(c == '\'' && [raw peekTwo] == '\'')
- [self parseBoldItalic];
- else
- [html appendFormat: @"%c", [raw read]];
- }
-}
-
--(NSString *) parsed {
- html = [[NSMutableString alloc] init];
- bold = NO;
- italic = NO;
- tmplLevel = 0;
- [self parse];
- return html;
-}
-
-@end
diff --git a/woip/app/WebKitView.h b/woip/app/WebKitView.h
deleted file mode 100644
index d038578..0000000
--- a/woip/app/WebKitView.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#import <UIKit/UIKit.h>
-#import <UIKit/UIScroller.h>
-#import <UIKit/UIWebView.h>
-
-@interface WebKitView : UIScroller {
- UIWebView *webView;
- UIScroller *scroller;
-}
-
--(id)initWithFrame: (CGRect)frame;
--(void)loadURL: (NSURL *)url;
--(void)dealloc;
--(void)loadString: (NSString *)str;
-
-@end
diff --git a/woip/app/WebKitView.m b/woip/app/WebKitView.m
deleted file mode 100644
index d9730e3..0000000
--- a/woip/app/WebKitView.m
+++ /dev/null
@@ -1,77 +0,0 @@
-#import "WebKitView.h"
-#import <UIKit/UIView-Geometry.h>
-
-@implementation WebKitView
-
--(void)loadString: (NSString *)str
-{
- [webView loadHTMLString: str baseURL: [NSURL URLWithString: @"http://foo.com"]];
- [scroller setOffset: CGPointMake(0, 0)];
-}
-
--(void)loadURL: (NSURL *)url
-{
- NSURLRequest* urlRequest = [NSURLRequest requestWithURL: url];
- [webView loadRequest: urlRequest];
-}
-
--(void)dealloc
-{
- [webView release];
- [super dealloc];
-}
-
--(void)setPolicyDelegate: (id) obj {
- [[webView webView] setPolicyDelegate: obj];
-}
-
-- (BOOL)respondsToSelector:(SEL)aSelector
-{
- NSLog(@"WKV Request for selector: %@", NSStringFromSelector(aSelector));
- return [super respondsToSelector:aSelector];
-}
-
-/*-(void)view: (id)v didSetFrame:(CGRect)f
-{
- if( v == webView )
- [scroller setContentSize: CGSizeMake(f.size.width, f.size.height)];
-}*/
-
--(void)view:(id)v didDrawInRect:(CGRect)f duration:(float)d
-{
- if(v == webView)
- [scroller setContentSize: CGSizeMake(320, [webView bounds].size.height)];
-}
-
--(id)initWithFrame: (CGRect)frame
-{
- [super initWithFrame: frame];
-
- scroller = [[UIScroller alloc] initWithFrame: frame];
- [scroller setScrollingEnabled: YES];
- [scroller setAdjustForContentSizeChange: YES];
- [scroller setClipsSubviews: YES];
- [scroller setAllowsRubberBanding: YES];
- [scroller setDelegate: self];
-
-
- webView = [[UIWebView alloc] initWithFrame: frame]; //[scroller bounds]];
- [webView setAutoresizes: YES];
- [webView setDelegate: self];
- //[webView setFrame: frame];
- //[webView setAutoresizingMask: 2]; //don't reflow text... or something
- //[webView setSmoothsFonts: true];
- //[webView setClipsSubviews: YES];
- //[webView setEnabledGestures: YES];
- [webView setTilingEnabled: YES];
- [webView setTileSize: CGSizeMake(320.0f,1000.0f)];
- [scroller addSubview: webView];
- [self addSubview: scroller];
-
-
- return self;
-}
-
-@end
-
-
diff --git a/woip/app/WikiApp.h b/woip/app/WikiApp.h
deleted file mode 100644
index b776849..0000000
--- a/woip/app/WikiApp.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#import <UIKit/UIKit.h>
-#import "WebKitView.h"
-#import "ArticleView.h"
-#import "SearchView.h"
-#import "SearchResult.h"
-#import "SearchBar.h"
-
-#define SEARCH_VIEW 1
-#define ARTICLE_VIEW 2
-
-@interface WikiApp : UIApplication {
- WebKitView *wkv;
- UIWindow *window;
- UINavigationBar *navBar;
- SearchBar *tf;
- UIView *mainView;
- UITransitionView *contentView;
- ArticleView *aview;
- SearchView *sview;
- struct CGRect rect;
- int currentView;
- NSString *currentTitle;
-}
-@end
diff --git a/woip/app/WikiApp.m b/woip/app/WikiApp.m
deleted file mode 100644
index 6509d26..0000000
--- a/woip/app/WikiApp.m
+++ /dev/null
@@ -1,139 +0,0 @@
-#import <CoreFoundation/CoreFoundation.h>
-#import <Foundation/Foundation.h>
-#import <UIKit/CDStructures.h>
-#import <UIKit/UIPushButton.h>
-#import <UIKit/UIThreePartButton.h>
-#import <UIKit/UINavigationBar.h>
-#import <UIKit/UIWindow.h>
-#import <UIKit/UIView-Hierarchy.h>
-#import <UIKit/UIHardware.h>
-
-#import "WebKitView.h"
-#import "WikiApp.h"
-
-@implementation WikiApp
-
--(UINavigationBar *) createNavBar: (struct CGRect) rect {
- struct CGSize s = [UINavigationBar defaultSize];
- UINavigationBar *bar = [[UINavigationBar alloc]
- initWithFrame: CGRectMake(0, 0, s.width, s.height)];
- [bar setDelegate: self];
- [bar enableAnimation];
-
- return bar;
-}
-
--(void) updateNavBar {
- switch(currentView) {
- case ARTICLE_VIEW:
- [navBar showButtonsWithLeftTitle: @"Search" rightTitle: NULL leftBack: YES];
- break;
- case SEARCH_VIEW:
- [navBar showButtonsWithLeftTitle: NULL rightTitle: @"Article"];
- break;
- }
-}
-
--(void) switchToArticle {
- currentView = ARTICLE_VIEW;
- [self updateNavBar];
- [tf hide];
- [contentView transition: 1 toView: aview];
-}
-
--(void) switchToSearch {
- currentView = SEARCH_VIEW;
- [self updateNavBar];
- [contentView transition: 2 toView: sview];
- [tf show];
-}
-
--(void) navigationBar: (UINavigationBar *) bar buttonClicked: (int) button {
- NSLog(@"Button clicked: %d", button);
-
- switch(button) {
- case 0:
- [self switchToArticle];
- break;
- case 1:
- [self switchToSearch];
- break;
- }
-}
-
--(void) logText: (id) not {
- NSString *str = [[not object] text];
- NSLog(@"text changed: %@", not);
- NSLog(@"text is now '%@'", str);
-
- if(str != nil)
- [sview setNeedle: str];
-}
-
--(void) createSearchField {
- tf = [[SearchBar alloc] initWithFrame: (CGRectMake(5, 6, 240, 30))];
-
- [[NSNotificationCenter defaultCenter]
- addObserver: self
- selector: @selector(logText:)
- name: UITextFieldTextDidChangeNotification
- object: tf];
-
- [navBar addSubview: tf];
-}
-
--(void) createArticleView: (struct CGRect) r {
- aview = [[ArticleView alloc] initWithFrame: r];
-}
-
--(void) createSearchView: (struct CGRect) r {
- sview = [[SearchView alloc] initWithFrame: r];
- [sview setParent: self];
-}
-
--(void) setupUI {
- currentView = SEARCH_VIEW;
-
- rect = [UIHardware fullScreenApplicationContentRect];
- rect.origin.x = rect.origin.y = 0.0f;
-
- window = [[UIWindow alloc] initWithContentRect: [UIHardware fullScreenApplicationContentRect]];
-
- mainView = [[UITransitionView alloc] initWithFrame: rect];
-
- CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
- float bgColor[4] = {0.2, 0.2, 0.2, 1};
- CGColorRef bgRef = CGColorCreate(colorSpace, bgColor);
- [mainView setBackgroundColor: bgRef];
-
- navBar = [self createNavBar: rect];
- [mainView addSubview: navBar];
-
- struct CGSize s = [UINavigationBar defaultSize];
- struct CGRect r = CGRectMake(0, 0, rect.size.width, rect.size.height - s.height);
- contentView = [[UITransitionView alloc]
- initWithFrame: CGRectMake(0, s.height, rect.size.width, rect.size.height - s.height)];
- [mainView addSubview: contentView];
-
- [self createSearchField];
-
- [self updateNavBar];
- [window orderFront: self];
- [window makeKey: self];
- [window _setHidden: NO];
- [window setContentView: mainView];
-
- [self createSearchView: r];
- [self createArticleView: r];
- [sview setArticleView: aview];
- [contentView addSubview: sview];
-}
-
-- (void) applicationDidFinishLaunching: (id) unused
-{
- [self setupUI];
-
- [aview updateHTML: @"<html><body></body></html>"];
-}
-
-@end
diff --git a/woip/app/main.m b/woip/app/main.m
deleted file mode 100644
index 6a0862f..0000000
--- a/woip/app/main.m
+++ /dev/null
@@ -1,9 +0,0 @@
-#import <UIKit/UIKit.h>
-
-#import "WikiApp.h"
-
-int main(int argc, char **argv)
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- return UIApplicationMain(argc, argv, [WikiApp class]);
-}
diff --git a/woip/c/AUTHORS b/woip/c/AUTHORS
deleted file mode 100644
index e69de29..0000000
--- a/woip/c/AUTHORS
+++ /dev/null
diff --git a/woip/c/COPYING b/woip/c/COPYING
deleted file mode 100644
index e69de29..0000000
--- a/woip/c/COPYING
+++ /dev/null
diff --git a/woip/c/ChangeLog b/woip/c/ChangeLog
deleted file mode 100644
index e69de29..0000000
--- a/woip/c/ChangeLog
+++ /dev/null
diff --git a/woip/c/INSTALL b/woip/c/INSTALL
deleted file mode 100644
index e69de29..0000000
--- a/woip/c/INSTALL
+++ /dev/null
diff --git a/woip/c/Makefile.am b/woip/c/Makefile.am
deleted file mode 100644
index 9db8df7..0000000
--- a/woip/c/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-bin_PROGRAMS = searcher indexer livesearch bzipreader blocks lsearcher wp
-
-AM_CFLAGS = -g -Wall
-
-searcher_CFLAGS = -fpack-struct
-livesearch_CFLAGS = -DDEUG -DWP_INCLUDE
-indexer_CFLAGS = -fpack-struct
-bzipreader_CFLAGS = -DINCLUDE_MAIN
-blocks_CFLAGS = -DINCLUDE_MAIN
-lsearcher_CFLAGS = -DINCLUDE_MAIN -DDEBUG
-
-LDADD = safe.o
-
-bzipreader_LDADD = $(LDADD) -lbz2
-livesearch_LDADD = $(LDADD) -lncurses
-
-livesearch_SOURCES = lsearcher.c livesearch.c bzipreader.c blocks.c wp.c
-wp_SOURCES = lsearcher.c bzipreader.c blocks.c wp.c
-searcher_SOURCES = search.c searcher.c
-
-DISTCLEANFILES = AUTHORS README ChangeLog INSTALL NEWS COPYING Makefile.in \
- configure Makefile install-sh missing
-
-all:
- ln -sf livesearch reader
-
-distclean-local:
- -rm -rf *.dSYM *.log *.status *.cache
diff --git a/woip/c/Makefile.in b/woip/c/Makefile.in
deleted file mode 100644
index f730530..0000000
--- a/woip/c/Makefile.in
+++ /dev/null
@@ -1,782 +0,0 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-bin_PROGRAMS = searcher$(EXEEXT) indexer$(EXEEXT) livesearch$(EXEEXT) \
- bzipreader$(EXEEXT) blocks$(EXEEXT) lsearcher$(EXEEXT) \
- wp$(EXEEXT)
-subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \
- ChangeLog INSTALL NEWS compile depcomp install-sh missing
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(bin_PROGRAMS)
-blocks_SOURCES = blocks.c
-blocks_OBJECTS = blocks-blocks.$(OBJEXT)
-blocks_LDADD = $(LDADD)
-blocks_DEPENDENCIES = safe.o
-blocks_LINK = $(CCLD) $(blocks_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-bzipreader_SOURCES = bzipreader.c
-bzipreader_OBJECTS = bzipreader-bzipreader.$(OBJEXT)
-bzipreader_DEPENDENCIES = $(LDADD)
-bzipreader_LINK = $(CCLD) $(bzipreader_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-indexer_SOURCES = indexer.c
-indexer_OBJECTS = indexer-indexer.$(OBJEXT)
-indexer_LDADD = $(LDADD)
-indexer_DEPENDENCIES = safe.o
-indexer_LINK = $(CCLD) $(indexer_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-am_livesearch_OBJECTS = livesearch-lsearcher.$(OBJEXT) \
- livesearch-livesearch.$(OBJEXT) \
- livesearch-bzipreader.$(OBJEXT) livesearch-blocks.$(OBJEXT) \
- livesearch-wp.$(OBJEXT)
-livesearch_OBJECTS = $(am_livesearch_OBJECTS)
-livesearch_DEPENDENCIES = $(LDADD)
-livesearch_LINK = $(CCLD) $(livesearch_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-lsearcher_SOURCES = lsearcher.c
-lsearcher_OBJECTS = lsearcher-lsearcher.$(OBJEXT)
-lsearcher_LDADD = $(LDADD)
-lsearcher_DEPENDENCIES = safe.o
-lsearcher_LINK = $(CCLD) $(lsearcher_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-am_searcher_OBJECTS = searcher-search.$(OBJEXT) \
- searcher-searcher.$(OBJEXT)
-searcher_OBJECTS = $(am_searcher_OBJECTS)
-searcher_LDADD = $(LDADD)
-searcher_DEPENDENCIES = safe.o
-searcher_LINK = $(CCLD) $(searcher_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-am_wp_OBJECTS = lsearcher.$(OBJEXT) bzipreader.$(OBJEXT) \
- blocks.$(OBJEXT) wp.$(OBJEXT)
-wp_OBJECTS = $(am_wp_OBJECTS)
-wp_LDADD = $(LDADD)
-wp_DEPENDENCIES = safe.o
-DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = blocks.c bzipreader.c indexer.c $(livesearch_SOURCES) \
- lsearcher.c $(searcher_SOURCES) $(wp_SOURCES)
-DIST_SOURCES = blocks.c bzipreader.c indexer.c $(livesearch_SOURCES) \
- lsearcher.c $(searcher_SOURCES) $(wp_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- { test ! -d $(distdir) \
- || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -fr $(distdir); }; }
-DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
-distuninstallcheck_listfiles = find . -type f -print
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EXEEXT = @EXEEXT@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build_alias = @build_alias@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CFLAGS = -g -Wall
-searcher_CFLAGS = -fpack-struct
-livesearch_CFLAGS = -DDEUG -DWP_INCLUDE
-indexer_CFLAGS = -fpack-struct
-bzipreader_CFLAGS = -DINCLUDE_MAIN
-blocks_CFLAGS = -DINCLUDE_MAIN
-lsearcher_CFLAGS = -DINCLUDE_MAIN -DDEBUG
-LDADD = safe.o
-bzipreader_LDADD = $(LDADD) -lbz2
-livesearch_LDADD = $(LDADD) -lncurses
-livesearch_SOURCES = lsearcher.c livesearch.c bzipreader.c blocks.c wp.c
-wp_SOURCES = lsearcher.c bzipreader.c blocks.c wp.c
-searcher_SOURCES = search.c searcher.c
-DISTCLEANFILES = AUTHORS README ChangeLog INSTALL NEWS COPYING Makefile.in \
- configure Makefile install-sh missing
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-am--refresh:
- @:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
- cd $(srcdir) && $(AUTOMAKE) --gnu \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
-
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-blocks$(EXEEXT): $(blocks_OBJECTS) $(blocks_DEPENDENCIES)
- @rm -f blocks$(EXEEXT)
- $(blocks_LINK) $(blocks_OBJECTS) $(blocks_LDADD) $(LIBS)
-bzipreader$(EXEEXT): $(bzipreader_OBJECTS) $(bzipreader_DEPENDENCIES)
- @rm -f bzipreader$(EXEEXT)
- $(bzipreader_LINK) $(bzipreader_OBJECTS) $(bzipreader_LDADD) $(LIBS)
-indexer$(EXEEXT): $(indexer_OBJECTS) $(indexer_DEPENDENCIES)
- @rm -f indexer$(EXEEXT)
- $(indexer_LINK) $(indexer_OBJECTS) $(indexer_LDADD) $(LIBS)
-livesearch$(EXEEXT): $(livesearch_OBJECTS) $(livesearch_DEPENDENCIES)
- @rm -f livesearch$(EXEEXT)
- $(livesearch_LINK) $(livesearch_OBJECTS) $(livesearch_LDADD) $(LIBS)
-lsearcher$(EXEEXT): $(lsearcher_OBJECTS) $(lsearcher_DEPENDENCIES)
- @rm -f lsearcher$(EXEEXT)
- $(lsearcher_LINK) $(lsearcher_OBJECTS) $(lsearcher_LDADD) $(LIBS)
-searcher$(EXEEXT): $(searcher_OBJECTS) $(searcher_DEPENDENCIES)
- @rm -f searcher$(EXEEXT)
- $(searcher_LINK) $(searcher_OBJECTS) $(searcher_LDADD) $(LIBS)
-wp$(EXEEXT): $(wp_OBJECTS) $(wp_DEPENDENCIES)
- @rm -f wp$(EXEEXT)
- $(LINK) $(wp_OBJECTS) $(wp_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blocks-blocks.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blocks.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzipreader-bzipreader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzipreader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indexer-indexer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/livesearch-blocks.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/livesearch-bzipreader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/livesearch-livesearch.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/livesearch-lsearcher.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/livesearch-wp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsearcher-lsearcher.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsearcher.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/searcher-search.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/searcher-searcher.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wp.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-blocks-blocks.o: blocks.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(blocks_CFLAGS) $(CFLAGS) -MT blocks-blocks.o -MD -MP -MF $(DEPDIR)/blocks-blocks.Tpo -c -o blocks-blocks.o `test -f 'blocks.c' || echo '$(srcdir)/'`blocks.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/blocks-blocks.Tpo $(DEPDIR)/blocks-blocks.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='blocks.c' object='blocks-blocks.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(blocks_CFLAGS) $(CFLAGS) -c -o blocks-blocks.o `test -f 'blocks.c' || echo '$(srcdir)/'`blocks.c
-
-blocks-blocks.obj: blocks.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(blocks_CFLAGS) $(CFLAGS) -MT blocks-blocks.obj -MD -MP -MF $(DEPDIR)/blocks-blocks.Tpo -c -o blocks-blocks.obj `if test -f 'blocks.c'; then $(CYGPATH_W) 'blocks.c'; else $(CYGPATH_W) '$(srcdir)/blocks.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/blocks-blocks.Tpo $(DEPDIR)/blocks-blocks.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='blocks.c' object='blocks-blocks.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(blocks_CFLAGS) $(CFLAGS) -c -o blocks-blocks.obj `if test -f 'blocks.c'; then $(CYGPATH_W) 'blocks.c'; else $(CYGPATH_W) '$(srcdir)/blocks.c'; fi`
-
-bzipreader-bzipreader.o: bzipreader.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bzipreader_CFLAGS) $(CFLAGS) -MT bzipreader-bzipreader.o -MD -MP -MF $(DEPDIR)/bzipreader-bzipreader.Tpo -c -o bzipreader-bzipreader.o `test -f 'bzipreader.c' || echo '$(srcdir)/'`bzipreader.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/bzipreader-bzipreader.Tpo $(DEPDIR)/bzipreader-bzipreader.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bzipreader.c' object='bzipreader-bzipreader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bzipreader_CFLAGS) $(CFLAGS) -c -o bzipreader-bzipreader.o `test -f 'bzipreader.c' || echo '$(srcdir)/'`bzipreader.c
-
-bzipreader-bzipreader.obj: bzipreader.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bzipreader_CFLAGS) $(CFLAGS) -MT bzipreader-bzipreader.obj -MD -MP -MF $(DEPDIR)/bzipreader-bzipreader.Tpo -c -o bzipreader-bzipreader.obj `if test -f 'bzipreader.c'; then $(CYGPATH_W) 'bzipreader.c'; else $(CYGPATH_W) '$(srcdir)/bzipreader.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/bzipreader-bzipreader.Tpo $(DEPDIR)/bzipreader-bzipreader.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bzipreader.c' object='bzipreader-bzipreader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bzipreader_CFLAGS) $(CFLAGS) -c -o bzipreader-bzipreader.obj `if test -f 'bzipreader.c'; then $(CYGPATH_W) 'bzipreader.c'; else $(CYGPATH_W) '$(srcdir)/bzipreader.c'; fi`
-
-indexer-indexer.o: indexer.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indexer_CFLAGS) $(CFLAGS) -MT indexer-indexer.o -MD -MP -MF $(DEPDIR)/indexer-indexer.Tpo -c -o indexer-indexer.o `test -f 'indexer.c' || echo '$(srcdir)/'`indexer.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/indexer-indexer.Tpo $(DEPDIR)/indexer-indexer.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='indexer.c' object='indexer-indexer.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indexer_CFLAGS) $(CFLAGS) -c -o indexer-indexer.o `test -f 'indexer.c' || echo '$(srcdir)/'`indexer.c
-
-indexer-indexer.obj: indexer.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indexer_CFLAGS) $(CFLAGS) -MT indexer-indexer.obj -MD -MP -MF $(DEPDIR)/indexer-indexer.Tpo -c -o indexer-indexer.obj `if test -f 'indexer.c'; then $(CYGPATH_W) 'indexer.c'; else $(CYGPATH_W) '$(srcdir)/indexer.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/indexer-indexer.Tpo $(DEPDIR)/indexer-indexer.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='indexer.c' object='indexer-indexer.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indexer_CFLAGS) $(CFLAGS) -c -o indexer-indexer.obj `if test -f 'indexer.c'; then $(CYGPATH_W) 'indexer.c'; else $(CYGPATH_W) '$(srcdir)/indexer.c'; fi`
-
-livesearch-lsearcher.o: lsearcher.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -MT livesearch-lsearcher.o -MD -MP -MF $(DEPDIR)/livesearch-lsearcher.Tpo -c -o livesearch-lsearcher.o `test -f 'lsearcher.c' || echo '$(srcdir)/'`lsearcher.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/livesearch-lsearcher.Tpo $(DEPDIR)/livesearch-lsearcher.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lsearcher.c' object='livesearch-lsearcher.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -c -o livesearch-lsearcher.o `test -f 'lsearcher.c' || echo '$(srcdir)/'`lsearcher.c
-
-livesearch-lsearcher.obj: lsearcher.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -MT livesearch-lsearcher.obj -MD -MP -MF $(DEPDIR)/livesearch-lsearcher.Tpo -c -o livesearch-lsearcher.obj `if test -f 'lsearcher.c'; then $(CYGPATH_W) 'lsearcher.c'; else $(CYGPATH_W) '$(srcdir)/lsearcher.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/livesearch-lsearcher.Tpo $(DEPDIR)/livesearch-lsearcher.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lsearcher.c' object='livesearch-lsearcher.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -c -o livesearch-lsearcher.obj `if test -f 'lsearcher.c'; then $(CYGPATH_W) 'lsearcher.c'; else $(CYGPATH_W) '$(srcdir)/lsearcher.c'; fi`
-
-livesearch-livesearch.o: livesearch.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -MT livesearch-livesearch.o -MD -MP -MF $(DEPDIR)/livesearch-livesearch.Tpo -c -o livesearch-livesearch.o `test -f 'livesearch.c' || echo '$(srcdir)/'`livesearch.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/livesearch-livesearch.Tpo $(DEPDIR)/livesearch-livesearch.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='livesearch.c' object='livesearch-livesearch.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -c -o livesearch-livesearch.o `test -f 'livesearch.c' || echo '$(srcdir)/'`livesearch.c
-
-livesearch-livesearch.obj: livesearch.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -MT livesearch-livesearch.obj -MD -MP -MF $(DEPDIR)/livesearch-livesearch.Tpo -c -o livesearch-livesearch.obj `if test -f 'livesearch.c'; then $(CYGPATH_W) 'livesearch.c'; else $(CYGPATH_W) '$(srcdir)/livesearch.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/livesearch-livesearch.Tpo $(DEPDIR)/livesearch-livesearch.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='livesearch.c' object='livesearch-livesearch.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -c -o livesearch-livesearch.obj `if test -f 'livesearch.c'; then $(CYGPATH_W) 'livesearch.c'; else $(CYGPATH_W) '$(srcdir)/livesearch.c'; fi`
-
-livesearch-bzipreader.o: bzipreader.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -MT livesearch-bzipreader.o -MD -MP -MF $(DEPDIR)/livesearch-bzipreader.Tpo -c -o livesearch-bzipreader.o `test -f 'bzipreader.c' || echo '$(srcdir)/'`bzipreader.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/livesearch-bzipreader.Tpo $(DEPDIR)/livesearch-bzipreader.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bzipreader.c' object='livesearch-bzipreader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -c -o livesearch-bzipreader.o `test -f 'bzipreader.c' || echo '$(srcdir)/'`bzipreader.c
-
-livesearch-bzipreader.obj: bzipreader.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -MT livesearch-bzipreader.obj -MD -MP -MF $(DEPDIR)/livesearch-bzipreader.Tpo -c -o livesearch-bzipreader.obj `if test -f 'bzipreader.c'; then $(CYGPATH_W) 'bzipreader.c'; else $(CYGPATH_W) '$(srcdir)/bzipreader.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/livesearch-bzipreader.Tpo $(DEPDIR)/livesearch-bzipreader.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bzipreader.c' object='livesearch-bzipreader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -c -o livesearch-bzipreader.obj `if test -f 'bzipreader.c'; then $(CYGPATH_W) 'bzipreader.c'; else $(CYGPATH_W) '$(srcdir)/bzipreader.c'; fi`
-
-livesearch-blocks.o: blocks.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -MT livesearch-blocks.o -MD -MP -MF $(DEPDIR)/livesearch-blocks.Tpo -c -o livesearch-blocks.o `test -f 'blocks.c' || echo '$(srcdir)/'`blocks.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/livesearch-blocks.Tpo $(DEPDIR)/livesearch-blocks.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='blocks.c' object='livesearch-blocks.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -c -o livesearch-blocks.o `test -f 'blocks.c' || echo '$(srcdir)/'`blocks.c
-
-livesearch-blocks.obj: blocks.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -MT livesearch-blocks.obj -MD -MP -MF $(DEPDIR)/livesearch-blocks.Tpo -c -o livesearch-blocks.obj `if test -f 'blocks.c'; then $(CYGPATH_W) 'blocks.c'; else $(CYGPATH_W) '$(srcdir)/blocks.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/livesearch-blocks.Tpo $(DEPDIR)/livesearch-blocks.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='blocks.c' object='livesearch-blocks.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -c -o livesearch-blocks.obj `if test -f 'blocks.c'; then $(CYGPATH_W) 'blocks.c'; else $(CYGPATH_W) '$(srcdir)/blocks.c'; fi`
-
-livesearch-wp.o: wp.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -MT livesearch-wp.o -MD -MP -MF $(DEPDIR)/livesearch-wp.Tpo -c -o livesearch-wp.o `test -f 'wp.c' || echo '$(srcdir)/'`wp.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/livesearch-wp.Tpo $(DEPDIR)/livesearch-wp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wp.c' object='livesearch-wp.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -c -o livesearch-wp.o `test -f 'wp.c' || echo '$(srcdir)/'`wp.c
-
-livesearch-wp.obj: wp.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -MT livesearch-wp.obj -MD -MP -MF $(DEPDIR)/livesearch-wp.Tpo -c -o livesearch-wp.obj `if test -f 'wp.c'; then $(CYGPATH_W) 'wp.c'; else $(CYGPATH_W) '$(srcdir)/wp.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/livesearch-wp.Tpo $(DEPDIR)/livesearch-wp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wp.c' object='livesearch-wp.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(livesearch_CFLAGS) $(CFLAGS) -c -o livesearch-wp.obj `if test -f 'wp.c'; then $(CYGPATH_W) 'wp.c'; else $(CYGPATH_W) '$(srcdir)/wp.c'; fi`
-
-lsearcher-lsearcher.o: lsearcher.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lsearcher_CFLAGS) $(CFLAGS) -MT lsearcher-lsearcher.o -MD -MP -MF $(DEPDIR)/lsearcher-lsearcher.Tpo -c -o lsearcher-lsearcher.o `test -f 'lsearcher.c' || echo '$(srcdir)/'`lsearcher.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/lsearcher-lsearcher.Tpo $(DEPDIR)/lsearcher-lsearcher.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lsearcher.c' object='lsearcher-lsearcher.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lsearcher_CFLAGS) $(CFLAGS) -c -o lsearcher-lsearcher.o `test -f 'lsearcher.c' || echo '$(srcdir)/'`lsearcher.c
-
-lsearcher-lsearcher.obj: lsearcher.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lsearcher_CFLAGS) $(CFLAGS) -MT lsearcher-lsearcher.obj -MD -MP -MF $(DEPDIR)/lsearcher-lsearcher.Tpo -c -o lsearcher-lsearcher.obj `if test -f 'lsearcher.c'; then $(CYGPATH_W) 'lsearcher.c'; else $(CYGPATH_W) '$(srcdir)/lsearcher.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/lsearcher-lsearcher.Tpo $(DEPDIR)/lsearcher-lsearcher.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lsearcher.c' object='lsearcher-lsearcher.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lsearcher_CFLAGS) $(CFLAGS) -c -o lsearcher-lsearcher.obj `if test -f 'lsearcher.c'; then $(CYGPATH_W) 'lsearcher.c'; else $(CYGPATH_W) '$(srcdir)/lsearcher.c'; fi`
-
-searcher-search.o: search.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(searcher_CFLAGS) $(CFLAGS) -MT searcher-search.o -MD -MP -MF $(DEPDIR)/searcher-search.Tpo -c -o searcher-search.o `test -f 'search.c' || echo '$(srcdir)/'`search.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/searcher-search.Tpo $(DEPDIR)/searcher-search.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='search.c' object='searcher-search.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(searcher_CFLAGS) $(CFLAGS) -c -o searcher-search.o `test -f 'search.c' || echo '$(srcdir)/'`search.c
-
-searcher-search.obj: search.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(searcher_CFLAGS) $(CFLAGS) -MT searcher-search.obj -MD -MP -MF $(DEPDIR)/searcher-search.Tpo -c -o searcher-search.obj `if test -f 'search.c'; then $(CYGPATH_W) 'search.c'; else $(CYGPATH_W) '$(srcdir)/search.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/searcher-search.Tpo $(DEPDIR)/searcher-search.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='search.c' object='searcher-search.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(searcher_CFLAGS) $(CFLAGS) -c -o searcher-search.obj `if test -f 'search.c'; then $(CYGPATH_W) 'search.c'; else $(CYGPATH_W) '$(srcdir)/search.c'; fi`
-
-searcher-searcher.o: searcher.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(searcher_CFLAGS) $(CFLAGS) -MT searcher-searcher.o -MD -MP -MF $(DEPDIR)/searcher-searcher.Tpo -c -o searcher-searcher.o `test -f 'searcher.c' || echo '$(srcdir)/'`searcher.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/searcher-searcher.Tpo $(DEPDIR)/searcher-searcher.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='searcher.c' object='searcher-searcher.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(searcher_CFLAGS) $(CFLAGS) -c -o searcher-searcher.o `test -f 'searcher.c' || echo '$(srcdir)/'`searcher.c
-
-searcher-searcher.obj: searcher.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(searcher_CFLAGS) $(CFLAGS) -MT searcher-searcher.obj -MD -MP -MF $(DEPDIR)/searcher-searcher.Tpo -c -o searcher-searcher.obj `if test -f 'searcher.c'; then $(CYGPATH_W) 'searcher.c'; else $(CYGPATH_W) '$(srcdir)/searcher.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/searcher-searcher.Tpo $(DEPDIR)/searcher-searcher.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='searcher.c' object='searcher-searcher.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(searcher_CFLAGS) $(CFLAGS) -c -o searcher-searcher.obj `if test -f 'searcher.c'; then $(CYGPATH_W) 'searcher.c'; else $(CYGPATH_W) '$(srcdir)/searcher.c'; fi`
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- $(am__remove_distdir)
- test -d $(distdir) || mkdir $(distdir)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r $(distdir)
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
- $(am__remove_distdir)
-
-dist-lzma: distdir
- tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
- $(am__remove_distdir)
-
-dist-tarZ: distdir
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__remove_distdir)
-
-dist-shar: distdir
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__remove_distdir)
-
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__remove_distdir)
-
-dist dist-all: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lzma*) \
- unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir); chmod a+w $(distdir)
- mkdir $(distdir)/_build
- mkdir $(distdir)/_inst
- chmod a-w $(distdir)
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && cd $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
- $(am__remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
-distuninstallcheck:
- @cd $(distuninstallcheck_dir) \
- && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
- for dir in "$(DESTDIR)$(bindir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
-
-distclean: distclean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-local distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-info: install-info-am
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-ps: install-ps-am
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
- clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
- dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \
- distclean distclean-compile distclean-generic distclean-local \
- distclean-tags distcleancheck distdir distuninstallcheck dvi \
- dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-binPROGRAMS
-
-
-all:
- ln -sf livesearch reader
-
-distclean-local:
- -rm -rf *.dSYM *.log *.status *.cache
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/woip/c/NEWS b/woip/c/NEWS
deleted file mode 100644
index e69de29..0000000
--- a/woip/c/NEWS
+++ /dev/null
diff --git a/woip/c/README b/woip/c/README
deleted file mode 100644
index e69de29..0000000
--- a/woip/c/README
+++ /dev/null
diff --git a/woip/c/aclocal.m4 b/woip/c/aclocal.m4
deleted file mode 100644
index ce87080..0000000
--- a/woip/c/aclocal.m4
+++ /dev/null
@@ -1,902 +0,0 @@
-# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(AC_AUTOCONF_VERSION, [2.61],,
-[m4_warning([this file was generated for autoconf 2.61.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.10'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.10.1], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10.1])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 8
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 9
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-#serial 3
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 13
-
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.60])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
-])
-])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_PROG_CC_C_O
-# --------------
-# Like AC_PROG_CC_C_O, but changed for automake.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC_C_O])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-dnl Make sure AC_PROG_CC is never called again, or it will override our
-dnl setting of CC.
-m4_define([AC_PROG_CC],
- [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
- [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
diff --git a/woip/c/blocks.c b/woip/c/blocks.c
deleted file mode 100644
index 6ac2cf7..0000000
--- a/woip/c/blocks.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/mman.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include "debug.h"
-#include "safe.h"
-
-#define MAXLINE 1024
-#define MAXBLOCK 10000
-
-uint64_t store[MAXBLOCK];
-
-uint64_t *load_block_map(char *file) {
- int nblocks;
- void *ptr;
- FILE *fp = xfopen(file, "r");
-
- fread(&nblocks, sizeof(nblocks), 1, fp);
- ptr = xmmap(NULL, nblocks * sizeof(uint64_t), PROT_READ, MAP_SHARED, fileno(fp), 0);
-
- return ptr + sizeof(nblocks);
-}
-
-#ifdef INCLUDE_MAIN
-int main(int argc, char **argv) {
- char line[MAXLINE];
- int pos = 0;
-
- while(fgets(line, MAXLINE, stdin))
- store[pos++] = (uint64_t) strtoll(line, NULL, 10);
-
- FILE *bFile = xfopen(argv[1], "w");
-
- fwrite(&pos, sizeof(pos), 1, bFile);
- fwrite(store, sizeof(uint64_t), pos, bFile);
- fclose(bFile);
-
- return 0;
-}
-#endif
diff --git a/woip/c/bootstrap.sh b/woip/c/bootstrap.sh
deleted file mode 100755
index b8d8e5a..0000000
--- a/woip/c/bootstrap.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-touch AUTHORS NEWS README INSTALL ChangeLog COPYING
-aclocal
-automake --add-missing
-autoconf
diff --git a/woip/c/bzipreader.c b/woip/c/bzipreader.c
deleted file mode 100644
index ea468de..0000000
--- a/woip/c/bzipreader.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- Do stuff to bzip2 files. Originally based on bzip2recover, which
- is part of the standard bzip2 distribution.
- Author: Patrick Collison <patrick@collison.ie>
- Original author: Julian Seward <jseward@bzip.org>
-*/
-
-#include "bzipreader.h"
-
-#define MIN(x, y) (((x) < (y)) ? (x) : (y))
-
-uint64_t bStart [BZ_MAX_HANDLED_BLOCKS];
-uint64_t bEnd [BZ_MAX_HANDLED_BLOCKS];
-uint64_t rbStart[BZ_MAX_HANDLED_BLOCKS];
-uint64_t rbEnd [BZ_MAX_HANDLED_BLOCKS];
-
-uint64_t bytesOut = 0;
-uint64_t bytesIn = 0;
-
-void tooManyBlocks(int32_t max_handled_blocks)
-{
- fatal("File appears to contain more than %d blocks, and cannot be handled.\n"
- "To fix, increase BZ_MAX_HANDLED_BLOCKS in %s, and recompile.",
- max_handled_blocks, __FILE__);
-}
-
-void bbputc(int32_t c, BitBuffer *bb) {
- bb->buff[(bb->pos)++] = c;
-}
-
-BitBuffer *bbOfSize(uint64_t size) {
- BitBuffer *bb = xalloc(sizeof(BitBuffer));
- bb->buff = xalloc(size);
- bb->buffer = 0;
- bb->buffLive = 0;
- bb->pos = 0;
- return bb;
-}
-
-BitStream *bsOpenReadStream(FILE *stream)
-{
- BitStream *bs = xalloc(sizeof(BitStream));
- bs->handle = stream;
- bs->buffer = 0;
- bs->buffLive = 0;
- bs->mode = 'r';
- return bs;
-}
-
-BitStream *bsOpenWriteStream(FILE *stream)
-{
- BitStream *bs = xalloc(sizeof(BitStream));
- bs->handle = stream;
- bs->buffer = 0;
- bs->buffLive = 0;
- bs->mode = 'w';
- return bs;
-}
-
-void bbPutBit(BitBuffer *bb, int32_t bit)
-{
- if(bb->buffLive == 8) {
- bbputc((uchar_t) bb->buffer, bb);
- bytesOut++;
- bb->buffLive = 1;
- bb->buffer = bit & 0x1;
- } else {
- bb->buffer = ((bb->buffer << 1) | (bit & 0x1));
- bb->buffLive++;
- };
-}
-
-void bsPutBit(BitStream *bs, int32_t bit)
-{
- if(bs->buffLive == 8) {
- xputc((uchar_t) bs->buffer, bs->handle);
- bytesOut++;
- bs->buffLive = 1;
- bs->buffer = bit & 0x1;
- } else {
- bs->buffer = ((bs->buffer << 1) |(bit & 0x1));
- bs->buffLive++;
- };
-}
-
-
-/* Returns 0 or 1, or 2 to indicate EOF. */
-int32_t bsGetBit(BitStream *bs)
-{
- if(bs->buffLive > 0) {
- bs->buffLive --;
- return (((bs->buffer) >> (bs->buffLive)) & 0x1);
- } else {
- int32_t retVal = xgetc(bs->handle);
- if(retVal == EOF) return BIT_EOF;
- bs->buffLive = 7;
- bs->buffer = retVal;
- return (((bs->buffer) >> 7) & 0x1);
- }
-}
-
-void bsClose(BitStream *bs)
-{
- if(bs->mode == 'w') {
- while(bs->buffLive < 8) {
- bs->buffLive++;
- bs->buffer <<= 1;
- };
- xputc((uchar_t)(bs->buffer), bs->handle);
- bytesOut++;
- xfflush(bs->handle);
- }
- xfclose(bs->handle);
- free(bs);
-}
-
-void bbClose(BitBuffer *bb)
-{
- free(bb->buff);
- free(bb);
-}
-
-void bbPutUchar(BitBuffer *bb, uchar_t c) {
- int32_t i;
- for(i = 7; i >= 0; i--)
- bbPutBit(bb, (((uint32_t) c) >> i) & 0x1);
-}
-
-void bbPutUint(BitBuffer *bb, uint32_t c)
-{
- debug("writing %d as CRC", c);
- int32_t i;
- for(i = 31; i >= 0; i--)
- bbPutBit(bb, (c >> i) & 0x1);
-}
-
-int computeBoundariesUpto(FILE *inFile, int32_t upto) {
- debug("starting");
- BitStream *bsIn;
- int32_t b, currBlock, rbCtr;
- uint64_t bitsRead, lastBitsRead;
-
- uint32_t buffHi, buffLo;
-
- debug("searching for block boundaries...");
-
- bitsRead = 0;
- lastBitsRead = 0;
- buffHi = buffLo = 0;
- currBlock = 0;
- bStart[currBlock] = 0;
-
- bsIn = bsOpenReadStream(inFile);
-
- rbCtr = 0;
-
- while(true) {
- b = bsGetBit(bsIn);
- bitsRead++;
-
- if(b == BIT_EOF) {
- if(bitsRead >= bStart[currBlock] && (bitsRead - bStart[currBlock]) >= 40) {
- fatal("Corrupted file"); /* I'm not actually certain that this is necessarily the case */
- } else
- currBlock--;
-
- break;
- }
-
- buffHi = (buffHi << 1) | (buffLo >> 31);
- buffLo = (buffLo << 1) | (b & 1);
-
- if (((buffHi & 0x0000ffff) == BLOCK_HEADER_HI && buffLo == BLOCK_HEADER_LO)
- /* beginning of a block */
- ||
- ((buffHi & 0x0000ffff) == BLOCK_ENDMARK_HI && buffLo == BLOCK_ENDMARK_LO)) {
- /* eof */
-
- if(bitsRead > 49) {
- bEnd[currBlock] = bitsRead - 49;
- } else {
- bEnd[currBlock] = 0;
- }
-
- if(currBlock > 0 && (bEnd[currBlock] - bStart[currBlock]) >= 130) {
- // "%llu (0x%llx) to %llu (0x%llx). Size: %llu\n",
- debug("block %d:\n" /* block num */
- " [%llu (%llu)\n" /* bit offset of block start (bytes) */
- " %llu\n" /* bit offset of data of block start */
- " %llu\n" /* bit offset of data of block end */
- " %llu (%llu)]\n" /* bit offset of block end (bytes) */
- " D size: %llu (%llu)\n" /* data size (bytes) */
- " B size: %llu (%llu)", /* block size (bytes) */
- rbCtr+1,
- lastBitsRead, bytes(lastBitsRead),
- bStart[currBlock],
- bEnd[currBlock],
- bitsRead, bytes(bitsRead),
- bEnd[currBlock] - bStart[currBlock],
- bytes(bEnd[currBlock] - bStart[currBlock]),
- bitsRead - lastBitsRead,
- bytes(bitsRead - lastBitsRead));
- rbStart[rbCtr] = bStart[currBlock];
- rbEnd[rbCtr] = bEnd[currBlock];
- lastBitsRead = bitsRead;
- rbCtr++;
- }
-
- if(upto >= 0 && currBlock > upto)
- return rbCtr;
-
- if(currBlock >= BZ_MAX_HANDLED_BLOCKS)
- tooManyBlocks(BZ_MAX_HANDLED_BLOCKS);
-
- currBlock++;
-
- bStart[currBlock] = bitsRead;
- }
- }
-
- bsClose(bsIn);
-
- if(rbCtr < 1)
- fatal("sorry, I couldn't find any block boundaries");
-
- return rbCtr;
-}
-
-int computeBoundaries(FILE *inFile)
-{
- return computeBoundariesUpto(inFile, -1);
-}
-
-uint64_t fixedOffset(uint64_t offset) {
- return offset > 0 ? offset - 80 : 0;
-}
-
-void printBoundaries(int32_t numBlocks)
-{
- int32_t i;
- for(i = 0; i < numBlocks; i++)
- printf("%d %llu\n", i, fixedOffset(rbStart[i]));
-}
-
-uint64_t readBlock(FILE *inFile, uint64_t bitOffset, BitBuffer *bbOut)
-{
- BitStream *bsIn;
- int32_t b, wrBlock, subByteOffset;
- uint64_t bitsRead, i, headerEnd;
- uint32_t buffHi, buffLo;
-
- bsIn = bsOpenReadStream(inFile);
-
- debug("Seeking to %llu", bytes(bitOffset));
- fseeko(bsIn->handle, bytes(bitOffset), SEEK_SET);
-
- subByteOffset = bitOffset & 7;
- debug("subByteOffset: %d", subByteOffset);
- for(i = 0; i < subByteOffset; i++)
- bsGetBit(bsIn);
-
- bitsRead = 0;
- wrBlock = 0;
- bool inBlock = false;
-
- bbPutUchar(bbOut, BZ_HDR_B);
- bbPutUchar(bbOut, BZ_HDR_Z);
- bbPutUchar(bbOut, BZ_HDR_h);
- bbPutUchar(bbOut, BZ_HDR_0 + 9);
- bbPutUchar(bbOut, 0x31); bbPutUchar(bbOut, 0x41);
- bbPutUchar(bbOut, 0x59); bbPutUchar(bbOut, 0x26);
- bbPutUchar(bbOut, 0x53); bbPutUchar(bbOut, 0x59);
-
- while(true) {
- b = bsGetBit(bsIn);
- bitsRead++;
-
- if(b == BIT_EOF)
- fatal("EOF encountered after %llu/%llu", bitsRead, bytes(bitsRead));
-
- buffHi = (buffHi << 1) | (buffLo >> 31);
- buffLo = (buffLo << 1) | (b & 1);
-
- if(bitsRead == headerEnd + 48) {
- bbOut->crc = (buffHi << 16) | (buffLo >> 16);
- debug("CRC: %d (at pos %llu/%llu)", bbOut->crc, bbOut->pos, bitsRead);
- }
-
- if(inBlock)
- bbPutBit(bbOut, b);
-
- if (((buffHi & 0x0000ffff) == BLOCK_HEADER_HI && buffLo == BLOCK_HEADER_LO)
- ||
- ((buffHi & 0x0000ffff) == BLOCK_ENDMARK_HI && buffLo == BLOCK_ENDMARK_LO)) {
- if(!inBlock) {
- debug("After %llu bits read, starting block", bitsRead);
- headerEnd = bitsRead;
- inBlock = true;
- } else {
- debug("buffLive: %d", bbOut->buffLive);
- bbOut->pos -= 6; /* we just read the header for the next block -- discard */
-
- /* Take account of byte boundaries -- get us back to state before we read header */
- bbOut->buffer = bbOut->buff[bbOut->pos] >> (8 - bbOut->buffLive);
-
- debug("Finishing block after %llu bits; writing to %llu; buffer: %d; live: %d",
- bitsRead, bbOut->pos, bbOut->buffer, bbOut->buffLive);
- bbPutUchar(bbOut, 0x17); bbPutUchar(bbOut, 0x72);
- bbPutUchar(bbOut, 0x45); bbPutUchar(bbOut, 0x38);
- bbPutUchar(bbOut, 0x50); bbPutUchar(bbOut, 0x90);
- bbPutUint(bbOut, bbOut->crc); bbPutUchar(bbOut, 0x10);
-
- return bitsRead + bitOffset;
- }
- }
- }
-}
-
-int decompressBlock(char *src, uint32_t srcLen, char *result, uint32_t *destLen) {
- return BZ2_bzBuffToBuffDecompress(
- result,
- destLen,
- src,
- srcLen,
- 0,
- debug ? 4 : 0);
-}
-
-#ifdef INCLUDE_MAIN
-void usage(char **argv) {
- fprintf(stderr, "%s -f <file> [-l] [-b <bitoffset>] [-n <blocknumber>] [-d] [-x [-t <truncate>]]\n\n"
- " If -b is supplied, data that can be passed to the\n"
- " ordinary bzip2 utility will be written to stdout.\n\n"
- " If -l is supplied, the bit offsets for the file's\n"
- " blocks will be written to stdout.\n",
- argv[0]);
- exit(1);
-}
-
-int32_t main(int32_t argc, char **argv)
-{
- BitBuffer *bb;
- int ch, whichBlock, truncate;
- uint64_t offset, end;
- bool listBlocks;
- bool useWhichBlock;
- bool doDecompress;
- char inFileName[BZ_MAX_FILENAME];
-
- whichBlock = -1;
- truncate = 0;
- useWhichBlock = false;
- listBlocks = false;
- doDecompress = false;
- inFileName[0] = 0;
-
- while ((ch = getopt(argc, argv, "dhxlb:f:n:t:")) != -1) {
- switch (ch) {
- case 'b':
- offset = strtoll(optarg, NULL, 10);
- break;
- case 'd':
- debug = true;
- break;
- case 'f':
- strcpy(inFileName, optarg);
- break;
- case 'l':
- listBlocks = true;
- break;
- case 'n':
- useWhichBlock = true;
- whichBlock = strtol(optarg, NULL, 10);
- break;
- case 't':
- truncate = strtol(optarg, NULL, 10);
- break;
- case 'x':
- doDecompress = true;
- break;
- case 'h':
- default:
- usage(argv);
- }
- }
-
- if(debug)
- debug("Debug enabled");
-
- if(strlen(inFileName) == 0)
- usage(argv);
-
- if(strlen(inFileName) >= BZ_MAX_FILENAME-20)
- fatal("Supplied filename is suspiciously (>= %zu chars) long", strlen(inFileName));
-
- if(listBlocks) {
- printBoundaries(computeBoundaries(xfopen(inFileName, "rb")));
- } else {
- if(useWhichBlock) {
- int max;
- fprintf(stderr, "WARNING: Using -n can be slow; must scan file up desired block\n");
- max = computeBoundariesUpto(xfopen(inFileName, "rb"), whichBlock);
-
- if(whichBlock > max)
- fatal("Invalid block specifier: %d", whichBlock);
-
- offset = fixedOffset(rbStart[whichBlock]);
- }
-
- bb = bbOfSize(BZ_MAX_BLOCK);
- end = readBlock(xfopen(inFileName, "r"), offset, bb);
- debug("Res size: %llu; read %llu bits", bb->pos, end);
-
- if(doDecompress) {
- int res;
- char result_buf[BZ_MAX_BLOCK];
- uint32_t destLen = BZ_MAX_BLOCK;
- debug("decompressing %llu bytes", bb->pos);
- if((res = decompressBlock(bb->buff, bb->pos, result_buf, &destLen)) != BZ_OK) {
- debug("bb->buff: 0x%x; bb->pos: %llu; destLen: %d", bb->buff, bb->pos, destLen);
- fatal("error decompressing block: %d", res);
- }
-
- debug("res: %d; destLen: %u", res, destLen);
-
- if(truncate > 0)
- fwrite(result_buf, 1, MIN(destLen, truncate), stdout);
- else
- fwrite(result_buf, 1, destLen, stdout);
-
- } else
- fwrite(bb->buff, 1, bb->pos, stdout);
- }
-
- debug("finished");
- return 0;
-}
-#endif
diff --git a/woip/c/bzipreader.h b/woip/c/bzipreader.h
deleted file mode 100644
index 0477b68..0000000
--- a/woip/c/bzipreader.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Do stuff to bzip2 files. Originally based on bzip2recover, which
- is part of the standard bzip2 distribution.
- Author: Patrick Collison <patrick@collison.ie>
- Original author: Julian Seward <jseward@bzip.org>
-*/
-
-/* Caveat: I've a feeling this won't work unmodified on big-endian architectures */
-
-#ifndef __BZIPREADER_H__
-#define __BZIPREADER_H__
-
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <bzlib.h>
-#include "debug.h"
-#include "safe.h"
-
-#define bytes(x) ((x) >> 3)
-
-#define BLOCK_HEADER_HI 0x00003141UL
-#define BLOCK_HEADER_LO 0x59265359UL
-
-#define BLOCK_ENDMARK_HI 0x00001772UL
-#define BLOCK_ENDMARK_LO 0x45385090UL
-
-#define BIT_EOF 2
-
-/* Increase if necessary. However, a .bz2 file with > 50000 blocks
- would have an uncompressed size of at least 40GB, so the chances
- are low you'll need to up this. */
-#define BZ_MAX_HANDLED_BLOCKS 500000
-
-/* 900kb */
-/* FIXME */
-#define BZ_MAX_BLOCK (1100 * 1024)
-
-#define BZ_MAX_FILENAME 2000
-
-/* Header bytes */
-
-#define BZ_HDR_B 0x42 /* 'B' */
-#define BZ_HDR_Z 0x5a /* 'Z' */
-#define BZ_HDR_h 0x68 /* 'h' */
-#define BZ_HDR_0 0x30 /* '0' */
-
-typedef struct {
- FILE *handle;
- int32_t buffer;
- int32_t buffLive;
- char mode;
-} BitStream;
-
-typedef struct {
- char *buff;
- int32_t buffer;
- int32_t buffLive;
- uint64_t pos;
- int32_t crc; /* logically, this doesn't belong here, but RubyInline... */
-} BitBuffer;
-
-FILE *xfopen(const char *path, const char *mode);
-void xfclose(FILE *fp);
-
-BitBuffer *bbOfSize(uint64_t size);
-void bbClose(BitBuffer *bb);
-
-int computeBoundaries(FILE *inFile);
-int decompressBlock(char *src, uint32_t srcLen, char *dest, uint32_t *destLen);
-
-uint64_t readBlock(FILE *inFile, uint64_t bitOffset, BitBuffer *bbOut);
-uint64_t fixedOffset(uint64_t offset);
-
-#endif
diff --git a/woip/c/compile b/woip/c/compile
deleted file mode 120000
index 0bb84da..0000000
--- a/woip/c/compile
+++ /dev/null
@@ -1 +0,0 @@
-/usr/share/automake-1.10/compile \ No newline at end of file
diff --git a/woip/c/configure b/woip/c/configure
deleted file mode 100755
index 573ae00..0000000
--- a/woip/c/configure
+++ /dev/null
@@ -1,4745 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for wp 0.1.
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
-else
- as_have_required=no
-fi
-
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
-else
- as_candidate_shells=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- case $as_dir in
- /*)
- for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
- done;;
- esac
-done
-IFS=$as_save_IFS
-
-
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-(as_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
- break
-fi
-
-fi
-
- done
-
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf@gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-exec 7<&0 </dev/null 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Identity of this package.
-PACKAGE_NAME='wp'
-PACKAGE_TARNAME='wp'
-PACKAGE_VERSION='0.1'
-PACKAGE_STRING='wp 0.1'
-PACKAGE_BUGREPORT=''
-
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-am__isrc
-CYGPATH_W
-PACKAGE
-VERSION
-ACLOCAL
-AUTOCONF
-AUTOMAKE
-AUTOHEADER
-MAKEINFO
-install_sh
-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
-LIBOBJS
-LTLIBOBJS'
-ac_subst_files=''
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute directory names.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures wp 0.1 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/wp]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of wp 0.1:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-wp configure 0.1
-generated by GNU Autoconf 2.61
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by wp $as_me 0.1, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args '$ac_arg'"
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
-else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
-fi
-shift
-for ac_site_file
-do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-am__api_version='1.10'
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-IFS=$as_save_IFS
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
- { (exit 1); exit 1; }; }
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $. echo might interpret backslashes.
-# By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm -f conftest.sed
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
-if test -z "$MKDIR_P"; then
- if test "${ac_cv_path_mkdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
-done
-IFS=$as_save_IFS
-
-fi
-
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- test -d ./--version && rmdir ./--version
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
-echo "${ECHO_T}$MKDIR_P" >&6; }
-
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- SET_MAKE=
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
- { (exit 1); exit 1; }; }
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='wp'
- VERSION='0.1'
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { (ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-
-
-{ echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-
-
-
-{ echo "$as_me:$LINENO: checking for BZ2_bzBuffToBuffDecompress in -lbz2" >&5
-echo $ECHO_N "checking for BZ2_bzBuffToBuffDecompress in -lbz2... $ECHO_C" >&6; }
-if test "${ac_cv_lib_bz2_BZ2_bzBuffToBuffDecompress+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbz2 $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char BZ2_bzBuffToBuffDecompress ();
-int
-main ()
-{
-return BZ2_bzBuffToBuffDecompress ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_bz2_BZ2_bzBuffToBuffDecompress=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_bz2_BZ2_bzBuffToBuffDecompress=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_BZ2_bzBuffToBuffDecompress" >&5
-echo "${ECHO_T}$ac_cv_lib_bz2_BZ2_bzBuffToBuffDecompress" >&6; }
-if test $ac_cv_lib_bz2_BZ2_bzBuffToBuffDecompress = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBBZ2 1
-_ACEOF
-
- LIBS="-lbz2 $LIBS"
-
-else
- \
- { { echo "$as_me:$LINENO: error: I require libbz2
-See \`config.log' for more details." >&5
-echo "$as_me: error: I require libbz2
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-{ echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5
-echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6; }
-if test "${ac_cv_lib_ncurses_initscr+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lncurses $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char initscr ();
-int
-main ()
-{
-return initscr ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_ncurses_initscr=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_ncurses_initscr=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_initscr" >&5
-echo "${ECHO_T}$ac_cv_lib_ncurses_initscr" >&6; }
-if test $ac_cv_lib_ncurses_initscr = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNCURSES 1
-_ACEOF
-
- LIBS="-lncurses $LIBS"
-
-else
- \
- { { echo "$as_me:$LINENO: error: I require ncurses
-See \`config.log' for more details." >&5
-echo "$as_me: error: I require ncurses
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-if test "x$CC" != xcc; then
- { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
-echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; }
-else
- { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
-echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; }
-fi
-set dummy $CC; ac_cc=`echo $2 |
- sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- test -f conftest2.$ac_objext && { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); };
-then
- eval ac_cv_prog_cc_${ac_cc}_c_o=yes
- if test "x$CC" != xcc; then
- # Test first that cc exists at all.
- if { ac_try='cc -c conftest.$ac_ext >&5'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
- rm -f conftest2.*
- if { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- test -f conftest2.$ac_objext && { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); };
- then
- # cc works too.
- :
- else
- # cc exists but doesn't like -o.
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
- fi
- fi
- fi
-else
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
-cat >>confdefs.h <<\_ACEOF
-#define NO_MINUS_C_MINUS_O 1
-_ACEOF
-
-fi
-
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-
-
-
-ac_config_files="$ac_config_files Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
- else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-ac_script='
-t clear
-:clear
-s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-b any
-:quote
-s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
-s/\$/$$/g
-H
-:any
-${
- g
- s/^\n//
- s/\n/ /g
- p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
-
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-
-# Save the log message, to keep $[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by wp $as_me 0.1, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bug-autoconf@gnu.org>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-wp config.status 0.1
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2006 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --he | --h | --help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
- export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp=
- trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
-
-_ACEOF
-
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-am__isrc!$am__isrc$ac_delim
-CYGPATH_W!$CYGPATH_W$ac_delim
-PACKAGE!$PACKAGE$ac_delim
-VERSION!$VERSION$ac_delim
-ACLOCAL!$ACLOCAL$ac_delim
-AUTOCONF!$AUTOCONF$ac_delim
-AUTOMAKE!$AUTOMAKE$ac_delim
-AUTOHEADER!$AUTOHEADER$ac_delim
-MAKEINFO!$MAKEINFO$ac_delim
-install_sh!$install_sh$ac_delim
-STRIP!$STRIP$ac_delim
-INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
-mkdir_p!$mkdir_p$ac_delim
-AWK!$AWK$ac_delim
-SET_MAKE!$SET_MAKE$ac_delim
-am__leading_dot!$am__leading_dot$ac_delim
-AMTAR!$AMTAR$ac_delim
-am__tar!$am__tar$ac_delim
-am__untar!$am__untar$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-DEPDIR!$DEPDIR$ac_delim
-am__include!$am__include$ac_delim
-am__quote!$am__quote$ac_delim
-AMDEP_TRUE!$AMDEP_TRUE$ac_delim
-AMDEP_FALSE!$AMDEP_FALSE$ac_delim
-AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
-CCDEPMODE!$CCDEPMODE$ac_delim
-am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
-am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 77; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
-_ACEOF
-
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
-s/:*$//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-fi # test -n "$CONFIG_FILES"
-
-
-for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
- esac
- ac_file_inputs="$ac_file_inputs $ac_f"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- fi
-
- case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-
-case `sed -n '/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
-
- rm -f "$tmp/stdin"
- case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
- esac
- ;;
-
-
- :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
-echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir=$dirpart/$fdir
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
- ;;
-
- esac
-done # for ac_tag
-
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
diff --git a/woip/c/configure.ac b/woip/c/configure.ac
deleted file mode 100644
index 58332a2..0000000
--- a/woip/c/configure.ac
+++ /dev/null
@@ -1,16 +0,0 @@
-AC_PREREQ(2.59)
-
-AC_INIT(wp, 0.1)
-
-AM_INIT_AUTOMAKE
-
-AC_PROG_CC
-
-AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffDecompress, [], \
- [AC_MSG_FAILURE(I require libbz2)])
-AC_CHECK_LIB(ncurses, initscr, [], \
- [AC_MSG_FAILURE(I require ncurses)])
-
-AM_PROG_CC_C_O
-
-AC_OUTPUT(Makefile)
diff --git a/woip/c/debug.h b/woip/c/debug.h
deleted file mode 100644
index efc871a..0000000
--- a/woip/c/debug.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __DEBUG_H__
-#define __DEBUG_H__
-
-#include <stdbool.h>
-#include <errno.h>
-#include <string.h>
-
-#ifdef STRIP_DEBUG
-#define debug(...)
-#else
-#define debug(fmt, ...) (debug ? fprintf(stderr, "debug: " fmt "\n", \
- ##__VA_ARGS__) : false)
-#endif
-
-#define fatal(error, ...) do { \
- fprintf(stderr, error, ##__VA_ARGS__); \
- fprintf(stderr, " (errno %d: %s)\n", errno, strerror(errno)); \
- exit(1); \
- } while(0)
-
-
-#ifndef __GNUC__
-#error I want GNU C plz
-#endif
-
-#ifdef DEBUG
-static bool debug = true;
-#else
-static bool debug = false;
-#endif
-
-#endif
diff --git a/woip/c/depcomp b/woip/c/depcomp
deleted file mode 120000
index 50adcba..0000000
--- a/woip/c/depcomp
+++ /dev/null
@@ -1 +0,0 @@
-/usr/share/automake-1.10/depcomp \ No newline at end of file
diff --git a/woip/c/indexer.c b/woip/c/indexer.c
deleted file mode 100644
index efda166..0000000
--- a/woip/c/indexer.c
+++ /dev/null
@@ -1,177 +0,0 @@
-#include "ternary.h"
-
-static uint32_t storepos = 0;
-struct node store[INDEX_LEN];
-#define NODE(node) (store + (node))
-char line[MAXLINE];
-
-void insert(struct node *node, char *str, uint32_t block) {
- int cmp = CMP(str[0], node->c);
- debug("insert %d, %s, %d", node - store, str, block);
-
- if(!node->c) {
- bzero(node, sizeof(node));
- node->c = str[0];
- if(str[1]) {
- node->eq = ++storepos;
- insert(NODE(storepos), str + 1, block);
- } else node->block = BLOCK_MASK(block);
- } else if(str[0]) {
- if(NEXT_NODE(node, cmp)) {
- if(!cmp) {
- if(str[1])
- insert(NODE(NEXT_NODE(node, cmp)), str + 1, block);
- else
- node->block = BLOCK_MASK(block);
- } else
- insert(NODE(NEXT_NODE(node, cmp)), str, block);
- } else if(!(cmp == 0 && !str[1])) {
- /* unless at end of string, and all matches */
- NEXT_NODE(node, cmp) = ++storepos;
- insert(NODE(storepos), cmp ? str : str + 1, block);
- } else {
- node->block = BLOCK_MASK(block);
- }
- }
-}
-
-void collapse(struct node *node) {
- compact_str s;
- struct node *ptr;
- uint32_t offset;
- struct cnode *cnode;
- int i;
- uint32_t last_block;
-
- offset = node - store;
- i = 0;
- do {
- ptr = NODE(offset);
- s[i++] = ptr->c;
- last_block = ptr->block;
- if(ptr != node) ptr->block = -1;
- } while(offset = ptr->eq);
- s[i] = '\0';
-
- cnode = (struct cnode *) node;
- cnode->block = last_block | CMASK;
- strncpy(cnode->str, s, sizeof(compact_str));
-}
-
-int compact(struct node *node, bool eager) {
- int r;
-
- if(node->lt || node->gt) {
- if(node->lt) compact(NODE(node->lt), true);
- if(node->gt) compact(NODE(node->gt), true);
- }
-
- if(node->eq) {
- r = compact(NODE(node->eq), node->lt || node->gt);
-
- if(r > 0 && (r + 2 == sizeof(compact_str) || eager)) {
- collapse(NODE(node->eq));
- return -1;
- }
-
- if(node->lt || node->gt || (node->eq && node->block))
- return -1;
- else
- return r >= 0 ? r + 1 : r;
- } else {
- if(!node->eq && !node->lt && !node->gt)
- return 0;
- else
- return -1;
- }
-}
-
-void dump_index(char *file, int argc, char **argv) {
- struct index_hdr h;
- int i, j = 0;
-
- h.nodes = storepos + 1;
- h.node_size = sizeof(struct node);
-
- for(i = 0; i < argc; i++) {
- j += snprintf(h.cmd + j, MAXLINE - j, "%s", argv[i]);
- if(i + 1 < argc) j += snprintf(h.cmd + j, MAXLINE - j, " ");
- }
-
- FILE *fp = xfopen(file, "w");
-
- fwrite(&h, sizeof(struct index_hdr), 1, fp);
- fwrite(store, sizeof(struct node), storepos + 1, fp);
- fclose(fp);
-}
-
-int slots_in_use() {
- int i, in_use = 0;
- for(i = 0; i < storepos; i++) {
- struct node *n = store + i;
- if(n->block != -1)
- in_use++;
- }
- return in_use;
-}
-
-void usage(char *name) {
- fprintf(stderr, "%s -f <indexFile> [-c] [-d]\n", name);
- exit(-1);
-}
-
-int main(int argc, char **argv) {
- char str[PREFIX_LEN];
- char *foo, indexFile[MAXLINE], ch;
- uint32_t block = 0;
- uint32_t inserted = 0;
- bool doCompact = false;
-
- while ((ch = getopt(argc, argv, "cdf:h")) != -1) {
- switch (ch) {
- case 'c':
- doCompact = true;
- break;
- case 'd':
- debug = true;
- break;
- case 'f':
- strcpy(indexFile, optarg);
- break;
- case 'h':
- default:
- usage(argv[0]);
- }
- }
-
- if(!indexFile)
- usage(argv[0]);
-
- while(fgets(line, MAXLINE, stdin)) {
- if((storepos + 1) >= INDEX_LEN)
- fatal("no more index space");
-
- foo = strchr(line, '|');
- foo[0] = '\0';
- foo++;
-
- strncpy(str, line, PREFIX_LEN - 1);
- str[PREFIX_LEN] = '\0';
- block = atoi(foo);
-
- debug("inserting '%s' with block %d", str, block);
- insert(store, str, block);
- inserted++;
- }
-
- if(doCompact) compact(store, true);
-
- dump_index(indexFile, argc, argv);
-
- printf("Inserted %d entries using %d slots\n", inserted, storepos);
-
- if(doCompact)
- printf("After compacting, using %d slots\n", slots_in_use());
-
- return 0;
-}
diff --git a/woip/c/indexer.i b/woip/c/indexer.i
deleted file mode 100644
index 1c395ca..0000000
--- a/woip/c/indexer.i
+++ /dev/null
@@ -1,3883 +0,0 @@
-# 1 "indexer.c"
-# 1 "/home/cjb/git/wikipedia-iphone/c//"
-# 1 "<built-in>"
-# 1 "<command-line>"
-# 1 "indexer.c"
-# 1 "ternary.h" 1
-# 1 "/usr/include/sys/mman.h" 1 3 4
-# 23 "/usr/include/sys/mman.h" 3 4
-# 1 "/usr/include/features.h" 1 3 4
-# 330 "/usr/include/features.h" 3 4
-# 1 "/usr/include/sys/cdefs.h" 1 3 4
-# 348 "/usr/include/sys/cdefs.h" 3 4
-# 1 "/usr/include/bits/wordsize.h" 1 3 4
-# 349 "/usr/include/sys/cdefs.h" 2 3 4
-# 331 "/usr/include/features.h" 2 3 4
-# 354 "/usr/include/features.h" 3 4
-# 1 "/usr/include/gnu/stubs.h" 1 3 4
-
-
-
-# 1 "/usr/include/bits/wordsize.h" 1 3 4
-# 5 "/usr/include/gnu/stubs.h" 2 3 4
-
-
-# 1 "/usr/include/gnu/stubs-32.h" 1 3 4
-# 8 "/usr/include/gnu/stubs.h" 2 3 4
-# 355 "/usr/include/features.h" 2 3 4
-# 24 "/usr/include/sys/mman.h" 2 3 4
-# 1 "/usr/include/bits/types.h" 1 3 4
-# 28 "/usr/include/bits/types.h" 3 4
-# 1 "/usr/include/bits/wordsize.h" 1 3 4
-# 29 "/usr/include/bits/types.h" 2 3 4
-
-
-typedef unsigned char __u_char;
-typedef unsigned short int __u_short;
-typedef unsigned int __u_int;
-typedef unsigned long int __u_long;
-
-
-typedef signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef signed short int __int16_t;
-typedef unsigned short int __uint16_t;
-typedef signed int __int32_t;
-typedef unsigned int __uint32_t;
-
-
-
-
-__extension__ typedef signed long long int __int64_t;
-__extension__ typedef unsigned long long int __uint64_t;
-
-
-
-
-
-
-
-__extension__ typedef long long int __quad_t;
-__extension__ typedef unsigned long long int __u_quad_t;
-# 131 "/usr/include/bits/types.h" 3 4
-# 1 "/usr/include/bits/typesizes.h" 1 3 4
-# 132 "/usr/include/bits/types.h" 2 3 4
-
-
-__extension__ typedef __u_quad_t __dev_t;
-__extension__ typedef unsigned int __uid_t;
-__extension__ typedef unsigned int __gid_t;
-__extension__ typedef unsigned long int __ino_t;
-__extension__ typedef __u_quad_t __ino64_t;
-__extension__ typedef unsigned int __mode_t;
-__extension__ typedef unsigned int __nlink_t;
-__extension__ typedef long int __off_t;
-__extension__ typedef __quad_t __off64_t;
-__extension__ typedef int __pid_t;
-__extension__ typedef struct { int __val[2]; } __fsid_t;
-__extension__ typedef long int __clock_t;
-__extension__ typedef unsigned long int __rlim_t;
-__extension__ typedef __u_quad_t __rlim64_t;
-__extension__ typedef unsigned int __id_t;
-__extension__ typedef long int __time_t;
-__extension__ typedef unsigned int __useconds_t;
-__extension__ typedef long int __suseconds_t;
-
-__extension__ typedef int __daddr_t;
-__extension__ typedef long int __swblk_t;
-__extension__ typedef int __key_t;
-
-
-__extension__ typedef int __clockid_t;
-
-
-__extension__ typedef void * __timer_t;
-
-
-__extension__ typedef long int __blksize_t;
-
-
-
-
-__extension__ typedef long int __blkcnt_t;
-__extension__ typedef __quad_t __blkcnt64_t;
-
-
-__extension__ typedef unsigned long int __fsblkcnt_t;
-__extension__ typedef __u_quad_t __fsblkcnt64_t;
-
-
-__extension__ typedef unsigned long int __fsfilcnt_t;
-__extension__ typedef __u_quad_t __fsfilcnt64_t;
-
-__extension__ typedef int __ssize_t;
-
-
-
-typedef __off64_t __loff_t;
-typedef __quad_t *__qaddr_t;
-typedef char *__caddr_t;
-
-
-__extension__ typedef int __intptr_t;
-
-
-__extension__ typedef unsigned int __socklen_t;
-# 25 "/usr/include/sys/mman.h" 2 3 4
-
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 1 3 4
-# 214 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 3 4
-typedef unsigned int size_t;
-# 27 "/usr/include/sys/mman.h" 2 3 4
-
-
-
-typedef __off_t off_t;
-
-
-
-
-
-
-
-typedef __mode_t mode_t;
-
-
-
-# 1 "/usr/include/bits/mman.h" 1 3 4
-# 43 "/usr/include/sys/mman.h" 2 3 4
-
-
-
-
-
-# 58 "/usr/include/sys/mman.h" 3 4
-extern void *mmap (void *__addr, size_t __len, int __prot,
- int __flags, int __fd, __off_t __offset) __attribute__ ((__nothrow__));
-# 77 "/usr/include/sys/mman.h" 3 4
-extern int munmap (void *__addr, size_t __len) __attribute__ ((__nothrow__));
-
-
-
-
-extern int mprotect (void *__addr, size_t __len, int __prot) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-
-extern int msync (void *__addr, size_t __len, int __flags);
-
-
-
-
-extern int madvise (void *__addr, size_t __len, int __advice) __attribute__ ((__nothrow__));
-
-
-
-extern int posix_madvise (void *__addr, size_t __len, int __advice) __attribute__ ((__nothrow__));
-
-
-
-
-extern int mlock (__const void *__addr, size_t __len) __attribute__ ((__nothrow__));
-
-
-extern int munlock (__const void *__addr, size_t __len) __attribute__ ((__nothrow__));
-
-
-
-
-extern int mlockall (int __flags) __attribute__ ((__nothrow__));
-
-
-
-extern int munlockall (void) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-
-extern int mincore (void *__start, size_t __len, unsigned char *__vec)
- __attribute__ ((__nothrow__));
-# 145 "/usr/include/sys/mman.h" 3 4
-extern int shm_open (__const char *__name, int __oflag, mode_t __mode);
-
-
-extern int shm_unlink (__const char *__name);
-
-
-# 2 "ternary.h" 2
-# 1 "/usr/include/errno.h" 1 3 4
-# 32 "/usr/include/errno.h" 3 4
-
-
-
-
-# 1 "/usr/include/bits/errno.h" 1 3 4
-# 25 "/usr/include/bits/errno.h" 3 4
-# 1 "/usr/include/linux/errno.h" 1 3 4
-
-
-
-# 1 "/usr/include/asm/errno.h" 1 3 4
-# 1 "/usr/include/asm-generic/errno.h" 1 3 4
-
-
-
-# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
-# 5 "/usr/include/asm-generic/errno.h" 2 3 4
-# 1 "/usr/include/asm/errno.h" 2 3 4
-# 5 "/usr/include/linux/errno.h" 2 3 4
-# 26 "/usr/include/bits/errno.h" 2 3 4
-# 43 "/usr/include/bits/errno.h" 3 4
-extern int *__errno_location (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
-# 37 "/usr/include/errno.h" 2 3 4
-# 59 "/usr/include/errno.h" 3 4
-
-# 3 "ternary.h" 2
-# 1 "/usr/include/stdint.h" 1 3 4
-# 27 "/usr/include/stdint.h" 3 4
-# 1 "/usr/include/bits/wchar.h" 1 3 4
-# 28 "/usr/include/stdint.h" 2 3 4
-# 1 "/usr/include/bits/wordsize.h" 1 3 4
-# 29 "/usr/include/stdint.h" 2 3 4
-# 37 "/usr/include/stdint.h" 3 4
-typedef signed char int8_t;
-typedef short int int16_t;
-typedef int int32_t;
-
-
-
-__extension__
-typedef long long int int64_t;
-
-
-
-
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-
-typedef unsigned int uint32_t;
-
-
-
-
-
-__extension__
-typedef unsigned long long int uint64_t;
-
-
-
-
-
-
-typedef signed char int_least8_t;
-typedef short int int_least16_t;
-typedef int int_least32_t;
-
-
-
-__extension__
-typedef long long int int_least64_t;
-
-
-
-typedef unsigned char uint_least8_t;
-typedef unsigned short int uint_least16_t;
-typedef unsigned int uint_least32_t;
-
-
-
-__extension__
-typedef unsigned long long int uint_least64_t;
-
-
-
-
-
-
-typedef signed char int_fast8_t;
-
-
-
-
-
-typedef int int_fast16_t;
-typedef int int_fast32_t;
-__extension__
-typedef long long int int_fast64_t;
-
-
-
-typedef unsigned char uint_fast8_t;
-
-
-
-
-
-typedef unsigned int uint_fast16_t;
-typedef unsigned int uint_fast32_t;
-__extension__
-typedef unsigned long long int uint_fast64_t;
-# 126 "/usr/include/stdint.h" 3 4
-typedef int intptr_t;
-
-
-typedef unsigned int uintptr_t;
-# 138 "/usr/include/stdint.h" 3 4
-__extension__
-typedef long long int intmax_t;
-__extension__
-typedef unsigned long long int uintmax_t;
-# 4 "ternary.h" 2
-# 1 "/usr/include/stdio.h" 1 3 4
-# 30 "/usr/include/stdio.h" 3 4
-
-
-
-
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 1 3 4
-# 35 "/usr/include/stdio.h" 2 3 4
-# 45 "/usr/include/stdio.h" 3 4
-struct _IO_FILE;
-
-
-
-typedef struct _IO_FILE FILE;
-
-
-
-
-
-# 65 "/usr/include/stdio.h" 3 4
-typedef struct _IO_FILE __FILE;
-# 75 "/usr/include/stdio.h" 3 4
-# 1 "/usr/include/libio.h" 1 3 4
-# 32 "/usr/include/libio.h" 3 4
-# 1 "/usr/include/_G_config.h" 1 3 4
-# 15 "/usr/include/_G_config.h" 3 4
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 1 3 4
-# 16 "/usr/include/_G_config.h" 2 3 4
-
-
-
-
-# 1 "/usr/include/wchar.h" 1 3 4
-# 78 "/usr/include/wchar.h" 3 4
-typedef struct
-{
- int __count;
- union
- {
-
- unsigned int __wch;
-
-
-
- char __wchb[4];
- } __value;
-} __mbstate_t;
-# 21 "/usr/include/_G_config.h" 2 3 4
-
-typedef struct
-{
- __off_t __pos;
- __mbstate_t __state;
-} _G_fpos_t;
-typedef struct
-{
- __off64_t __pos;
- __mbstate_t __state;
-} _G_fpos64_t;
-# 53 "/usr/include/_G_config.h" 3 4
-typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
-typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
-typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
-typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
-# 33 "/usr/include/libio.h" 2 3 4
-# 53 "/usr/include/libio.h" 3 4
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stdarg.h" 1 3 4
-# 43 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stdarg.h" 3 4
-typedef __builtin_va_list __gnuc_va_list;
-# 54 "/usr/include/libio.h" 2 3 4
-# 170 "/usr/include/libio.h" 3 4
-struct _IO_jump_t; struct _IO_FILE;
-# 180 "/usr/include/libio.h" 3 4
-typedef void _IO_lock_t;
-
-
-
-
-
-struct _IO_marker {
- struct _IO_marker *_next;
- struct _IO_FILE *_sbuf;
-
-
-
- int _pos;
-# 203 "/usr/include/libio.h" 3 4
-};
-
-
-enum __codecvt_result
-{
- __codecvt_ok,
- __codecvt_partial,
- __codecvt_error,
- __codecvt_noconv
-};
-# 271 "/usr/include/libio.h" 3 4
-struct _IO_FILE {
- int _flags;
-
-
-
-
- char* _IO_read_ptr;
- char* _IO_read_end;
- char* _IO_read_base;
- char* _IO_write_base;
- char* _IO_write_ptr;
- char* _IO_write_end;
- char* _IO_buf_base;
- char* _IO_buf_end;
-
- char *_IO_save_base;
- char *_IO_backup_base;
- char *_IO_save_end;
-
- struct _IO_marker *_markers;
-
- struct _IO_FILE *_chain;
-
- int _fileno;
-
-
-
- int _flags2;
-
- __off_t _old_offset;
-
-
-
- unsigned short _cur_column;
- signed char _vtable_offset;
- char _shortbuf[1];
-
-
-
- _IO_lock_t *_lock;
-# 319 "/usr/include/libio.h" 3 4
- __off64_t _offset;
-# 328 "/usr/include/libio.h" 3 4
- void *__pad1;
- void *__pad2;
- void *__pad3;
- void *__pad4;
- size_t __pad5;
-
- int _mode;
-
- char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
-
-};
-
-
-typedef struct _IO_FILE _IO_FILE;
-
-
-struct _IO_FILE_plus;
-
-extern struct _IO_FILE_plus _IO_2_1_stdin_;
-extern struct _IO_FILE_plus _IO_2_1_stdout_;
-extern struct _IO_FILE_plus _IO_2_1_stderr_;
-# 364 "/usr/include/libio.h" 3 4
-typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
-
-
-
-
-
-
-
-typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
- size_t __n);
-
-
-
-
-
-
-
-typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
-
-
-typedef int __io_close_fn (void *__cookie);
-# 416 "/usr/include/libio.h" 3 4
-extern int __underflow (_IO_FILE *);
-extern int __uflow (_IO_FILE *);
-extern int __overflow (_IO_FILE *, int);
-# 458 "/usr/include/libio.h" 3 4
-extern int _IO_getc (_IO_FILE *__fp);
-extern int _IO_putc (int __c, _IO_FILE *__fp);
-extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
-extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
-
-extern int _IO_peekc_locked (_IO_FILE *__fp);
-
-
-
-
-
-extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
-extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
-extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
-# 488 "/usr/include/libio.h" 3 4
-extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
- __gnuc_va_list, int *__restrict);
-extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
- __gnuc_va_list);
-extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
-extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
-
-extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
-extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
-
-extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
-# 76 "/usr/include/stdio.h" 2 3 4
-# 89 "/usr/include/stdio.h" 3 4
-
-
-typedef _G_fpos_t fpos_t;
-
-
-
-
-# 141 "/usr/include/stdio.h" 3 4
-# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
-# 142 "/usr/include/stdio.h" 2 3 4
-
-
-
-extern struct _IO_FILE *stdin;
-extern struct _IO_FILE *stdout;
-extern struct _IO_FILE *stderr;
-
-
-
-
-
-
-
-extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
-
-extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-extern FILE *tmpfile (void) ;
-# 186 "/usr/include/stdio.h" 3 4
-extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ;
-
-
-
-
-
-extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ;
-# 204 "/usr/include/stdio.h" 3 4
-extern char *tempnam (__const char *__dir, __const char *__pfx)
- __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
-
-
-
-
-
-
-
-
-extern int fclose (FILE *__stream);
-
-
-
-
-extern int fflush (FILE *__stream);
-
-# 229 "/usr/include/stdio.h" 3 4
-extern int fflush_unlocked (FILE *__stream);
-# 243 "/usr/include/stdio.h" 3 4
-
-
-
-
-
-
-extern FILE *fopen (__const char *__restrict __filename,
- __const char *__restrict __modes) ;
-
-
-
-
-extern FILE *freopen (__const char *__restrict __filename,
- __const char *__restrict __modes,
- FILE *__restrict __stream) ;
-# 272 "/usr/include/stdio.h" 3 4
-
-# 283 "/usr/include/stdio.h" 3 4
-extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ;
-# 304 "/usr/include/stdio.h" 3 4
-
-
-
-extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
-
-
-
-extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
- int __modes, size_t __n) __attribute__ ((__nothrow__));
-
-
-
-
-
-extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
- size_t __size) __attribute__ ((__nothrow__));
-
-
-extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-
-
-extern int fprintf (FILE *__restrict __stream,
- __const char *__restrict __format, ...);
-
-
-
-
-extern int printf (__const char *__restrict __format, ...);
-
-extern int sprintf (char *__restrict __s,
- __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
-
-
-
-
-
-extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
- __gnuc_va_list __arg);
-
-
-
-
-extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
-
-extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
- __gnuc_va_list __arg) __attribute__ ((__nothrow__));
-
-
-
-
-
-extern int snprintf (char *__restrict __s, size_t __maxlen,
- __const char *__restrict __format, ...)
- __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
-
-extern int vsnprintf (char *__restrict __s, size_t __maxlen,
- __const char *__restrict __format, __gnuc_va_list __arg)
- __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
-
-# 398 "/usr/include/stdio.h" 3 4
-
-
-
-
-
-extern int fscanf (FILE *__restrict __stream,
- __const char *__restrict __format, ...) ;
-
-
-
-
-extern int scanf (__const char *__restrict __format, ...) ;
-
-extern int sscanf (__const char *__restrict __s,
- __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
-# 441 "/usr/include/stdio.h" 3 4
-
-# 504 "/usr/include/stdio.h" 3 4
-
-
-
-
-
-extern int fgetc (FILE *__stream);
-extern int getc (FILE *__stream);
-
-
-
-
-
-extern int getchar (void);
-
-# 528 "/usr/include/stdio.h" 3 4
-extern int getc_unlocked (FILE *__stream);
-extern int getchar_unlocked (void);
-# 539 "/usr/include/stdio.h" 3 4
-extern int fgetc_unlocked (FILE *__stream);
-
-
-
-
-
-
-
-
-
-
-
-extern int fputc (int __c, FILE *__stream);
-extern int putc (int __c, FILE *__stream);
-
-
-
-
-
-extern int putchar (int __c);
-
-# 572 "/usr/include/stdio.h" 3 4
-extern int fputc_unlocked (int __c, FILE *__stream);
-
-
-
-
-
-
-
-extern int putc_unlocked (int __c, FILE *__stream);
-extern int putchar_unlocked (int __c);
-
-
-
-
-
-
-extern int getw (FILE *__stream);
-
-
-extern int putw (int __w, FILE *__stream);
-
-
-
-
-
-
-
-
-extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
- ;
-
-
-
-
-
-
-extern char *gets (char *__s) ;
-
-# 653 "/usr/include/stdio.h" 3 4
-
-
-
-
-
-extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
-
-
-
-
-
-extern int puts (__const char *__s);
-
-
-
-
-
-
-extern int ungetc (int __c, FILE *__stream);
-
-
-
-
-
-
-extern size_t fread (void *__restrict __ptr, size_t __size,
- size_t __n, FILE *__restrict __stream) ;
-
-
-
-
-extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
- size_t __n, FILE *__restrict __s) ;
-
-# 706 "/usr/include/stdio.h" 3 4
-extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
- size_t __n, FILE *__restrict __stream) ;
-extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
- size_t __n, FILE *__restrict __stream) ;
-
-
-
-
-
-
-
-
-extern int fseek (FILE *__stream, long int __off, int __whence);
-
-
-
-
-extern long int ftell (FILE *__stream) ;
-
-
-
-
-extern void rewind (FILE *__stream);
-
-# 742 "/usr/include/stdio.h" 3 4
-extern int fseeko (FILE *__stream, __off_t __off, int __whence);
-
-
-
-
-extern __off_t ftello (FILE *__stream) ;
-# 761 "/usr/include/stdio.h" 3 4
-
-
-
-
-
-
-extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
-
-
-
-
-extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
-# 784 "/usr/include/stdio.h" 3 4
-
-# 793 "/usr/include/stdio.h" 3 4
-
-
-extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
-
-extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;
-
-extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;
-
-
-
-
-extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
-extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
-extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
-
-
-
-
-
-
-
-
-extern void perror (__const char *__s);
-
-
-
-
-
-
-# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
-# 27 "/usr/include/bits/sys_errlist.h" 3 4
-extern int sys_nerr;
-extern __const char *__const sys_errlist[];
-# 823 "/usr/include/stdio.h" 2 3 4
-
-
-
-
-extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;
-
-
-
-
-extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
-# 842 "/usr/include/stdio.h" 3 4
-extern FILE *popen (__const char *__command, __const char *__modes) ;
-
-
-
-
-
-extern int pclose (FILE *__stream);
-
-
-
-
-
-extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
-# 882 "/usr/include/stdio.h" 3 4
-extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
-
-
-
-extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
-
-
-extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
-# 903 "/usr/include/stdio.h" 3 4
-# 1 "/usr/include/bits/stdio.h" 1 3 4
-# 36 "/usr/include/bits/stdio.h" 3 4
-extern __inline int
-vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg)
-{
- return vfprintf (stdout, __fmt, __arg);
-}
-
-
-
-extern __inline int
-getchar (void)
-{
- return _IO_getc (stdin);
-}
-
-
-
-
-extern __inline int
-fgetc_unlocked (FILE *__fp)
-{
- return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
-}
-
-
-
-
-
-extern __inline int
-getc_unlocked (FILE *__fp)
-{
- return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
-}
-
-
-extern __inline int
-getchar_unlocked (void)
-{
- return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
-}
-
-
-
-
-extern __inline int
-putchar (int __c)
-{
- return _IO_putc (__c, stdout);
-}
-
-
-
-
-extern __inline int
-fputc_unlocked (int __c, FILE *__stream)
-{
- return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
-}
-
-
-
-
-
-extern __inline int
-putc_unlocked (int __c, FILE *__stream)
-{
- return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
-}
-
-
-extern __inline int
-putchar_unlocked (int __c)
-{
- return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
-}
-# 125 "/usr/include/bits/stdio.h" 3 4
-extern __inline int
-__attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream)
-{
- return (((__stream)->_flags & 0x10) != 0);
-}
-
-
-extern __inline int
-__attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream)
-{
- return (((__stream)->_flags & 0x20) != 0);
-}
-# 904 "/usr/include/stdio.h" 2 3 4
-# 912 "/usr/include/stdio.h" 3 4
-
-# 5 "ternary.h" 2
-# 1 "/usr/include/string.h" 1 3 4
-# 28 "/usr/include/string.h" 3 4
-
-
-
-
-
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 1 3 4
-# 34 "/usr/include/string.h" 2 3 4
-
-
-
-
-extern void *memcpy (void *__restrict __dest,
- __const void *__restrict __src, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern void *memmove (void *__dest, __const void *__src, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-
-
-
-
-extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
- int __c, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-
-
-
-extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern void *memchr (__const void *__s, int __c, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
-
-# 82 "/usr/include/string.h" 3 4
-
-
-extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-extern char *strncpy (char *__restrict __dest,
- __const char *__restrict __src, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
- size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern int strcmp (__const char *__s1, __const char *__s2)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-
-extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern int strcoll (__const char *__s1, __const char *__s2)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-
-extern size_t strxfrm (char *__restrict __dest,
- __const char *__restrict __src, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
-
-# 130 "/usr/include/string.h" 3 4
-extern char *strdup (__const char *__s)
- __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
-# 165 "/usr/include/string.h" 3 4
-
-
-extern char *strchr (__const char *__s, int __c)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
-
-extern char *strrchr (__const char *__s, int __c)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
-
-# 181 "/usr/include/string.h" 3 4
-
-
-
-extern size_t strcspn (__const char *__s, __const char *__reject)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern size_t strspn (__const char *__s, __const char *__accept)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-
-extern char *strpbrk (__const char *__s, __const char *__accept)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-
-extern char *strstr (__const char *__haystack, __const char *__needle)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-
-extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
-
-
-
-
-extern char *__strtok_r (char *__restrict __s,
- __const char *__restrict __delim,
- char **__restrict __save_ptr)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
-
-extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
- char **__restrict __save_ptr)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
-# 240 "/usr/include/string.h" 3 4
-
-
-extern size_t strlen (__const char *__s)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
-
-# 254 "/usr/include/string.h" 3 4
-
-
-extern char *strerror (int __errnum) __attribute__ ((__nothrow__));
-
-# 270 "/usr/include/string.h" 3 4
-extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
-# 294 "/usr/include/string.h" 3 4
-extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-extern void bcopy (__const void *__src, void *__dest, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern char *index (__const char *__s, int __c)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
-
-
-extern char *rindex (__const char *__s, int __c)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
-# 331 "/usr/include/string.h" 3 4
-extern int strcasecmp (__const char *__s1, __const char *__s2)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
-# 354 "/usr/include/string.h" 3 4
-extern char *strsep (char **__restrict __stringp,
- __const char *__restrict __delim)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-# 420 "/usr/include/string.h" 3 4
-# 1 "/usr/include/bits/string.h" 1 3 4
-# 421 "/usr/include/string.h" 2 3 4
-
-
-# 1 "/usr/include/bits/string2.h" 1 3 4
-# 52 "/usr/include/bits/string2.h" 3 4
-# 1 "/usr/include/endian.h" 1 3 4
-# 37 "/usr/include/endian.h" 3 4
-# 1 "/usr/include/bits/endian.h" 1 3 4
-# 38 "/usr/include/endian.h" 2 3 4
-# 53 "/usr/include/bits/string2.h" 2 3 4
-# 394 "/usr/include/bits/string2.h" 3 4
-extern void *__rawmemchr (const void *__s, int __c);
-# 969 "/usr/include/bits/string2.h" 3 4
-extern __inline size_t __strcspn_c1 (__const char *__s, int __reject);
-extern __inline size_t
-__strcspn_c1 (__const char *__s, int __reject)
-{
- register size_t __result = 0;
- while (__s[__result] != '\0' && __s[__result] != __reject)
- ++__result;
- return __result;
-}
-
-extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1,
- int __reject2);
-extern __inline size_t
-__strcspn_c2 (__const char *__s, int __reject1, int __reject2)
-{
- register size_t __result = 0;
- while (__s[__result] != '\0' && __s[__result] != __reject1
- && __s[__result] != __reject2)
- ++__result;
- return __result;
-}
-
-extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1,
- int __reject2, int __reject3);
-extern __inline size_t
-__strcspn_c3 (__const char *__s, int __reject1, int __reject2,
- int __reject3)
-{
- register size_t __result = 0;
- while (__s[__result] != '\0' && __s[__result] != __reject1
- && __s[__result] != __reject2 && __s[__result] != __reject3)
- ++__result;
- return __result;
-}
-# 1045 "/usr/include/bits/string2.h" 3 4
-extern __inline size_t __strspn_c1 (__const char *__s, int __accept);
-extern __inline size_t
-__strspn_c1 (__const char *__s, int __accept)
-{
- register size_t __result = 0;
-
- while (__s[__result] == __accept)
- ++__result;
- return __result;
-}
-
-extern __inline size_t __strspn_c2 (__const char *__s, int __accept1,
- int __accept2);
-extern __inline size_t
-__strspn_c2 (__const char *__s, int __accept1, int __accept2)
-{
- register size_t __result = 0;
-
- while (__s[__result] == __accept1 || __s[__result] == __accept2)
- ++__result;
- return __result;
-}
-
-extern __inline size_t __strspn_c3 (__const char *__s, int __accept1,
- int __accept2, int __accept3);
-extern __inline size_t
-__strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
-{
- register size_t __result = 0;
-
- while (__s[__result] == __accept1 || __s[__result] == __accept2
- || __s[__result] == __accept3)
- ++__result;
- return __result;
-}
-# 1121 "/usr/include/bits/string2.h" 3 4
-extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1,
- int __accept2);
-extern __inline char *
-__strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
-{
-
- while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
- ++__s;
- return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
-}
-
-extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1,
- int __accept2, int __accept3);
-extern __inline char *
-__strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
- int __accept3)
-{
-
- while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
- && *__s != __accept3)
- ++__s;
- return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
-}
-# 1173 "/usr/include/bits/string2.h" 3 4
-extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
-extern __inline char *
-__strtok_r_1c (char *__s, char __sep, char **__nextp)
-{
- char *__result;
- if (__s == ((void *)0))
- __s = *__nextp;
- while (*__s == __sep)
- ++__s;
- __result = ((void *)0);
- if (*__s != '\0')
- {
- __result = __s++;
- while (*__s != '\0')
- if (*__s++ == __sep)
- {
- __s[-1] = '\0';
- break;
- }
- *__nextp = __s;
- }
- return __result;
-}
-# 1205 "/usr/include/bits/string2.h" 3 4
-extern char *__strsep_g (char **__stringp, __const char *__delim);
-# 1223 "/usr/include/bits/string2.h" 3 4
-extern __inline char *__strsep_1c (char **__s, char __reject);
-extern __inline char *
-__strsep_1c (char **__s, char __reject)
-{
- register char *__retval = *__s;
- if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0))
- *(*__s)++ = '\0';
- return __retval;
-}
-
-extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2);
-extern __inline char *
-__strsep_2c (char **__s, char __reject1, char __reject2)
-{
- register char *__retval = *__s;
- if (__retval != ((void *)0))
- {
- register char *__cp = __retval;
- while (1)
- {
- if (*__cp == '\0')
- {
- __cp = ((void *)0);
- break;
- }
- if (*__cp == __reject1 || *__cp == __reject2)
- {
- *__cp++ = '\0';
- break;
- }
- ++__cp;
- }
- *__s = __cp;
- }
- return __retval;
-}
-
-extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2,
- char __reject3);
-extern __inline char *
-__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
-{
- register char *__retval = *__s;
- if (__retval != ((void *)0))
- {
- register char *__cp = __retval;
- while (1)
- {
- if (*__cp == '\0')
- {
- __cp = ((void *)0);
- break;
- }
- if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
- {
- *__cp++ = '\0';
- break;
- }
- ++__cp;
- }
- *__s = __cp;
- }
- return __retval;
-}
-# 1299 "/usr/include/bits/string2.h" 3 4
-# 1 "/usr/include/stdlib.h" 1 3 4
-# 33 "/usr/include/stdlib.h" 3 4
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 1 3 4
-# 34 "/usr/include/stdlib.h" 2 3 4
-
-
-# 469 "/usr/include/stdlib.h" 3 4
-
-
-extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
-
-extern void *calloc (size_t __nmemb, size_t __size)
- __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
-
-# 883 "/usr/include/stdlib.h" 3 4
-
-# 1300 "/usr/include/bits/string2.h" 2 3 4
-
-
-
-
-extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
-# 1323 "/usr/include/bits/string2.h" 3 4
-extern char *__strndup (__const char *__string, size_t __n)
- __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
-# 424 "/usr/include/string.h" 2 3 4
-# 432 "/usr/include/string.h" 3 4
-
-# 6 "ternary.h" 2
-# 1 "/usr/include/stdlib.h" 1 3 4
-# 33 "/usr/include/stdlib.h" 3 4
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 1 3 4
-# 326 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 3 4
-typedef int wchar_t;
-# 34 "/usr/include/stdlib.h" 2 3 4
-
-
-# 96 "/usr/include/stdlib.h" 3 4
-
-
-typedef struct
- {
- int quot;
- int rem;
- } div_t;
-
-
-
-typedef struct
- {
- long int quot;
- long int rem;
- } ldiv_t;
-
-
-
-# 140 "/usr/include/stdlib.h" 3 4
-extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ;
-
-
-
-
-extern double atof (__const char *__nptr)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
-
-extern int atoi (__const char *__nptr)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
-
-extern long int atol (__const char *__nptr)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-
-
-__extension__ extern long long int atoll (__const char *__nptr)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-
-
-extern double strtod (__const char *__restrict __nptr,
- char **__restrict __endptr)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-# 182 "/usr/include/stdlib.h" 3 4
-
-
-extern long int strtol (__const char *__restrict __nptr,
- char **__restrict __endptr, int __base)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-extern unsigned long int strtoul (__const char *__restrict __nptr,
- char **__restrict __endptr, int __base)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-
-__extension__
-extern long long int strtoq (__const char *__restrict __nptr,
- char **__restrict __endptr, int __base)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-__extension__
-extern unsigned long long int strtouq (__const char *__restrict __nptr,
- char **__restrict __endptr, int __base)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-
-
-__extension__
-extern long long int strtoll (__const char *__restrict __nptr,
- char **__restrict __endptr, int __base)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-__extension__
-extern unsigned long long int strtoull (__const char *__restrict __nptr,
- char **__restrict __endptr, int __base)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-# 277 "/usr/include/stdlib.h" 3 4
-
-extern __inline double
-__attribute__ ((__nothrow__)) atof (__const char *__nptr)
-{
- return strtod (__nptr, (char **) ((void *)0));
-}
-extern __inline int
-__attribute__ ((__nothrow__)) atoi (__const char *__nptr)
-{
- return (int) strtol (__nptr, (char **) ((void *)0), 10);
-}
-extern __inline long int
-__attribute__ ((__nothrow__)) atol (__const char *__nptr)
-{
- return strtol (__nptr, (char **) ((void *)0), 10);
-}
-
-
-
-
-__extension__ extern __inline long long int
-__attribute__ ((__nothrow__)) atoll (__const char *__nptr)
-{
- return strtoll (__nptr, (char **) ((void *)0), 10);
-}
-
-# 311 "/usr/include/stdlib.h" 3 4
-extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ;
-
-
-extern long int a64l (__const char *__s)
- __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-
-# 1 "/usr/include/sys/types.h" 1 3 4
-# 29 "/usr/include/sys/types.h" 3 4
-
-
-
-
-
-
-typedef __u_char u_char;
-typedef __u_short u_short;
-typedef __u_int u_int;
-typedef __u_long u_long;
-typedef __quad_t quad_t;
-typedef __u_quad_t u_quad_t;
-typedef __fsid_t fsid_t;
-
-
-
-
-typedef __loff_t loff_t;
-
-
-
-typedef __ino_t ino_t;
-# 62 "/usr/include/sys/types.h" 3 4
-typedef __dev_t dev_t;
-
-
-
-
-typedef __gid_t gid_t;
-# 77 "/usr/include/sys/types.h" 3 4
-typedef __nlink_t nlink_t;
-
-
-
-
-typedef __uid_t uid_t;
-# 100 "/usr/include/sys/types.h" 3 4
-typedef __pid_t pid_t;
-
-
-
-
-typedef __id_t id_t;
-
-
-
-
-typedef __ssize_t ssize_t;
-
-
-
-
-
-typedef __daddr_t daddr_t;
-typedef __caddr_t caddr_t;
-
-
-
-
-
-typedef __key_t key_t;
-# 133 "/usr/include/sys/types.h" 3 4
-# 1 "/usr/include/time.h" 1 3 4
-# 75 "/usr/include/time.h" 3 4
-
-
-typedef __time_t time_t;
-
-
-
-# 93 "/usr/include/time.h" 3 4
-typedef __clockid_t clockid_t;
-# 105 "/usr/include/time.h" 3 4
-typedef __timer_t timer_t;
-# 134 "/usr/include/sys/types.h" 2 3 4
-# 147 "/usr/include/sys/types.h" 3 4
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 1 3 4
-# 148 "/usr/include/sys/types.h" 2 3 4
-
-
-
-typedef unsigned long int ulong;
-typedef unsigned short int ushort;
-typedef unsigned int uint;
-# 201 "/usr/include/sys/types.h" 3 4
-typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
-typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
-typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
-typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
-
-typedef int register_t __attribute__ ((__mode__ (__word__)));
-# 220 "/usr/include/sys/types.h" 3 4
-# 1 "/usr/include/sys/select.h" 1 3 4
-# 31 "/usr/include/sys/select.h" 3 4
-# 1 "/usr/include/bits/select.h" 1 3 4
-# 32 "/usr/include/sys/select.h" 2 3 4
-
-
-# 1 "/usr/include/bits/sigset.h" 1 3 4
-# 24 "/usr/include/bits/sigset.h" 3 4
-typedef int __sig_atomic_t;
-
-
-
-
-typedef struct
- {
- unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
- } __sigset_t;
-# 35 "/usr/include/sys/select.h" 2 3 4
-
-
-
-typedef __sigset_t sigset_t;
-
-
-
-
-
-# 1 "/usr/include/time.h" 1 3 4
-# 121 "/usr/include/time.h" 3 4
-struct timespec
- {
- __time_t tv_sec;
- long int tv_nsec;
- };
-# 45 "/usr/include/sys/select.h" 2 3 4
-
-# 1 "/usr/include/bits/time.h" 1 3 4
-# 69 "/usr/include/bits/time.h" 3 4
-struct timeval
- {
- __time_t tv_sec;
- __suseconds_t tv_usec;
- };
-# 47 "/usr/include/sys/select.h" 2 3 4
-
-
-typedef __suseconds_t suseconds_t;
-
-
-
-
-
-typedef long int __fd_mask;
-# 67 "/usr/include/sys/select.h" 3 4
-typedef struct
- {
-
-
-
-
-
-
- __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];
-
-
- } fd_set;
-
-
-
-
-
-
-typedef __fd_mask fd_mask;
-# 99 "/usr/include/sys/select.h" 3 4
-
-# 109 "/usr/include/sys/select.h" 3 4
-extern int select (int __nfds, fd_set *__restrict __readfds,
- fd_set *__restrict __writefds,
- fd_set *__restrict __exceptfds,
- struct timeval *__restrict __timeout);
-# 121 "/usr/include/sys/select.h" 3 4
-extern int pselect (int __nfds, fd_set *__restrict __readfds,
- fd_set *__restrict __writefds,
- fd_set *__restrict __exceptfds,
- const struct timespec *__restrict __timeout,
- const __sigset_t *__restrict __sigmask);
-
-
-
-# 221 "/usr/include/sys/types.h" 2 3 4
-
-
-# 1 "/usr/include/sys/sysmacros.h" 1 3 4
-# 30 "/usr/include/sys/sysmacros.h" 3 4
-__extension__
-extern unsigned int gnu_dev_major (unsigned long long int __dev)
- __attribute__ ((__nothrow__));
-__extension__
-extern unsigned int gnu_dev_minor (unsigned long long int __dev)
- __attribute__ ((__nothrow__));
-__extension__
-extern unsigned long long int gnu_dev_makedev (unsigned int __major,
- unsigned int __minor)
- __attribute__ ((__nothrow__));
-
-
-__extension__ extern __inline unsigned int
-__attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
-{
- return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
-}
-
-__extension__ extern __inline unsigned int
-__attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
-{
- return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
-}
-
-__extension__ extern __inline unsigned long long int
-__attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
-{
- return ((__minor & 0xff) | ((__major & 0xfff) << 8)
- | (((unsigned long long int) (__minor & ~0xff)) << 12)
- | (((unsigned long long int) (__major & ~0xfff)) << 32));
-}
-# 224 "/usr/include/sys/types.h" 2 3 4
-# 235 "/usr/include/sys/types.h" 3 4
-typedef __blkcnt_t blkcnt_t;
-
-
-
-typedef __fsblkcnt_t fsblkcnt_t;
-
-
-
-typedef __fsfilcnt_t fsfilcnt_t;
-# 270 "/usr/include/sys/types.h" 3 4
-# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
-# 23 "/usr/include/bits/pthreadtypes.h" 3 4
-# 1 "/usr/include/bits/wordsize.h" 1 3 4
-# 24 "/usr/include/bits/pthreadtypes.h" 2 3 4
-# 50 "/usr/include/bits/pthreadtypes.h" 3 4
-typedef unsigned long int pthread_t;
-
-
-typedef union
-{
- char __size[36];
- long int __align;
-} pthread_attr_t;
-# 67 "/usr/include/bits/pthreadtypes.h" 3 4
-typedef struct __pthread_internal_slist
-{
- struct __pthread_internal_slist *__next;
-} __pthread_slist_t;
-
-
-
-
-
-typedef union
-{
- struct __pthread_mutex_s
- {
- int __lock;
- unsigned int __count;
- int __owner;
-
-
-
-
-
- int __kind;
-
-
-
-
-
- unsigned int __nusers;
- __extension__ union
- {
- int __spins;
- __pthread_slist_t __list;
- };
-
- } __data;
- char __size[24];
- long int __align;
-} pthread_mutex_t;
-
-typedef union
-{
- char __size[4];
- int __align;
-} pthread_mutexattr_t;
-
-
-
-
-typedef union
-{
- struct
- {
- int __lock;
- unsigned int __futex;
- __extension__ unsigned long long int __total_seq;
- __extension__ unsigned long long int __wakeup_seq;
- __extension__ unsigned long long int __woken_seq;
- void *__mutex;
- unsigned int __nwaiters;
- unsigned int __broadcast_seq;
- } __data;
- char __size[48];
- __extension__ long long int __align;
-} pthread_cond_t;
-
-typedef union
-{
- char __size[4];
- int __align;
-} pthread_condattr_t;
-
-
-
-typedef unsigned int pthread_key_t;
-
-
-
-typedef int pthread_once_t;
-
-
-
-
-
-typedef union
-{
-# 170 "/usr/include/bits/pthreadtypes.h" 3 4
- struct
- {
- int __lock;
- unsigned int __nr_readers;
- unsigned int __readers_wakeup;
- unsigned int __writer_wakeup;
- unsigned int __nr_readers_queued;
- unsigned int __nr_writers_queued;
-
-
- unsigned char __flags;
- unsigned char __shared;
- unsigned char __pad1;
- unsigned char __pad2;
- int __writer;
- } __data;
-
- char __size[32];
- long int __align;
-} pthread_rwlock_t;
-
-typedef union
-{
- char __size[8];
- long int __align;
-} pthread_rwlockattr_t;
-
-
-
-
-
-typedef volatile int pthread_spinlock_t;
-
-
-
-
-typedef union
-{
- char __size[20];
- long int __align;
-} pthread_barrier_t;
-
-typedef union
-{
- char __size[4];
- int __align;
-} pthread_barrierattr_t;
-# 271 "/usr/include/sys/types.h" 2 3 4
-
-
-
-# 321 "/usr/include/stdlib.h" 2 3 4
-
-
-
-
-
-
-extern long int random (void) __attribute__ ((__nothrow__));
-
-
-extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__));
-
-
-
-
-
-extern char *initstate (unsigned int __seed, char *__statebuf,
- size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
-
-
-
-extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-
-
-
-struct random_data
- {
- int32_t *fptr;
- int32_t *rptr;
- int32_t *state;
- int rand_type;
- int rand_deg;
- int rand_sep;
- int32_t *end_ptr;
- };
-
-extern int random_r (struct random_data *__restrict __buf,
- int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-extern int srandom_r (unsigned int __seed, struct random_data *__buf)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
-
-extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
- size_t __statelen,
- struct random_data *__restrict __buf)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
-
-extern int setstate_r (char *__restrict __statebuf,
- struct random_data *__restrict __buf)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-
-
-
-
-extern int rand (void) __attribute__ ((__nothrow__));
-
-extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));
-
-
-
-
-extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-
-extern double drand48 (void) __attribute__ ((__nothrow__));
-extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-extern long int lrand48 (void) __attribute__ ((__nothrow__));
-extern long int nrand48 (unsigned short int __xsubi[3])
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-extern long int mrand48 (void) __attribute__ ((__nothrow__));
-extern long int jrand48 (unsigned short int __xsubi[3])
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-extern void srand48 (long int __seedval) __attribute__ ((__nothrow__));
-extern unsigned short int *seed48 (unsigned short int __seed16v[3])
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-
-struct drand48_data
- {
- unsigned short int __x[3];
- unsigned short int __old_x[3];
- unsigned short int __c;
- unsigned short int __init;
- unsigned long long int __a;
- };
-
-
-extern int drand48_r (struct drand48_data *__restrict __buffer,
- double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-extern int erand48_r (unsigned short int __xsubi[3],
- struct drand48_data *__restrict __buffer,
- double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern int lrand48_r (struct drand48_data *__restrict __buffer,
- long int *__restrict __result)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-extern int nrand48_r (unsigned short int __xsubi[3],
- struct drand48_data *__restrict __buffer,
- long int *__restrict __result)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern int mrand48_r (struct drand48_data *__restrict __buffer,
- long int *__restrict __result)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-extern int jrand48_r (unsigned short int __xsubi[3],
- struct drand48_data *__restrict __buffer,
- long int *__restrict __result)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
-
-extern int seed48_r (unsigned short int __seed16v[3],
- struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-extern int lcong48_r (unsigned short int __param[7],
- struct drand48_data *__buffer)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-# 479 "/usr/include/stdlib.h" 3 4
-
-
-
-
-
-
-extern void *realloc (void *__ptr, size_t __size)
- __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
-
-extern void free (void *__ptr) __attribute__ ((__nothrow__));
-
-
-
-
-extern void cfree (void *__ptr) __attribute__ ((__nothrow__));
-
-
-
-# 1 "/usr/include/alloca.h" 1 3 4
-# 25 "/usr/include/alloca.h" 3 4
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 1 3 4
-# 26 "/usr/include/alloca.h" 2 3 4
-
-
-
-
-
-
-
-extern void *alloca (size_t __size) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-# 498 "/usr/include/stdlib.h" 2 3 4
-
-
-
-
-extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
-
-
-
-
-extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-
-extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
-
-
-
-extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-
-extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-
-
-extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
-
-# 543 "/usr/include/stdlib.h" 3 4
-
-
-extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-
-extern char *__secure_getenv (__const char *__name)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-
-
-extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-
-extern int setenv (__const char *__name, __const char *__value, int __replace)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
-
-
-extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-extern int clearenv (void) __attribute__ ((__nothrow__));
-# 583 "/usr/include/stdlib.h" 3 4
-extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-# 594 "/usr/include/stdlib.h" 3 4
-extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
-# 614 "/usr/include/stdlib.h" 3 4
-extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-# 640 "/usr/include/stdlib.h" 3 4
-
-
-
-
-
-extern int system (__const char *__command) ;
-
-# 662 "/usr/include/stdlib.h" 3 4
-extern char *realpath (__const char *__restrict __name,
- char *__restrict __resolved) __attribute__ ((__nothrow__)) ;
-
-
-
-
-
-
-typedef int (*__compar_fn_t) (__const void *, __const void *);
-
-
-
-
-
-
-
-
-
-extern void *bsearch (__const void *__key, __const void *__base,
- size_t __nmemb, size_t __size, __compar_fn_t __compar)
- __attribute__ ((__nonnull__ (1, 2, 5))) ;
-
-
-
-extern void qsort (void *__base, size_t __nmemb, size_t __size,
- __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
-
-
-
-extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
-extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
-
-
-
-
-
-
-
-
-
-
-
-
-extern div_t div (int __numer, int __denom)
- __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
-extern ldiv_t ldiv (long int __numer, long int __denom)
- __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
-
-# 727 "/usr/include/stdlib.h" 3 4
-extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
- int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
-
-
-
-
-extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
- int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
-
-
-
-
-extern char *gcvt (double __value, int __ndigit, char *__buf)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;
-
-
-
-
-extern char *qecvt (long double __value, int __ndigit,
- int *__restrict __decpt, int *__restrict __sign)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
-extern char *qfcvt (long double __value, int __ndigit,
- int *__restrict __decpt, int *__restrict __sign)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
-extern char *qgcvt (long double __value, int __ndigit, char *__buf)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;
-
-
-
-
-extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
- int *__restrict __sign, char *__restrict __buf,
- size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
-extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
- int *__restrict __sign, char *__restrict __buf,
- size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
-
-extern int qecvt_r (long double __value, int __ndigit,
- int *__restrict __decpt, int *__restrict __sign,
- char *__restrict __buf, size_t __len)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
-extern int qfcvt_r (long double __value, int __ndigit,
- int *__restrict __decpt, int *__restrict __sign,
- char *__restrict __buf, size_t __len)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
-
-
-
-
-
-
-
-extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ;
-
-
-extern int mbtowc (wchar_t *__restrict __pwc,
- __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ;
-
-
-extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ;
-
-
-
-extern size_t mbstowcs (wchar_t *__restrict __pwcs,
- __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));
-
-extern size_t wcstombs (char *__restrict __s,
- __const wchar_t *__restrict __pwcs, size_t __n)
- __attribute__ ((__nothrow__));
-
-
-
-
-
-
-
-
-extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-# 832 "/usr/include/stdlib.h" 3 4
-extern int posix_openpt (int __oflag) ;
-# 867 "/usr/include/stdlib.h" 3 4
-extern int getloadavg (double __loadavg[], int __nelem)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-# 883 "/usr/include/stdlib.h" 3 4
-
-# 7 "ternary.h" 2
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stdbool.h" 1 3 4
-# 8 "ternary.h" 2
-# 1 "/usr/include/unistd.h" 1 3 4
-# 28 "/usr/include/unistd.h" 3 4
-
-# 173 "/usr/include/unistd.h" 3 4
-# 1 "/usr/include/bits/posix_opt.h" 1 3 4
-# 174 "/usr/include/unistd.h" 2 3 4
-# 197 "/usr/include/unistd.h" 3 4
-# 1 "/usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h" 1 3 4
-# 198 "/usr/include/unistd.h" 2 3 4
-# 226 "/usr/include/unistd.h" 3 4
-typedef __useconds_t useconds_t;
-# 245 "/usr/include/unistd.h" 3 4
-typedef __socklen_t socklen_t;
-# 258 "/usr/include/unistd.h" 3 4
-extern int access (__const char *__name, int __type) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-# 301 "/usr/include/unistd.h" 3 4
-extern __off_t lseek (int __fd, __off_t __offset, int __whence) __attribute__ ((__nothrow__));
-# 320 "/usr/include/unistd.h" 3 4
-extern int close (int __fd);
-
-
-
-
-
-
-extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ;
-
-
-
-
-
-extern ssize_t write (int __fd, __const void *__buf, size_t __n) ;
-# 384 "/usr/include/unistd.h" 3 4
-extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__)) ;
-# 393 "/usr/include/unistd.h" 3 4
-extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__));
-# 405 "/usr/include/unistd.h" 3 4
-extern unsigned int sleep (unsigned int __seconds);
-
-
-
-
-
-
-extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
- __attribute__ ((__nothrow__));
-
-
-
-
-
-
-extern int usleep (__useconds_t __useconds);
-# 429 "/usr/include/unistd.h" 3 4
-extern int pause (void);
-
-
-
-extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__)) ;
-
-
-
-
-extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-# 457 "/usr/include/unistd.h" 3 4
-extern int chdir (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-extern int fchdir (int __fd) __attribute__ ((__nothrow__)) ;
-# 471 "/usr/include/unistd.h" 3 4
-extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__)) ;
-# 484 "/usr/include/unistd.h" 3 4
-extern char *getwd (char *__buf)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ;
-
-
-
-
-extern int dup (int __fd) __attribute__ ((__nothrow__)) ;
-
-
-extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__));
-
-
-extern char **__environ;
-
-
-
-
-
-
-
-extern int execve (__const char *__path, char *__const __argv[],
- char *__const __envp[]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-# 516 "/usr/include/unistd.h" 3 4
-extern int execv (__const char *__path, char *__const __argv[])
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-extern int execle (__const char *__path, __const char *__arg, ...)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-extern int execl (__const char *__path, __const char *__arg, ...)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-extern int execvp (__const char *__file, char *__const __argv[])
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-extern int execlp (__const char *__file, __const char *__arg, ...)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-extern int nice (int __inc) __attribute__ ((__nothrow__)) ;
-
-
-
-
-extern void _exit (int __status) __attribute__ ((__noreturn__));
-
-
-
-
-
-# 1 "/usr/include/bits/confname.h" 1 3 4
-# 26 "/usr/include/bits/confname.h" 3 4
-enum
- {
- _PC_LINK_MAX,
-
- _PC_MAX_CANON,
-
- _PC_MAX_INPUT,
-
- _PC_NAME_MAX,
-
- _PC_PATH_MAX,
-
- _PC_PIPE_BUF,
-
- _PC_CHOWN_RESTRICTED,
-
- _PC_NO_TRUNC,
-
- _PC_VDISABLE,
-
- _PC_SYNC_IO,
-
- _PC_ASYNC_IO,
-
- _PC_PRIO_IO,
-
- _PC_SOCK_MAXBUF,
-
- _PC_FILESIZEBITS,
-
- _PC_REC_INCR_XFER_SIZE,
-
- _PC_REC_MAX_XFER_SIZE,
-
- _PC_REC_MIN_XFER_SIZE,
-
- _PC_REC_XFER_ALIGN,
-
- _PC_ALLOC_SIZE_MIN,
-
- _PC_SYMLINK_MAX,
-
- _PC_2_SYMLINKS
-
- };
-
-
-enum
- {
- _SC_ARG_MAX,
-
- _SC_CHILD_MAX,
-
- _SC_CLK_TCK,
-
- _SC_NGROUPS_MAX,
-
- _SC_OPEN_MAX,
-
- _SC_STREAM_MAX,
-
- _SC_TZNAME_MAX,
-
- _SC_JOB_CONTROL,
-
- _SC_SAVED_IDS,
-
- _SC_REALTIME_SIGNALS,
-
- _SC_PRIORITY_SCHEDULING,
-
- _SC_TIMERS,
-
- _SC_ASYNCHRONOUS_IO,
-
- _SC_PRIORITIZED_IO,
-
- _SC_SYNCHRONIZED_IO,
-
- _SC_FSYNC,
-
- _SC_MAPPED_FILES,
-
- _SC_MEMLOCK,
-
- _SC_MEMLOCK_RANGE,
-
- _SC_MEMORY_PROTECTION,
-
- _SC_MESSAGE_PASSING,
-
- _SC_SEMAPHORES,
-
- _SC_SHARED_MEMORY_OBJECTS,
-
- _SC_AIO_LISTIO_MAX,
-
- _SC_AIO_MAX,
-
- _SC_AIO_PRIO_DELTA_MAX,
-
- _SC_DELAYTIMER_MAX,
-
- _SC_MQ_OPEN_MAX,
-
- _SC_MQ_PRIO_MAX,
-
- _SC_VERSION,
-
- _SC_PAGESIZE,
-
-
- _SC_RTSIG_MAX,
-
- _SC_SEM_NSEMS_MAX,
-
- _SC_SEM_VALUE_MAX,
-
- _SC_SIGQUEUE_MAX,
-
- _SC_TIMER_MAX,
-
-
-
-
- _SC_BC_BASE_MAX,
-
- _SC_BC_DIM_MAX,
-
- _SC_BC_SCALE_MAX,
-
- _SC_BC_STRING_MAX,
-
- _SC_COLL_WEIGHTS_MAX,
-
- _SC_EQUIV_CLASS_MAX,
-
- _SC_EXPR_NEST_MAX,
-
- _SC_LINE_MAX,
-
- _SC_RE_DUP_MAX,
-
- _SC_CHARCLASS_NAME_MAX,
-
-
- _SC_2_VERSION,
-
- _SC_2_C_BIND,
-
- _SC_2_C_DEV,
-
- _SC_2_FORT_DEV,
-
- _SC_2_FORT_RUN,
-
- _SC_2_SW_DEV,
-
- _SC_2_LOCALEDEF,
-
-
- _SC_PII,
-
- _SC_PII_XTI,
-
- _SC_PII_SOCKET,
-
- _SC_PII_INTERNET,
-
- _SC_PII_OSI,
-
- _SC_POLL,
-
- _SC_SELECT,
-
- _SC_UIO_MAXIOV,
-
- _SC_IOV_MAX = _SC_UIO_MAXIOV,
-
- _SC_PII_INTERNET_STREAM,
-
- _SC_PII_INTERNET_DGRAM,
-
- _SC_PII_OSI_COTS,
-
- _SC_PII_OSI_CLTS,
-
- _SC_PII_OSI_M,
-
- _SC_T_IOV_MAX,
-
-
-
- _SC_THREADS,
-
- _SC_THREAD_SAFE_FUNCTIONS,
-
- _SC_GETGR_R_SIZE_MAX,
-
- _SC_GETPW_R_SIZE_MAX,
-
- _SC_LOGIN_NAME_MAX,
-
- _SC_TTY_NAME_MAX,
-
- _SC_THREAD_DESTRUCTOR_ITERATIONS,
-
- _SC_THREAD_KEYS_MAX,
-
- _SC_THREAD_STACK_MIN,
-
- _SC_THREAD_THREADS_MAX,
-
- _SC_THREAD_ATTR_STACKADDR,
-
- _SC_THREAD_ATTR_STACKSIZE,
-
- _SC_THREAD_PRIORITY_SCHEDULING,
-
- _SC_THREAD_PRIO_INHERIT,
-
- _SC_THREAD_PRIO_PROTECT,
-
- _SC_THREAD_PROCESS_SHARED,
-
-
- _SC_NPROCESSORS_CONF,
-
- _SC_NPROCESSORS_ONLN,
-
- _SC_PHYS_PAGES,
-
- _SC_AVPHYS_PAGES,
-
- _SC_ATEXIT_MAX,
-
- _SC_PASS_MAX,
-
-
- _SC_XOPEN_VERSION,
-
- _SC_XOPEN_XCU_VERSION,
-
- _SC_XOPEN_UNIX,
-
- _SC_XOPEN_CRYPT,
-
- _SC_XOPEN_ENH_I18N,
-
- _SC_XOPEN_SHM,
-
-
- _SC_2_CHAR_TERM,
-
- _SC_2_C_VERSION,
-
- _SC_2_UPE,
-
-
- _SC_XOPEN_XPG2,
-
- _SC_XOPEN_XPG3,
-
- _SC_XOPEN_XPG4,
-
-
- _SC_CHAR_BIT,
-
- _SC_CHAR_MAX,
-
- _SC_CHAR_MIN,
-
- _SC_INT_MAX,
-
- _SC_INT_MIN,
-
- _SC_LONG_BIT,
-
- _SC_WORD_BIT,
-
- _SC_MB_LEN_MAX,
-
- _SC_NZERO,
-
- _SC_SSIZE_MAX,
-
- _SC_SCHAR_MAX,
-
- _SC_SCHAR_MIN,
-
- _SC_SHRT_MAX,
-
- _SC_SHRT_MIN,
-
- _SC_UCHAR_MAX,
-
- _SC_UINT_MAX,
-
- _SC_ULONG_MAX,
-
- _SC_USHRT_MAX,
-
-
- _SC_NL_ARGMAX,
-
- _SC_NL_LANGMAX,
-
- _SC_NL_MSGMAX,
-
- _SC_NL_NMAX,
-
- _SC_NL_SETMAX,
-
- _SC_NL_TEXTMAX,
-
-
- _SC_XBS5_ILP32_OFF32,
-
- _SC_XBS5_ILP32_OFFBIG,
-
- _SC_XBS5_LP64_OFF64,
-
- _SC_XBS5_LPBIG_OFFBIG,
-
-
- _SC_XOPEN_LEGACY,
-
- _SC_XOPEN_REALTIME,
-
- _SC_XOPEN_REALTIME_THREADS,
-
-
- _SC_ADVISORY_INFO,
-
- _SC_BARRIERS,
-
- _SC_BASE,
-
- _SC_C_LANG_SUPPORT,
-
- _SC_C_LANG_SUPPORT_R,
-
- _SC_CLOCK_SELECTION,
-
- _SC_CPUTIME,
-
- _SC_THREAD_CPUTIME,
-
- _SC_DEVICE_IO,
-
- _SC_DEVICE_SPECIFIC,
-
- _SC_DEVICE_SPECIFIC_R,
-
- _SC_FD_MGMT,
-
- _SC_FIFO,
-
- _SC_PIPE,
-
- _SC_FILE_ATTRIBUTES,
-
- _SC_FILE_LOCKING,
-
- _SC_FILE_SYSTEM,
-
- _SC_MONOTONIC_CLOCK,
-
- _SC_MULTI_PROCESS,
-
- _SC_SINGLE_PROCESS,
-
- _SC_NETWORKING,
-
- _SC_READER_WRITER_LOCKS,
-
- _SC_SPIN_LOCKS,
-
- _SC_REGEXP,
-
- _SC_REGEX_VERSION,
-
- _SC_SHELL,
-
- _SC_SIGNALS,
-
- _SC_SPAWN,
-
- _SC_SPORADIC_SERVER,
-
- _SC_THREAD_SPORADIC_SERVER,
-
- _SC_SYSTEM_DATABASE,
-
- _SC_SYSTEM_DATABASE_R,
-
- _SC_TIMEOUTS,
-
- _SC_TYPED_MEMORY_OBJECTS,
-
- _SC_USER_GROUPS,
-
- _SC_USER_GROUPS_R,
-
- _SC_2_PBS,
-
- _SC_2_PBS_ACCOUNTING,
-
- _SC_2_PBS_LOCATE,
-
- _SC_2_PBS_MESSAGE,
-
- _SC_2_PBS_TRACK,
-
- _SC_SYMLOOP_MAX,
-
- _SC_STREAMS,
-
- _SC_2_PBS_CHECKPOINT,
-
-
- _SC_V6_ILP32_OFF32,
-
- _SC_V6_ILP32_OFFBIG,
-
- _SC_V6_LP64_OFF64,
-
- _SC_V6_LPBIG_OFFBIG,
-
-
- _SC_HOST_NAME_MAX,
-
- _SC_TRACE,
-
- _SC_TRACE_EVENT_FILTER,
-
- _SC_TRACE_INHERIT,
-
- _SC_TRACE_LOG,
-
-
- _SC_LEVEL1_ICACHE_SIZE,
-
- _SC_LEVEL1_ICACHE_ASSOC,
-
- _SC_LEVEL1_ICACHE_LINESIZE,
-
- _SC_LEVEL1_DCACHE_SIZE,
-
- _SC_LEVEL1_DCACHE_ASSOC,
-
- _SC_LEVEL1_DCACHE_LINESIZE,
-
- _SC_LEVEL2_CACHE_SIZE,
-
- _SC_LEVEL2_CACHE_ASSOC,
-
- _SC_LEVEL2_CACHE_LINESIZE,
-
- _SC_LEVEL3_CACHE_SIZE,
-
- _SC_LEVEL3_CACHE_ASSOC,
-
- _SC_LEVEL3_CACHE_LINESIZE,
-
- _SC_LEVEL4_CACHE_SIZE,
-
- _SC_LEVEL4_CACHE_ASSOC,
-
- _SC_LEVEL4_CACHE_LINESIZE,
-
-
-
- _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
-
- _SC_RAW_SOCKETS
-
- };
-
-
-enum
- {
- _CS_PATH,
-
-
- _CS_V6_WIDTH_RESTRICTED_ENVS,
-
-
-
- _CS_GNU_LIBC_VERSION,
-
- _CS_GNU_LIBPTHREAD_VERSION,
-
-
- _CS_LFS_CFLAGS = 1000,
-
- _CS_LFS_LDFLAGS,
-
- _CS_LFS_LIBS,
-
- _CS_LFS_LINTFLAGS,
-
- _CS_LFS64_CFLAGS,
-
- _CS_LFS64_LDFLAGS,
-
- _CS_LFS64_LIBS,
-
- _CS_LFS64_LINTFLAGS,
-
-
- _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
-
- _CS_XBS5_ILP32_OFF32_LDFLAGS,
-
- _CS_XBS5_ILP32_OFF32_LIBS,
-
- _CS_XBS5_ILP32_OFF32_LINTFLAGS,
-
- _CS_XBS5_ILP32_OFFBIG_CFLAGS,
-
- _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
-
- _CS_XBS5_ILP32_OFFBIG_LIBS,
-
- _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
-
- _CS_XBS5_LP64_OFF64_CFLAGS,
-
- _CS_XBS5_LP64_OFF64_LDFLAGS,
-
- _CS_XBS5_LP64_OFF64_LIBS,
-
- _CS_XBS5_LP64_OFF64_LINTFLAGS,
-
- _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
-
- _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
-
- _CS_XBS5_LPBIG_OFFBIG_LIBS,
-
- _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
-
-
- _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
-
- _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
-
- _CS_POSIX_V6_ILP32_OFF32_LIBS,
-
- _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
-
- _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
-
- _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
-
- _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
-
- _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
-
- _CS_POSIX_V6_LP64_OFF64_CFLAGS,
-
- _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
-
- _CS_POSIX_V6_LP64_OFF64_LIBS,
-
- _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
-
- _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
-
- _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
-
- _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
-
- _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
-
- };
-# 555 "/usr/include/unistd.h" 2 3 4
-
-
-extern long int pathconf (__const char *__path, int __name)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__));
-
-
-extern long int sysconf (int __name) __attribute__ ((__nothrow__));
-
-
-
-extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__));
-
-
-
-
-extern __pid_t getpid (void) __attribute__ ((__nothrow__));
-
-
-extern __pid_t getppid (void) __attribute__ ((__nothrow__));
-
-
-
-
-extern __pid_t getpgrp (void) __attribute__ ((__nothrow__));
-# 591 "/usr/include/unistd.h" 3 4
-extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__));
-# 600 "/usr/include/unistd.h" 3 4
-extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__));
-# 617 "/usr/include/unistd.h" 3 4
-extern int setpgrp (void) __attribute__ ((__nothrow__));
-# 634 "/usr/include/unistd.h" 3 4
-extern __pid_t setsid (void) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-
-extern __uid_t getuid (void) __attribute__ ((__nothrow__));
-
-
-extern __uid_t geteuid (void) __attribute__ ((__nothrow__));
-
-
-extern __gid_t getgid (void) __attribute__ ((__nothrow__));
-
-
-extern __gid_t getegid (void) __attribute__ ((__nothrow__));
-
-
-
-
-extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__)) ;
-# 667 "/usr/include/unistd.h" 3 4
-extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__));
-
-
-
-
-extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__));
-
-
-
-
-extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__));
-
-
-
-
-extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__));
-
-
-
-
-extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__));
-# 723 "/usr/include/unistd.h" 3 4
-extern __pid_t fork (void) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-extern __pid_t vfork (void) __attribute__ ((__nothrow__));
-
-
-
-
-
-extern char *ttyname (int __fd) __attribute__ ((__nothrow__));
-
-
-
-extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) ;
-
-
-
-extern int isatty (int __fd) __attribute__ ((__nothrow__));
-
-
-
-
-
-extern int ttyslot (void) __attribute__ ((__nothrow__));
-
-
-
-
-extern int link (__const char *__from, __const char *__to)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ;
-# 769 "/usr/include/unistd.h" 3 4
-extern int symlink (__const char *__from, __const char *__to)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ;
-
-
-
-
-extern ssize_t readlink (__const char *__restrict __path,
- char *__restrict __buf, size_t __len)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ;
-# 792 "/usr/include/unistd.h" 3 4
-extern int unlink (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-# 801 "/usr/include/unistd.h" 3 4
-extern int rmdir (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__));
-
-
-extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__));
-
-
-
-
-
-
-extern char *getlogin (void);
-
-
-
-
-
-
-
-extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-extern int setlogin (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-# 837 "/usr/include/unistd.h" 3 4
-# 1 "/usr/include/getopt.h" 1 3 4
-# 59 "/usr/include/getopt.h" 3 4
-extern char *optarg;
-# 73 "/usr/include/getopt.h" 3 4
-extern int optind;
-
-
-
-
-extern int opterr;
-
-
-
-extern int optopt;
-# 152 "/usr/include/getopt.h" 3 4
-extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
- __attribute__ ((__nothrow__));
-# 838 "/usr/include/unistd.h" 2 3 4
-
-
-
-
-
-
-
-extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-
-
-extern int sethostname (__const char *__name, size_t __len)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-extern int sethostid (long int __id) __attribute__ ((__nothrow__)) ;
-
-
-
-
-
-extern int getdomainname (char *__name, size_t __len)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-extern int setdomainname (__const char *__name, size_t __len)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-
-
-extern int vhangup (void) __attribute__ ((__nothrow__));
-
-
-extern int revoke (__const char *__file) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-
-
-
-
-extern int profil (unsigned short int *__sample_buffer, size_t __size,
- size_t __offset, unsigned int __scale)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-
-extern int acct (__const char *__name) __attribute__ ((__nothrow__));
-
-
-
-extern char *getusershell (void) __attribute__ ((__nothrow__));
-extern void endusershell (void) __attribute__ ((__nothrow__));
-extern void setusershell (void) __attribute__ ((__nothrow__));
-
-
-
-
-
-extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__)) ;
-
-
-
-
-
-
-extern int chroot (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-
-
-
-extern char *getpass (__const char *__prompt) __attribute__ ((__nonnull__ (1)));
-# 923 "/usr/include/unistd.h" 3 4
-extern int fsync (int __fd);
-
-
-
-
-
-
-extern long int gethostid (void);
-
-
-extern void sync (void) __attribute__ ((__nothrow__));
-
-
-
-
-extern int getpagesize (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
-
-
-
-
-extern int getdtablesize (void) __attribute__ ((__nothrow__));
-
-
-
-
-extern int truncate (__const char *__file, __off_t __length)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
-# 970 "/usr/include/unistd.h" 3 4
-extern int ftruncate (int __fd, __off_t __length) __attribute__ ((__nothrow__)) ;
-# 990 "/usr/include/unistd.h" 3 4
-extern int brk (void *__addr) __attribute__ ((__nothrow__)) ;
-
-
-
-
-
-extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__));
-# 1011 "/usr/include/unistd.h" 3 4
-extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__));
-# 1034 "/usr/include/unistd.h" 3 4
-extern int lockf (int __fd, int __cmd, __off_t __len) ;
-# 1065 "/usr/include/unistd.h" 3 4
-extern int fdatasync (int __fildes);
-# 1103 "/usr/include/unistd.h" 3 4
-
-# 9 "ternary.h" 2
-# 1 "/usr/include/ctype.h" 1 3 4
-# 30 "/usr/include/ctype.h" 3 4
-
-# 48 "/usr/include/ctype.h" 3 4
-enum
-{
- _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
- _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
- _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
- _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
- _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
- _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
- _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
- _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
- _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
- _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
- _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
- _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
-};
-# 81 "/usr/include/ctype.h" 3 4
-extern __const unsigned short int **__ctype_b_loc (void)
- __attribute__ ((__const));
-extern __const __int32_t **__ctype_tolower_loc (void)
- __attribute__ ((__const));
-extern __const __int32_t **__ctype_toupper_loc (void)
- __attribute__ ((__const));
-# 96 "/usr/include/ctype.h" 3 4
-
-
-
-
-
-
-extern int isalnum (int) __attribute__ ((__nothrow__));
-extern int isalpha (int) __attribute__ ((__nothrow__));
-extern int iscntrl (int) __attribute__ ((__nothrow__));
-extern int isdigit (int) __attribute__ ((__nothrow__));
-extern int islower (int) __attribute__ ((__nothrow__));
-extern int isgraph (int) __attribute__ ((__nothrow__));
-extern int isprint (int) __attribute__ ((__nothrow__));
-extern int ispunct (int) __attribute__ ((__nothrow__));
-extern int isspace (int) __attribute__ ((__nothrow__));
-extern int isupper (int) __attribute__ ((__nothrow__));
-extern int isxdigit (int) __attribute__ ((__nothrow__));
-
-
-
-extern int tolower (int __c) __attribute__ ((__nothrow__));
-
-
-extern int toupper (int __c) __attribute__ ((__nothrow__));
-
-
-# 142 "/usr/include/ctype.h" 3 4
-extern int isascii (int __c) __attribute__ ((__nothrow__));
-
-
-
-extern int toascii (int __c) __attribute__ ((__nothrow__));
-
-
-
-extern int _toupper (int) __attribute__ ((__nothrow__));
-extern int _tolower (int) __attribute__ ((__nothrow__));
-# 190 "/usr/include/ctype.h" 3 4
-extern __inline int
-__attribute__ ((__nothrow__)) tolower (int __c)
-{
- return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
-}
-
-extern __inline int
-__attribute__ ((__nothrow__)) toupper (int __c)
-{
- return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
-}
-# 323 "/usr/include/ctype.h" 3 4
-
-# 10 "ternary.h" 2
-# 1 "debug.h" 1
-
-
-
-
-# 1 "/usr/include/errno.h" 1 3 4
-# 6 "debug.h" 2
-# 29 "debug.h"
-static _Bool debug = 0;
-# 11 "ternary.h" 2
-# 1 "safe.h" 1
-
-
-
-# 1 "/usr/include/fcntl.h" 1 3 4
-# 30 "/usr/include/fcntl.h" 3 4
-
-
-
-
-# 1 "/usr/include/bits/fcntl.h" 1 3 4
-# 25 "/usr/include/bits/fcntl.h" 3 4
-# 1 "/usr/include/bits/wordsize.h" 1 3 4
-# 26 "/usr/include/bits/fcntl.h" 2 3 4
-# 158 "/usr/include/bits/fcntl.h" 3 4
-struct flock
- {
- short int l_type;
- short int l_whence;
-
- __off_t l_start;
- __off_t l_len;
-
-
-
-
- __pid_t l_pid;
- };
-# 225 "/usr/include/bits/fcntl.h" 3 4
-
-# 254 "/usr/include/bits/fcntl.h" 3 4
-
-# 35 "/usr/include/fcntl.h" 2 3 4
-# 76 "/usr/include/fcntl.h" 3 4
-extern int fcntl (int __fd, int __cmd, ...);
-# 85 "/usr/include/fcntl.h" 3 4
-extern int open (__const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
-# 130 "/usr/include/fcntl.h" 3 4
-extern int creat (__const char *__file, __mode_t __mode) __attribute__ ((__nonnull__ (1)));
-# 176 "/usr/include/fcntl.h" 3 4
-extern int posix_fadvise (int __fd, __off_t __offset, __off_t __len,
- int __advise) __attribute__ ((__nothrow__));
-# 198 "/usr/include/fcntl.h" 3 4
-extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len);
-# 220 "/usr/include/fcntl.h" 3 4
-
-# 5 "safe.h" 2
-
-
-
-
-# 1 "/usr/include/sys/stat.h" 1 3 4
-# 39 "/usr/include/sys/stat.h" 3 4
-# 1 "/usr/include/time.h" 1 3 4
-# 40 "/usr/include/sys/stat.h" 2 3 4
-# 105 "/usr/include/sys/stat.h" 3 4
-
-
-# 1 "/usr/include/bits/stat.h" 1 3 4
-# 43 "/usr/include/bits/stat.h" 3 4
-struct stat
- {
- __dev_t st_dev;
-
- unsigned short int __pad1;
-
-
- __ino_t st_ino;
-
-
-
-
- __mode_t st_mode;
- __nlink_t st_nlink;
-
-
-
-
- __uid_t st_uid;
- __gid_t st_gid;
-
-
-
- __dev_t st_rdev;
-
- unsigned short int __pad2;
-
-
- __off_t st_size;
-
-
-
- __blksize_t st_blksize;
-
- __blkcnt_t st_blocks;
-# 88 "/usr/include/bits/stat.h" 3 4
- struct timespec st_atim;
- struct timespec st_mtim;
- struct timespec st_ctim;
-# 106 "/usr/include/bits/stat.h" 3 4
- unsigned long int __unused4;
- unsigned long int __unused5;
-
-
-
-
- };
-# 108 "/usr/include/sys/stat.h" 2 3 4
-# 209 "/usr/include/sys/stat.h" 3 4
-extern int stat (__const char *__restrict __file,
- struct stat *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-
-
-
-extern int fstat (int __fd, struct stat *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
-# 261 "/usr/include/sys/stat.h" 3 4
-extern int lstat (__const char *__restrict __file,
- struct stat *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
-# 282 "/usr/include/sys/stat.h" 3 4
-extern int chmod (__const char *__file, __mode_t __mode)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-
-extern int lchmod (__const char *__file, __mode_t __mode)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-
-
-
-
-extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__));
-# 309 "/usr/include/sys/stat.h" 3 4
-extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__));
-# 318 "/usr/include/sys/stat.h" 3 4
-extern int mkdir (__const char *__path, __mode_t __mode)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-# 333 "/usr/include/sys/stat.h" 3 4
-extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-# 347 "/usr/include/sys/stat.h" 3 4
-extern int mkfifo (__const char *__path, __mode_t __mode)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
-# 397 "/usr/include/sys/stat.h" 3 4
-extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));
-extern int __xstat (int __ver, __const char *__filename,
- struct stat *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
-extern int __lxstat (int __ver, __const char *__filename,
- struct stat *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
-extern int __fxstatat (int __ver, int __fildes, __const char *__filename,
- struct stat *__stat_buf, int __flag)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4)));
-# 440 "/usr/include/sys/stat.h" 3 4
-extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
- __dev_t *__dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
-
-extern int __xmknodat (int __ver, int __fd, __const char *__path,
- __mode_t __mode, __dev_t *__dev)
- __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 5)));
-
-
-
-
-extern __inline int
-__attribute__ ((__nothrow__)) stat (__const char *__path, struct stat *__statbuf)
-{
- return __xstat (3, __path, __statbuf);
-}
-
-
-extern __inline int
-__attribute__ ((__nothrow__)) lstat (__const char *__path, struct stat *__statbuf)
-{
- return __lxstat (3, __path, __statbuf);
-}
-
-
-extern __inline int
-__attribute__ ((__nothrow__)) fstat (int __fd, struct stat *__statbuf)
-{
- return __fxstat (3, __fd, __statbuf);
-}
-# 480 "/usr/include/sys/stat.h" 3 4
-extern __inline int
-__attribute__ ((__nothrow__)) mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
-{
- return __xmknod (1, __path, __mode, &__dev);
-}
-# 532 "/usr/include/sys/stat.h" 3 4
-
-# 10 "safe.h" 2
-
-
-typedef unsigned char uchar_t;
-
-void *xalloc(size_t size);
-FILE *xfopen(const char *path, const char *mode);
-int32_t xgetc(FILE *fp);
-int32_t xputc(uchar_t c, FILE *fp);
-void xfflush(FILE *fp);
-void xfclose(FILE *fp);
-void *xmmap(void *addr, size_t len, int prot, int flags, int fildes, off_t offset);
-void *xmmapf(char *path, size_t *size);
-# 12 "ternary.h" 2
-# 26 "ternary.h"
-struct node {
- uint32_t block;
- uint32_t lt, eq, gt;
- char c;
-};
-
-struct index_hdr {
- uint32_t nodes;
- uint32_t node_size;
- char cmd[1024];
-};
-
-typedef char compact_str[13];
-typedef _Bool resultf(char *, uint32_t);
-
-struct cnode {
- uint32_t block;
- compact_str str;
-};
-# 2 "indexer.c" 2
-
-static uint32_t storepos = 0;
-struct node store[(sizeof(struct node) * 1000 * 1000 * 5)];
-
-char line[1024];
-
-void insert(struct node *node, char *str, uint32_t block) {
- int cmp = ((str[0]) > (node->c) ? 1 : ((str[0]) == (node->c) ? 0 : -1));
- (debug ? fprintf(stderr, "debug: " "insert %d, %s, %d" "\n", node - store, str, block) : 0);
-
- if(!node->c) {
- bzero(node, sizeof(node));
- node->c = str[0];
- if(str[1]) {
- node->eq = ++storepos;
- insert((store + (storepos)), str + 1, block);
- } else node->block = ((block) << 1);
- } else if(str[0]) {
- if(((cmp) < 0 ? (node)->lt : ((cmp) > 0 ? (node)->gt : (node)->eq))) {
- if(!cmp) {
- if(str[1])
- insert((store + (((cmp) < 0 ? (node)->lt : ((cmp) > 0 ? (node)->gt : (node)->eq)))), str + 1, block);
- else
- node->block = ((block) << 1);
- } else
- insert((store + (((cmp) < 0 ? (node)->lt : ((cmp) > 0 ? (node)->gt : (node)->eq)))), str, block);
- } else if(!(cmp == 0 && !str[1])) {
-
- ((cmp) < 0 ? (node)->lt : ((cmp) > 0 ? (node)->gt : (node)->eq)) = ++storepos;
- insert((store + (storepos)), cmp ? str : str + 1, block);
- } else {
- node->block = ((block) << 1);
- }
- }
-}
-
-void collapse(struct node *node) {
- compact_str s;
- struct node *ptr;
- uint32_t offset;
- struct cnode *cnode;
- int i;
- uint32_t last_block;
-
- offset = node - store;
- i = 0;
- do {
- ptr = (store + (offset));
- s[i++] = ptr->c;
- last_block = ptr->block;
- if(ptr != node) ptr->block = -1;
- } while(offset = ptr->eq);
- s[i] = '\0';
-
- cnode = (struct cnode *) node;
- cnode->block = last_block | 1;
- __builtin_strncpy (cnode->str, s, sizeof(compact_str));
-}
-
-int compact(struct node *node, _Bool eager) {
- int r;
-
- if(node->lt || node->gt) {
- if(node->lt) compact((store + (node->lt)), 1);
- if(node->gt) compact((store + (node->gt)), 1);
- }
-
- if(node->eq) {
- r = compact((store + (node->eq)), node->lt || node->gt);
-
- if(r > 0 && (r + 2 == sizeof(compact_str) || eager)) {
- collapse((store + (node->eq)));
- return -1;
- }
-
- if(node->lt || node->gt || (node->eq && node->block))
- return -1;
- else
- return r >= 0 ? r + 1 : r;
- } else {
- if(!node->eq && !node->lt && !node->gt)
- return 0;
- else
- return -1;
- }
-}
-
-void dump_index(char *file, int argc, char **argv) {
- struct index_hdr h;
- int i, j = 0;
-
- h.nodes = storepos + 1;
- h.node_size = sizeof(struct node);
-
- for(i = 0; i < argc; i++) {
- j += snprintf(h.cmd + j, 1024 - j, "%s", argv[i]);
- if(i + 1 < argc) j += snprintf(h.cmd + j, 1024 - j, " ");
- }
-
- FILE *fp = xfopen(file, "w");
-
- fwrite(&h, sizeof(struct index_hdr), 1, fp);
- fwrite(store, sizeof(struct node), storepos + 1, fp);
- fclose(fp);
-}
-
-int slots_in_use() {
- int i, in_use = 0;
- for(i = 0; i < storepos; i++) {
- struct node *n = store + i;
- if(n->block != -1)
- in_use++;
- }
- return in_use;
-}
-
-void usage(char *name) {
- fprintf(stderr, "%s -f <indexFile> [-c] [-d]\n", name);
- exit(-1);
-}
-
-int main(int argc, char **argv) {
- char str[40];
- char *foo, indexFile[1024], ch;
- uint32_t block = 0;
- uint32_t inserted = 0;
- _Bool doCompact = 0;
-
- while ((ch = getopt(argc, argv, "cdf:h")) != -1) {
- switch (ch) {
- case 'c':
- doCompact = 1;
- break;
- case 'd':
- debug = 1;
- break;
- case 'f':
- strcpy(indexFile, optarg);
- break;
- case 'h':
- default:
- usage(argv[0]);
- }
- }
-
- if(!indexFile)
- usage(argv[0]);
-
- while(fgets(line, 1024, stdin)) {
- if((storepos + 1) >= (sizeof(struct node) * 1000 * 1000 * 5))
- do { fprintf(stderr, "no more index space"); fprintf(stderr, " (errno %d: %s)\n", (*__errno_location ()), strerror((*__errno_location ()))); exit(1); } while(0);
-
- foo = (__extension__ (__builtin_constant_p ('|') && !__builtin_constant_p (line) && ('|') == '\0' ? (char *) __rawmemchr (line, '|') : __builtin_strchr (line, '|')));
- foo[0] = '\0';
- foo++;
-
- __builtin_strncpy (str, line, 40 - 1);
- str[40] = '\0';
- block = atoi(foo);
-
- (debug ? fprintf(stderr, "debug: " "inserting '%s' with block %d" "\n", str, block) : 0);
- insert(store, str, block);
- inserted++;
- }
-
- if(doCompact) compact(store, 1);
-
- dump_index(indexFile, argc, argv);
-
- printf("Inserted %d entries using %d slots\n", inserted, storepos);
-
- if(doCompact)
- printf("After compacting, using %d slots\n", slots_in_use());
-
- return 0;
-}
diff --git a/woip/c/indexer.s b/woip/c/indexer.s
deleted file mode 100644
index d001d64..0000000
--- a/woip/c/indexer.s
+++ /dev/null
@@ -1,9 +0,0 @@
- .file "indexer.c"
- .section .debug_abbrev,"",@progbits
-.Ldebug_abbrev0:
- .section .debug_info,"",@progbits
-.Ldebug_info0:
- .section .debug_line,"",@progbits
-.Ldebug_line0:
- .text
-.Ltext0:
diff --git a/woip/c/install-sh b/woip/c/install-sh
deleted file mode 120000
index 8272958..0000000
--- a/woip/c/install-sh
+++ /dev/null
@@ -1 +0,0 @@
-/usr/share/automake-1.10/install-sh \ No newline at end of file
diff --git a/woip/c/livesearch.c b/woip/c/livesearch.c
deleted file mode 100644
index 40028f1..0000000
--- a/woip/c/livesearch.c
+++ /dev/null
@@ -1,258 +0,0 @@
-#include <ncurses.h>
-#include <sys/time.h>
-#include "lsearcher.h"
-#include "safe.h"
-#include "wp.h"
-
-#define MAXRES 40
-#define MAXSTR 1024
-
-char needle[MAXSTR];
-char results[MAXRES][MAXSTR];
-uint32_t blocks[MAXRES];
-int nresults;
-
-char *article_file_str;
-int article_pos;
-int pos = 0;
-void (*handler)(int c);
-
-time_t last_sec = 0;
-suseconds_t last_usec = 0;
-
-wp_dump dump = {0};
-
-void search_handler(int c);
-void article_handler(int c);
-void draw_results();
-void maybe_draw_results();
-void handle_finish();
-
-bool handle_result(char *s) {
- char buf[MAXSTR] = {0};
- strcpy(buf, s);
- char *blockpos = strrchr(buf, ' ');
- int c;
-
- if(blockpos) {
- *(blockpos - 1) = '\0';
- blockpos++;
-
- blocks[nresults] = atoi(blockpos);
- strncpy(results[nresults++], buf, MAXSTR);
-
- maybe_draw_results();
- } else fatal("invalid: '%s'", buf);
-
- if((c = getch()) != ERR) {
- ungetch(c);
- return false;
- } else if (nresults >= MAXRES) {
- handle_finish();
- return false;
- } else
- return true;
-}
-
-void handle_finish() {
- nodelay(stdscr, FALSE);
-}
-
-void draw_results() {
- int i = 0, j = 0;
- char block[20], index[20];
-
- for(; i < nresults; i++) {
- move(i + 2, j);
- j += sprintf(index, "%c ", i == article_pos ? '*' : ' ');
- j += sprintf(index + j, "%6d", i + 1);
- addstr(index);
-
- move(i + 2, j + 1);
-
- if(i == article_pos)
- attron(A_UNDERLINE);
-
- addstr(results[i]);
-
- if(i == article_pos)
- attroff(A_UNDERLINE);
-
- move(i + 2, 60);
- sprintf(block, "%d", blocks[i]);
- addstr(block);
-
- j = 0;
- }
-}
-
-void search_redraw() {
- clear();
- move(0, 0);
- needle[pos] = '\0';
- addstr(needle);
-
- draw_results();
-
- refresh();
-}
-
-void maybe_draw_results() {
- struct timeval t;
- gettimeofday(&t, NULL);
-
- if(t.tv_sec > last_sec || t.tv_usec > last_usec + 100)
- search_redraw();
-
- last_sec = t.tv_sec;
- last_usec = t.tv_usec;
-}
-
-void research() {
- nresults = 0;
- nodelay(stdscr, TRUE);
- search(&dump.index, needle, handle_result, handle_finish, true, true);
-}
-
-void draw_article() {
- size_t asize = BZ_MAX_BLOCK;
- int len;
- char *start = NULL;
- char tbuf[60];
- wp_article article;
-
- init_article(&article);
-
- len = block_load_article(&dump, results[article_pos], blocks[article_pos], &article);
-
- if(len < 0) {
- move(1, 0);
- addstr("There was an error retrieving this article");
- refresh();
- return;
- }
-
- clear();
-
- move(1, 0);
- attron(A_UNDERLINE);
- addstr(results[article_pos]);
- attroff(A_UNDERLINE);
-
- move(2, 0);
- addnstr(article.text, len);
-
- move(LINES - 2, 0);
- hline(0, COLS);
-
- move(LINES - 1, 0);
- clrtoeol();
- sprintf(tbuf, "Block %d (%d bytes)", blocks[article_pos], len);
- addstr(tbuf);
-
- sprintf(tbuf, "%59s", article_file_str);
- move(LINES - 1, COLS - 59);
- addstr(tbuf);
-
- refresh();
-}
-
-void article_handler(int c) {
- switch(c) {
- case KEY_ENTER:
- case 13:
- handle_finish();
- handler = search_handler;
- search_redraw();
- return;
- }
-}
-
-void search_handler(int c) {
- switch(c) {
- case KEY_BACKSPACE:
- case 127:
- if(pos > 0) {
- pos--;
- article_pos = 0;
- research();
- }
- break;
- case KEY_DOWN:
- if(article_pos + 1 < nresults) article_pos++;
- break;
- case KEY_UP:
- if(article_pos > 0) article_pos--;
- break;
- case KEY_ENTER:
- case 13:
- if(nresults > 0) {
- draw_article();
- handler = article_handler;
- return;
- }
- break;
- default:
- article_pos = 0;
- needle[pos++] = c;
- research();
- }
-
- search_redraw();
-}
-
-void curses_loop() {
- initscr();
- cbreak();
- noecho();
- keypad(stdscr, TRUE);
- nonl();
- intrflush(stdscr, FALSE);
-
- while(true) {
- int c = getch();
- if(c != ERR) handler(c);
- }
-}
-
-void reader_loop() {
- debug("reader_loop");
-
- wp_article a;
- char line[MAXSTR];
-
- init_article(&a);
-
- while(fgets(line, MAXSTR, stdin)) {
- line[strlen(line) - 1] = '\0';
- debug("retrieving %s", line);
- load_article(&dump, line, &a);
- if(a.block)
- puts(a.text);
- else
- printf("Couldn't retrieve %s", line);
- }
-}
-
-int main(int argc, char **argv) {
- bool noCurses = false;
- char *slash = strrchr(argv[0], '/');
-
- debug = true;
-
- if(!strcmp(slash ? slash + 1 : argv[0], "reader"))
- noCurses = true;
-
- load_dump(&dump, argv[1], argv[2], argv[3], argv[4]);
- article_file_str = argv[1];
-
- if(!noCurses) {
- handler = search_handler;
- curses_loop();
- } else {
- debug("calling reader_loop");
- reader_loop();
- }
-
- return 0;
-}
diff --git a/woip/c/lsearcher.c b/woip/c/lsearcher.c
deleted file mode 100644
index 6f69b5f..0000000
--- a/woip/c/lsearcher.c
+++ /dev/null
@@ -1,338 +0,0 @@
-#include "lsearcher.h"
-
-int kill_switch;
-ucaddr_t addr = 0;
-
-void kill_search() {
- kill_switch = 1;
-}
-
-void search_progress(lindex *l, double *d) {
- double prog = ((double) (addr - l->addr)) / ((double) l->size);
- debug("prog: %lf", prog);
- *d = prog;
-}
-
-int check_bigram_char(int ch) {
- /* legal bigram: 0, ASCII_MIN ... ASCII_MAX */
- if (ch == 0 || (ch >= ASCII_MIN && ch <= ASCII_MAX))
- return(ch);
-
- fatal("locate database header corrupt, bigram char outside 0, %d-%d: %d",
- ASCII_MIN, ASCII_MAX, ch);
- exit(1);
-}
-
-uchar_t *tolower_word(uchar_t *word) {
- register uchar_t *p;
-
- for(p = word; *p != '\0'; p++)
- *p = TOLOWER(*p);
-
- return(word);
-}
-
-int matches = 0;
-
-bool handle_match(uchar_t *s) {
- printf("%s\n", s);
- return true;
-}
-
-void init_index(lindex *l, ucaddr_t adr, size_t len, uint32_t *pdb) {
- if (len < (2*NBG))
- fatal("database too small");
- uchar_t *p, *s;
- int c;
-
- for (c = 0, p = l->bigram1, s = l->bigram2; c < NBG; c++, len-= 2) {
- p[c] = check_bigram_char(*adr++);
- s[c] = check_bigram_char(*adr++);
- }
-
- l->addr = adr;
- l->size = len;
-
- if(pdb) l->prefixdb = pdb;
-}
-
-void load_index(lindex *l, char *path, char *ppath) {
- size_t size;
- uchar_t *adr;
- uint32_t *paddr = NULL;
-
- debug("load_index(0x%x, %s, %s)", l, path, ppath);
-
- adr = xmmapf(path, &size);
- if(ppath) paddr = xmmapf(ppath, 0);
-
- init_index(l, adr, size, paddr);
-}
-
-void scan(lindex *l, char *path) {
- int len = l->size;
- int c;
- uchar_t *adr = l->addr;
- int count = 0;
- uint32_t prefixdb[CHAR_MAX] = {0};
-
- /* don't bother supporting >2gb... an index file that large
- * would have search times so high as to be useless
- */
-
- debug("scanning through %d chars...", len);
-
- c = *adr++;
- len--;
- while(len > 0) {
- uchar_t *this_switch = adr - 1;
-
- if(c == SWITCH) {
- count += *(int*) adr - OFFSET;
- len -= sizeof(int);
- adr += sizeof(int);
- } else {
- count += c - OFFSET;
- }
-
- if(count == 0) {
- char x[4];
- int i = 0;
- c = *adr++; len--;
- for(; i < 4; i++) {
- c = *(adr + i - 1);
- if(c >= PARITY) {
- TO7BIT(c);
- x[i] = l->bigram1[c];
- } else if(c > UMLAUT)
- x[i] = c;
- else if(c == UMLAUT) {
- x[i] = *(adr + i);
- adr++; len--;
- }
- }
-
- if(isalnum(x[0])) {
- /* ignore unicode chars for now */
- prefixdb[x[0]] = this_switch - l->addr;
- debug("%c starts at 0x%x (unicode: %4s)", x[0], this_switch - l->addr, x);
- }
- }
-
- while(len-- > 0 && (c = *adr++) >= UMLAUT);
- }
-
- FILE *fp = xfopen(path, "w");
- fwrite(prefixdb, sizeof(uint32_t), CHAR_MAX, fp);
- fclose(fp);
-}
-
-uchar_t *pathprep(uchar_t *path) {
- uchar_t *patend;
- size_t patlen = strlen(path);
- uchar_t *patptr = xalloc(patlen + 2);
- *patptr = '\0';
- strncpy(patptr, path, patlen);
- patend = patptr + patlen - 1;
- *(patptr + patlen) = '\0';
- return patend;
-}
-
-int search(lindex *l, uchar_t *pathpart, resultf f, donef df, bool icase, bool strict) {
- register uchar_t *p, *s, *patend, *q, *foundchar;
- register int c, cc;
- int count, found;
- size_t len = l->size;
- addr = l->addr;
- uchar_t *cutoff, path[MAXSTR];
-
- kill_switch = 0;
-
- /* use a lookup table for case insensitive search */
- uchar_t table[UCHAR_MAX + 1];
-
- if(icase) tolower_word(pathpart);
-
- patend = pathprep(pathpart);
- cc = *patend;
-
- /* set patend char to true */
- for (c = 0; c < UCHAR_MAX + 1; c++)
- table[c] = 0;
-
- if(icase) {
- table[TOLOWER(*patend)] = 1;
- table[toupper(*patend)] = 1;
- } else
- table[*patend] = 1;
-
- /* main loop */
- found = count = 0;
- foundchar = 0;
-
- debug("checking for prefixdb...");
- int offset = -1;
- bool skip = false;
- if(l->prefixdb) offset = *(l->prefixdb + toupper(*pathpart));
- debug("offset: %d", offset);
- if(strict && l->prefixdb && (offset > 0)) {
- debug("using prefix db");
- addr = l->addr + offset;
- len -= offset;
- skip = true;
- }
-
- c = *addr++;
- len--;
- while(len > 0) {
- if(kill_switch)
- return -1;
-
- if (c == SWITCH && !skip) {
- count += *(int*) addr - OFFSET;
- len -= sizeof(int);
- addr += sizeof(int);
- } else if(!skip) {
- count += c - OFFSET;
- }
-
- skip = false;
-
- p = path + count;
- foundchar = p - 1;
-
- while(len > 0) {
- if(kill_switch)
- return -1;
-
- c = *addr++;
- len--;
-
- if (c < PARITY) {
- if (c <= UMLAUT) {
- if (c == UMLAUT) {
- c = (uchar_t)*addr++;
- len--;
- } else
- break;
- }
-
- if (table[c])
- foundchar = p;
- *p++ = c;
- } else {
- TO7BIT(c);
-
- if (table[l->bigram1[c]] || table[l->bigram2[c]])
- foundchar = p + 1;
-
- *p++ = l->bigram1[c];
- *p++ = l->bigram2[c];
- }
- }
-
- if (found) {
- cutoff = path;
- *p-- = '\0';
- foundchar = p;
- } else if (foundchar >= path + count) {
- *p-- = '\0';
- cutoff = path + count;
- } else if(!strict)
- continue;
- else
- *p-- = '\0';
-
- found = 0;
- if(strict) {
- for(s = path, q = pathpart; *q; s++, q++)
- if((icase && TOLOWER(*s) != *q) || (!icase && *s != *q))
- break;
- if(*q == '\0') {
- if(!f(path))
- return 0;
- }
- } else {
- for (s = foundchar; s >= cutoff; s--) {
- if (*s == cc || (icase && TOLOWER(*s) == cc)) {
- for (p = patend - 1, q = s - 1; *p != '\0'; p--, q--)
- if (*q != *p && (!icase || TOLOWER(*q) != *p))
- break;
- if (*p == '\0' && \
- (icase ? \
- strncasecmp(path, pathpart, strlen(pathpart)) : \
- strncmp(path, pathpart, strlen(pathpart)))) {
- found = 1;
- if(!f(path))
- return 0;
- break;
- }
- }
- }
- }
- }
-
- if(strict) search(l, pathpart, f, df, icase, false);
- else if(df) df();
-}
-
-#ifdef INCLUDE_MAIN
-void usage(char *prog) {
- fatal("%s -f <indexFile> [-c <scanFile>] [-s <search>]", prog);
-}
-
-int main(int argc, char **argv) {
- size_t size;
- uchar_t *dbptr;
- extern char *optarg;
- char scanFile[MAXSTR], indexFile[MAXSTR], needle[MAXSTR];
- unsigned char ch;
- bool doScan = false, doSearch = false, haveScanFile = false, icase = true;
- lindex l = {0};
-
- debug = false;
-
- while ((ch = getopt(argc, argv, "dac:s:f:hn")) != 255) {
- switch (ch) {
- case 'c':
- haveScanFile = true;
- strncpy(scanFile, optarg, MAXSTR);
- break;
- case 'n':
- doScan = true;
- case 'd':
- debug = true;
- break;
- case 'f':
- strncpy(indexFile, optarg, MAXSTR);
- break;
- case 's':
- doSearch = true;
- strncpy(needle, optarg, MAXSTR);
- break;
- case 'a':
- icase = false;
- break;
- case 'h':
- default:
- usage(argv[0]);
- }
- }
-
- if(indexFile)
- load_index(&l, indexFile, (haveScanFile && doSearch) ? scanFile : NULL);
- else {
- debug("no index file");
- usage(argv[0]);
- }
-
- if(doScan)
- scan(&l, scanFile);
- else if(doSearch)
- search(&l, (uchar_t *) needle, handle_match, NULL, icase, true);
- else {
- debug("no action");
- usage(argv[0]);
- }
-}
-#endif
diff --git a/woip/c/lsearcher.h b/woip/c/lsearcher.h
deleted file mode 100644
index 0a065c0..0000000
--- a/woip/c/lsearcher.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef __LSEARCHER_H__
-#define __LSEARCHER_H__
-
-#include <sys/param.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "debug.h"
-#include "safe.h"
-
-#define NBG 128
-#define MAXSTR 1024
-
-#define OFFSET 14
-#define PARITY 128
-#define SWITCH 30
-#define UMLAUT 31
-
-#define LDC_MIN 0
-#define LDC_MAX 28
-
-#define BIGRAM_MIN (UCHAR_MAX - CHAR_MAX)
-#define BIGRAM_MAX UCHAR_MAX
-
-#define ASCII_MIN 32
-#define ASCII_MAX CHAR_MAX
-
-#define TO7BIT(x) ((x) = (x) & 127)
-
-#define TOLOWER(c) ('A' <= (c) && (c) <= 'Z' ? (c) | 0x20 : (c))
-
-typedef bool resultf(uchar_t *);
-typedef void donef();
-typedef unsigned char *ucaddr_t;
-
-typedef struct {
- uchar_t bigram1[NBG], bigram2[NBG];
- uchar_t *addr;
- uint32_t *prefixdb;
- size_t size;
-} lindex;
-
-void kill_search();
-int search(lindex *, uchar_t *, resultf, donef, bool, bool);
-
-#endif
diff --git a/woip/c/missing b/woip/c/missing
deleted file mode 120000
index 1f0fe88..0000000
--- a/woip/c/missing
+++ /dev/null
@@ -1 +0,0 @@
-/usr/share/automake-1.10/missing \ No newline at end of file
diff --git a/woip/c/safe.c b/woip/c/safe.c
deleted file mode 100644
index f1390ea..0000000
--- a/woip/c/safe.c
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "safe.h"
-
-void *xalloc(size_t size) {
- void *ptr = malloc(size);
-
- if(!ptr) fatal("Couldn't allocate %zu bytes", size);
-
- memset(ptr, 0, size);
- return ptr;
-}
-
-FILE *xfopen(const char *path, const char *mode) {
- debug("opening %s mode %s", path, mode);
-
- FILE *fp = fopen(path, mode);
-
- if(!fp) fatal("Couldn't open %s", path);
-
- return fp;
-}
-
-int32_t xgetc(FILE *fp) {
- int32_t ret = getc(fp);
-
- if(ret == EOF && errno != 0) {
- fatal("Couldn't getc");
- }
-
- return ret;
-}
-
-int32_t xputc(uchar_t c, FILE *fp) {
- int32_t ret = putc(c, fp);
-
- if(ret == EOF)
- fatal("Couldn't putc");
-
- return ret;
-}
-
-void xfflush(FILE *fp) {
- if(fflush(fp) == EOF)
- fatal("Error on fflush");
-}
-
-void xfclose(FILE *fp) {
- if(fclose(fp) == EOF)
- fatal("Error on fclose");
-}
-
-void *xmmap(void *addr, size_t len, int prot, int flags, int fildes, off_t offset) {
- void *ptr;
- if((ptr = mmap(addr, len, prot, flags, fildes, offset)) < 0)
- fatal("Error on mmap");
-
- return ptr;
-}
-
-void *xmmapf(char *path, size_t *size) {
- int fd;
- struct stat s;
-
- if((fd = open(path, O_RDONLY)) < 0) fatal("Error open()ing %s", path);
- if(fstat(fd, &s) < 0) fatal("fstat");
-
- if(size) *size = s.st_size;
-
- return xmmap(NULL, (size_t) s.st_size, PROT_READ, MAP_PRIVATE, fd, (off_t) 0);
-}
diff --git a/woip/c/safe.h b/woip/c/safe.h
deleted file mode 100644
index 144f19c..0000000
--- a/woip/c/safe.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __SAFE_H__
-#define __SAFE_H__
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include "debug.h"
-
-typedef unsigned char uchar_t;
-
-void *xalloc(size_t size);
-FILE *xfopen(const char *path, const char *mode);
-int32_t xgetc(FILE *fp);
-int32_t xputc(uchar_t c, FILE *fp);
-void xfflush(FILE *fp);
-void xfclose(FILE *fp);
-void *xmmap(void *addr, size_t len, int prot, int flags, int fildes, off_t offset);
-void *xmmapf(char *path, size_t *size);
-
-#endif
diff --git a/woip/c/search.c b/woip/c/search.c
deleted file mode 100644
index e440d5a..0000000
--- a/woip/c/search.c
+++ /dev/null
@@ -1,174 +0,0 @@
-#include "search.h"
-
-#define NODES(n) ((n) * sizeof(struct node))
-
-static uint32_t storepos = 0;
-static char needle[MAXLINE];
-static char so_far[MAXLINE];
-static struct node *root;
-static bool done;
-static bool csen = true;
-static char cmd[MAXLINE];
-
-struct node *load_index(char *file) {
- void *ptr;
- struct index_hdr h;
- FILE *fp = xfopen(file, "r");
-
- fread(&h, sizeof(struct index_hdr), 1, fp);
- storepos = h.nodes;
- strncpy(cmd, h.cmd, MAXLINE);
-
- if(h.node_size != sizeof(struct node))
- fatal("Couldn't read index: conflicting node sizes. %s expects %d, " \
- "I've been compiled to expect %d. Did you use -fpack-struct?", \
- file, h.node_size, sizeof(struct node));
-
- ptr = xmmap(NULL, NODES(storepos), PROT_READ, MAP_PRIVATE, fileno(fp), 0);
-
- return ptr + sizeof(struct index_hdr);
-}
-
-void print_cmd() {
- printf("%s\n", cmd);
-}
-
-void load_root(char *file) {
- root = load_index(file);
-}
-
-char *matchstr(int depth, struct node *n, char *match) {
- debug("matchstr(%d, 0x%x)", depth, n);
-
- int i, j = 0;
- bool compressed;
-
- compressed = n->block & CMASK;
-
- for(i = 0; i < depth; i++)
- if(so_far[i])
- match[j++] = so_far[i];
-
- match[j] = '\0';
- debug("so_far: %s", match);
-
- if(compressed) {
- char *s = ((struct cnode *) n)->str;
- debug("compressed str: %s", s);
- strncpy(match + j, s, strlen(s));
- j += strlen(s);
- } else {
- match[j++] = n->c;
- }
-
- match[j] = '\0';
-
- debug(" -> %s", match);
-
- return match;
-}
-
-bool handle_matches(int startdepth, int depth, struct node *n, resultf r) {
- debug("handle_matches(%d, %d, 0x%x %d %c)", startdepth, depth, n, n - root, n->c);
-
- bool compressed = n->block & CMASK;
- char match[MAXLINE];
-
- if(BLOCK_DEMASK(n->block)) {
- if(!r(matchstr(depth, n, match), BLOCK_DEMASK(n->block))) {
- done = true;
- return false;
- }
- }
-
- if(compressed) return true;
-
- if(depth == startdepth && n->eq)
- handle_matches(startdepth, depth + 1, root + n->eq, r);
- else {
- if(n->lt)
- if(!handle_matches(startdepth, depth, root + n->lt, r))
- return false;
- if(n->eq) {
- debug("following eq...");
- so_far[depth] = n->c;
- if(!handle_matches(startdepth, depth + 1, root + n->eq, r))
- return false;
- }
- if(n->gt)
- if(!handle_matches(startdepth, depth, root + n->gt, r))
- return false;
- }
-
- return true;
-}
-
-void csen_set(bool b) {
- csen = b;
-}
-
-void csearch(char *prefix, struct cnode *n, resultf r, int depth) {
- debug("csearch(%s, (0x%x, %s), %d)", prefix, n, n->str, depth);
- if(!strncmp(prefix, n->str, strlen(prefix)))
- handle_matches(depth, depth, (struct node *) n, r);
-}
-
-void search(char *prefix, struct node *n, resultf r, int depth) {
- debug("0x%x search(%s, (%d, %c), %d)", n, prefix, n - root, n->c, depth);
-
- if(n->block & CMASK) {
- csearch(prefix, (struct cnode *) n, r, depth);
- return;
- }
-
- if(((!csen && tolower(n->c) == tolower(prefix[0])) || \
- (csen && n->c == prefix[0])) && !done) {
- so_far[depth] = n->c;
- debug("0x%x match", n);
- if(prefix[1]) {
- if(n->eq)
- search(prefix + 1, root + n->eq, r, depth + 1);
- } else
- handle_matches(depth, depth, n, r);
-
- }
-
- if(!done) {
- if((n->c > prefix[0] || (isascii(prefix[0]) && !csen && n->c > (prefix[0]^0x20))) \
- && n->lt)
- search(prefix, root + n->lt, r, depth);
-
- if((n->c < prefix[0] || (isascii(prefix[0]) && !csen && n->c < (prefix[0]^0x20))) \
- && n->gt)
- search(prefix, root + n->gt, r, depth);
- }
-}
-
-void root_search(char *prefix, resultf r) {
- done = false;
- strcpy(needle, prefix);
- search(prefix, root, r, 0);
-}
-
-void print_tree() {
- int i;
- for(i = 0; i < storepos; i++) {
- struct node *n = root + i;
-
- debug("--");
- debug("%d", i);
-
- if(n->block == -1) {
- debug("obsolete");
- continue;
- }
-
- debug("block: %d", BLOCK_DEMASK(n->block));
- if(n->block & CMASK)
- debug("COMPRESSED: %s", ((struct cnode *) n)->str);
- else {
- debug("c: %c", n->c);
- debug("lt: %d | eq: %d | gt: %d", n->lt, n->eq, n->gt);
- }
- }
-}
diff --git a/woip/c/search.h b/woip/c/search.h
deleted file mode 100644
index 95bfd3b..0000000
--- a/woip/c/search.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "ternary.h"
-
-void print_tree();
-void print_cmd();
-void load_root(char *file);
-void root_search(char *prefix, resultf r);
-void csen_set(bool b);
diff --git a/woip/c/searcher.c b/woip/c/searcher.c
deleted file mode 100644
index 5532313..0000000
--- a/woip/c/searcher.c
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "search.h"
-
-int returned;
-int maxres = 10;
-char needle[MAXLINE];
-
-bool print_match(char *s, uint32_t block) {
- returned++;
- printf("%s %d\n", s, block);
- if(returned < maxres) return true;
- else return false;
-}
-
-void usage(char *name) {
- fprintf(stderr, "%s -f <indexFile> -s <search> [-m <maxres>] [-d]\n", name);
- exit(-1);
-}
-
-int main(int argc, char **argv) {
- char ch, indexFile[MAXLINE];
- bool printTree = false, printCmd = false;
-
- while ((ch = getopt(argc, argv, "cm:s:idf:hp")) != -1) {
- switch (ch) {
- case 'c':
- printCmd = true;
- break;
- case 's':
- strcpy(needle, optarg);
- break;
- case 'd':
- debug = true;
- break;
- case 'f':
- strcpy(indexFile, optarg);
- break;
- case 'm':
- maxres = atoi(optarg);
- break;
- case 'i':
- csen_set(false);
- break;
- case 'p':
- printTree = true;
- break;
- case 'h':
- default:
- usage(argv[0]);
- }
- }
-
- load_root(indexFile);
- if(printTree) print_tree();
- else if(printCmd) print_cmd();
- else if(!needle[0] || !indexFile[0])
- usage(argv[0]);
- else {
- root_search(needle, print_match);
- printf("%d matches\n", returned);
- }
-
- return 0;
-}
diff --git a/woip/c/ternary.h b/woip/c/ternary.h
deleted file mode 100644
index a8cafae..0000000
--- a/woip/c/ternary.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#include <sys/mman.h>
-#include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <ctype.h>
-#include "debug.h"
-#include "safe.h"
-
-#define PREFIX_LEN 40
-#define MAXLINE 1024
-#define INDEX_LEN (sizeof(struct node) * 1000 * 1000 * 5)
-
-#define CMP(a, b) ((a) > (b) ? 1 : ((a) == (b) ? 0 : -1))
-#define MIN(a, b) ((a) > (b) ? (b) : (a))
-#define NEXT_NODE(node, cmp) ((cmp) < 0 ? (node)->lt : \
- ((cmp) > 0 ? (node)->gt : (node)->eq))
-
-#define CMASK 1
-#define BLOCK_MASK(b) ((b) << 1)
-#define BLOCK_DEMASK(b) ((b) >> 1)
-
-struct node {
- uint32_t block;
- uint32_t lt, eq, gt;
- char c;
-};
-
-struct index_hdr {
- uint32_t nodes;
- uint32_t node_size;
- char cmd[MAXLINE];
-};
-
-typedef char compact_str[13];
-typedef bool resultf(char *, uint32_t);
-
-struct cnode {
- uint32_t block;
- compact_str str;
-};
-
diff --git a/woip/c/wp.c b/woip/c/wp.c
deleted file mode 100644
index 3947c5c..0000000
--- a/woip/c/wp.c
+++ /dev/null
@@ -1,157 +0,0 @@
-#include "wp.h"
-
-#define MAXSTR 1024
-#define BOUNDS_HIT_END -2
-#define BOUNDS_NO_START -3
-#define BOUNDS_NO_TEXT -4
-#define BOUNDS_FAIL -10
-
-char *exact_match;
-int exact_block;
-
-void load_dump(wp_dump *d, char *dump, char *loc, char *ploc, char *blocks) {
- d->fp = xfopen(dump, "r");
- d->block_map = load_block_map(blocks);
-
- load_index(&d->index, loc, ploc);
-}
-
-void init_article(wp_article *a) {
- a->text = malloc(BZ_MAX_BLOCK);
-}
-
-bool handle_exact_match(char *s) {
- char buf[MAXSTR], *end;
- strncpy(buf, s, MAXSTR);
-
- debug("handle_exact_match(%s)", s);
-
- end = strrchr(buf, ' ') - 1;
- *end = '\0';
-
- if(strcasecmp(buf, exact_match)) return true;
- else {
- exact_block = atoi(end + 1);
- return false;
- }
-}
-
-int block_load(wp_dump *d, int block, char *text, int *text_len) {
- uint32_t bzres = 0;
- uint64_t size;
-
- BitBuffer *bb = bbOfSize(BZ_MAX_BLOCK);
- size = readBlock(d->fp, (d->block_map)[block], bb);
-
- if((bzres = decompressBlock(bb->buff, bb->pos, text, text_len)) != BZ_OK)
- fatal("error decompressing block: %d. article_file: 0x%x", bzres, d->fp);
-
- bbClose(bb);
-}
-
-int article_bounds(char *name, char *buf, char **start, int bufsize) {
- debug("find article start: %s, 0x%x, 0x%x, %d", name, buf, *start, bufsize);
-
- int len = 0;
- int nl = strlen(name);
- char *bufstart = buf;
-
- /* start of article */
- while(*start = strcasestr(buf, name))
- if(*start && *(*start - 2) == START_HEADING && *(*start + nl) == '\n')
- break;
- else
- buf = *start + 1;
-
- if(*start == NULL)
- return BOUNDS_NO_START;
-
- /* start of text */
- while(*(*start)++ != START_TEXT)
- if(**start == START_HEADING)
- return BOUNDS_NO_TEXT;
-
- /* end of text */
- while(((*start - bufstart) + len) < bufsize && (*(*start + len++) != END_TEXT));
-
- int size = ((*start - bufstart) + len);
- debug("bufsize: %d, size: %d, len: %d, *start: %d, bufstart: %d, char: %d", bufsize, size, len, *start, bufstart, *(*start + len - 1));
- if(size == bufsize && *(*start + len) != END_TEXT) {
- debug("Hit the end early");
- return BOUNDS_HIT_END;
- }
-
- return len - 1;
-}
-
-int load_article(wp_dump *d, char *name, wp_article *a) {
- exact_match = name;
- exact_block = -1;
-
- debug("load_article(0x%x, %s, 0x%x)", d, name, a);
-
- search(&d->index, name, handle_exact_match, NULL, false, true);
-
- if(exact_block < 0)
- return -1;
- else {
- return block_load_article(d, name, exact_block, a);
- }
-}
-
-int block_load_article(wp_dump *d, char *name, int block, wp_article *a) {
- char *text = xalloc(BZ_MAX_BLOCK);
- int text_len = BZ_MAX_BLOCK, article_len;
- char *start;
-
- debug("opening %s from block %d (%llu)", name, block, (d->block_map)[block]);
- block_load(d, block, text, &text_len);
-
- if((article_len = article_bounds(name, text, &start, text_len)) < 0) {
- if(article_len == BOUNDS_HIT_END) {
- /* the start was in the block, but we hit the end of the block before finding
- * the end of the article text. Load the next block and re-enter...
- * We only consider the case of loading one extra block; no Wikipedia article will span
- * more than two (it'd have to be >900kb for it to be possible).
- */
-
- if(!d->block_map[block + 1])
- fatal("trying to load another block, but don't have any blocks left. "
- "This probably indicates a malformed dump.");
-
- debug("Loading another block");
- if(!(text = realloc(text, BZ_MAX_BLOCK * 2))) fatal("realloc");
- int n_text_len = BZ_MAX_BLOCK;
-
- block_load(d, block + 1, text + text_len, &n_text_len);
-
- if((article_len = article_bounds(name, text, &start, n_text_len + text_len)) < 0)
- fatal("additional block loading failure: %d", article_len);
- } else
- fatal("couldn't find %s in block %d", name, block);
- }
-
- debug("start: 0x%x, len: %d", start, article_len);
- debug("a->text: 0x%x", a->text);
-
- *(start + article_len) = '\0';
- strncpy(a->text, start, article_len + 1);
- a->block = block;
- free(text);
- return article_len;
-}
-
-#ifndef WP_INCLUDE
-int main(int argc, char **argv) {
- debug = true;
-
- wp_dump d;
- wp_article a = {0};
-
- load_dump(&d, argv[1], argv[2], argv[3], argv[4]);
- load_article(&d, argv[5], &a);
- printf("%s\n", a.text);
-
- return 0;
-}
-#endif
diff --git a/woip/c/wp.h b/woip/c/wp.h
deleted file mode 100644
index 65e6f13..0000000
--- a/woip/c/wp.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include "lsearcher.h"
-#include "bzipreader.h"
-
-#define START_HEADING 1
-#define START_TEXT 2
-#define END_TEXT 3
-
-typedef struct {
- char *text;
- int block;
-} wp_article;
-
-typedef struct {
- FILE *fp;
- uint64_t *block_map;
- lindex index;
-} wp_dump;
diff --git a/woip/py/setup.py b/woip/py/setup.py
deleted file mode 100644
index 0e679e7..0000000
--- a/woip/py/setup.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2007, One Laptop Per Child
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-from distutils.core import setup, Extension
-
-wp_sources = [
- 'wp.i',
- '../c/bzipreader.c',
- '../c/wp.c',
- '../c/lsearcher.c',
- '../c/safe.c',
- '../c/blocks.c'
-]
-
-wp_module = Extension(
- '_wp',
- sources=wp_sources,
- include_dirs=['../c'],
- define_macros=[('DEBUG', 1)],
- libraries=['bz2'])
-
-setup(name='wp', version='0.1',
- author='Wade Brainerd',
- description="""Offline Wikipedia Interface.""",
- ext_modules=[wp_module], py_modules=['wp'])
diff --git a/woip/py/wp.i b/woip/py/wp.i
deleted file mode 100644
index d2080df..0000000
--- a/woip/py/wp.i
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright (C) 2007, One Laptop Per Child
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-// Offline Wikipedia database interface for Python
-// (or any other SWIG supported language)
-//
-// Module functions are prefixed with 'wp_' to avoid clashes with functions
-// defined in wp.h.
-
-// Note that the Ruby Inline implementation used a '__' prefix, but that won't
-// work in Python as the underscores cause the methods to be treated as private.
-//
-%module wp
-
-%{
-#include "../c/wp.h"
-
-#define MAXRES 40
-#define MAXSTR 1024
-
-wp_dump d = {0};
-wp_article a = {0};
-
-char results[MAXRES][MAXSTR];
-int nresults;
-
-char *__exact_match;
-int __got_match;
-
-bool __handle_result(char *s) {
- strncpy(results[nresults], s, MAXSTR);
- results[nresults][MAXSTR - 1] = '\0';
- char *end = strrchr(results[nresults], ' ');
-
- if(end) {
- *(end - 1) = '\0';
- nresults++;
- }
-
- return nresults < MAXRES;
-}
-
-bool __handle_exact_match(char *s) {
- char buf[MAXSTR], *end;
- strncpy(buf, s, MAXSTR);
-
- debug("handle_exact_match(%s)", s);
-
- end = strrchr(buf, ' ') - 1;
- *end = '\0';
-
- if(strcasecmp(buf, __exact_match)) return true;
- else {
- __got_match = 1;
- return false;
- }
-}
-
-void wp_load_dump(char *dump, char *loc, char *ploc, char *blocks) {
- load_dump(&d, dump, loc, ploc, blocks);
- init_article(&a);
-}
-
-char *wp_load_article(char *name) {
- a.block = 0;
- a.text[0] = '\0';
- load_article(&d, name, &a);
- return a.text;
-}
-
-int wp_article_block() {
- return a.block;
-}
-
-int wp_article_size() {
- return strlen(a.text);
-}
-
-int wp_search(char *needle) {
- nresults = 0;
- search(&d.index, needle, __handle_result, NULL, true, true);
- return nresults;
-}
-
-char *wp_result(int n) {
- return results[n];
-}
-
-int wp_article_exists(char *name) {
- __exact_match = name;
- __got_match = 0;
- debug("wp_article_exists(%s)", name);
- search(&d.index, name, __handle_exact_match, NULL, false, true);
- return __got_match;
-}
-
-%}
-
-void wp_load_dump(char *dump, char *loc, char *ploc, char *blocks);
-
-char *wp_load_article(char *name);
-int wp_article_block();
-int wp_article_size();
-
-int wp_search(char *needle);
-char *wp_result(int n);
-
-int wp_article_exists(char *name);
diff --git a/woip/rb/#bzipreader.rb# b/woip/rb/#bzipreader.rb#
deleted file mode 100644
index 1ccacca..0000000
--- a/woip/rb/#bzipreader.rb#
+++ /dev/null
@@ -1,192 +0,0 @@
-# rm -r ~/.ruby_inline; ARCHFLAGS="-arch i386" ruby -r rubygems -r bzipread.rb \
-# -e 'BzipReader.new.readBlock("../ga.wp.txt.bz2", 0)'
-
-require 'rubygems'
-require 'tempfile'
-require 'inline'
-require File.join(File.dirname(__FILE__), 'common')
-
-BZ_MAX_BLOCK = 1024 * 900
-
-class BzipReader
- attr :offset
-
- def debug(str)
- $stderr.puts str
- end
-
- inline(:C) do |builder|
- builder.add_compile_flags "-I../c -I. -lbz2"
- builder.add_compile_flags "../c/bzipreader.c"
- builder.add_compile_flags "../c/safe.c"
-
- builder.prefix '
- #include "bzipreader.h"
- uint64_t readOffset;
- '
-
- ['VALUE __decompressBlock(char *src, int srcLen) {
- char dest[BZ_MAX_BLOCK];
- uint32_t destLen = BZ_MAX_BLOCK;
- int ret;
-
- debug("ruby decompressing %d bytes", srcLen);
- if((ret = decompressBlock(src, srcLen, dest, &destLen)) != BZ_OK)
- fatal("couldn\'t decompress: bz error %d", ret);
-
- return rb_str_new(dest, destLen);
- }',
-
- 'VALUE __readBlock(char *file) {
- FILE *in;
- uint64_t realOffset;
- VALUE str;
-
- if(strlen(file) == 0) {
- in = xfopen("/dev/stdin", "rb");
- realOffset = 0;
- } else {
- in = xfopen(file, "rb");
- realOffset = readOffset;
- }
-
- BitBuffer *bb = bbOfSize(BZ_MAX_BLOCK);
- readOffset = fixedOffset(readBlock(in, realOffset, bb));
-
- xfclose(in);
-
- str = rb_str_new(bb->buff, bb->pos);
- bbClose(bb);
- return str;
- }',
-
- 'void __setReadOffset(char *offset) {
- readOffset = *((uint64_t *) offset);
- }',
-
- 'VALUE __getReadOffset() {
- return rb_str_new((char *) &readOffset, sizeof(uint64_t));
- }',
-
- 'int __computeBoundaries(char *file) {
- int size;
- FILE *in = xfopen(file, "rb");
- size = computeBoundaries(in);
- xfclose(in);
- return size;
- }'].each {|c| builder.c c}
- end
-
- def uint64_to_char(num)
- hi = num >> 32
- lo = num & 0xffffffff
- [lo, hi].pack('L2')
- end
-
- def char_to_uint64(char)
- lo, hi = char.unpack('L2')
- return lo + (hi << 32)
- end
-
- def initialize(file="")
- if file.empty?
- @useStdin = true
- @buffered = ""
- @eof = false
- end
-
- @file = file
- @offset = 0
- end
-
- def getReadOffset
- char_to_uint64(__getReadOffset)
- end
-
- def setReadOffset(num)
- __setReadOffset(uint64_to_char(num))
- end
-
- def readNextBlock
- # in bzipreader.c, readBlock reads more than it should -- to determine the end of a block,
- # it reads the header for the subsequent block. If we're reading from a file, this is ok;
- # we can seek back to where we want to be. But when reading from stdin, it's more awkward,
- # and we have to buffer things
- # TODO: use a named pipe
- if @useStdin
- if !@buffered or (@offset > 0 and @buffered.size < 40)
- raise EOF
- end
-
- begin
- @buffered += $stdin.read(BZ_MAX_BLOCK) if @buffered.size < BZ_MAX_BLOCK and !@eof
- rescue TypeError
- @eof = true
- end
-
- tempfile = Tempfile.new('bzipreader')
- tempfile.write(@buffered)
- tempfile.flush
-
- setReadOffset(0)
-
- block = __readBlock(tempfile.path)
-
- offset = getReadOffset - 80
- @offset += offset
- bytes = (offset >> 3)
- @buffered = @buffered[bytes..-1]
-
- block
- else
- readBlock(@offset)
- end
- end
-
- def readBlock(offset)
- unless @useStdin
- if File.size(@file) < (offset >> 3) + 80 + 40 # don't ask
- raise EOF
- end
- end
- setReadOffset(offset)
- block = __readBlock(@file)
- @offset = getReadOffset
- block
- end
-
- def decompressBlock(str)
- __decompressBlock(str, str.size)
- end
-
- def computeBoundaries
- __computeBoundaries(@file)
- end
-
- def self.test(skip=0)
- b = BzipReader.new('../ga.wp.txt.bz2')
- skip.times do b.readNextBlock end
- block = b.readNextBlock
- block = b.decompressBlock(block)[0..100]
- puts block
- end
-
- def self.stdin_test(skip = 0)
- b = self.new
- skip.times do b.readNextBlock end
- blockNo = -1
-
- while true
- begin
- offset = b.offset
- block = b.readNextBlock
- plaintext = b.decompressBlock(block)
- $stderr.puts "#{blockNo += 1}\t#{offset}\t#{plaintext.gsub(/\n/, "\\n")[0..30]}"
- $stdout.write plaintext
- rescue EOF
- $stderr.puts "EOF"
- break
- end
- end
- end
-end
diff --git a/woip/rb/article.rb b/woip/rb/article.rb
deleted file mode 100644
index eb44340..0000000
--- a/woip/rb/article.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# these are actually real ASCII codes
-START_HEADING = 1.chr
-START_TEXT = 2.chr
-END_TEXT = 3.chr
-
-class Article
- attr_accessor :title
- attr_accessor :body
-
- def body
- @body ||= ''
- end
-
- def write(str)
- str.puts START_HEADING
- str.puts title
- str.puts body.size
- str.puts START_TEXT
- str.puts body
- str.puts END_TEXT
- str.flush
- end
-end
-
-def stdin_gets
- raise EOF if $stdin.closed?
- line = $stdin.gets
- raise EOF unless line
- line
-end
diff --git a/woip/rb/bzipreader.rb b/woip/rb/bzipreader.rb
deleted file mode 100644
index 1ccacca..0000000
--- a/woip/rb/bzipreader.rb
+++ /dev/null
@@ -1,192 +0,0 @@
-# rm -r ~/.ruby_inline; ARCHFLAGS="-arch i386" ruby -r rubygems -r bzipread.rb \
-# -e 'BzipReader.new.readBlock("../ga.wp.txt.bz2", 0)'
-
-require 'rubygems'
-require 'tempfile'
-require 'inline'
-require File.join(File.dirname(__FILE__), 'common')
-
-BZ_MAX_BLOCK = 1024 * 900
-
-class BzipReader
- attr :offset
-
- def debug(str)
- $stderr.puts str
- end
-
- inline(:C) do |builder|
- builder.add_compile_flags "-I../c -I. -lbz2"
- builder.add_compile_flags "../c/bzipreader.c"
- builder.add_compile_flags "../c/safe.c"
-
- builder.prefix '
- #include "bzipreader.h"
- uint64_t readOffset;
- '
-
- ['VALUE __decompressBlock(char *src, int srcLen) {
- char dest[BZ_MAX_BLOCK];
- uint32_t destLen = BZ_MAX_BLOCK;
- int ret;
-
- debug("ruby decompressing %d bytes", srcLen);
- if((ret = decompressBlock(src, srcLen, dest, &destLen)) != BZ_OK)
- fatal("couldn\'t decompress: bz error %d", ret);
-
- return rb_str_new(dest, destLen);
- }',
-
- 'VALUE __readBlock(char *file) {
- FILE *in;
- uint64_t realOffset;
- VALUE str;
-
- if(strlen(file) == 0) {
- in = xfopen("/dev/stdin", "rb");
- realOffset = 0;
- } else {
- in = xfopen(file, "rb");
- realOffset = readOffset;
- }
-
- BitBuffer *bb = bbOfSize(BZ_MAX_BLOCK);
- readOffset = fixedOffset(readBlock(in, realOffset, bb));
-
- xfclose(in);
-
- str = rb_str_new(bb->buff, bb->pos);
- bbClose(bb);
- return str;
- }',
-
- 'void __setReadOffset(char *offset) {
- readOffset = *((uint64_t *) offset);
- }',
-
- 'VALUE __getReadOffset() {
- return rb_str_new((char *) &readOffset, sizeof(uint64_t));
- }',
-
- 'int __computeBoundaries(char *file) {
- int size;
- FILE *in = xfopen(file, "rb");
- size = computeBoundaries(in);
- xfclose(in);
- return size;
- }'].each {|c| builder.c c}
- end
-
- def uint64_to_char(num)
- hi = num >> 32
- lo = num & 0xffffffff
- [lo, hi].pack('L2')
- end
-
- def char_to_uint64(char)
- lo, hi = char.unpack('L2')
- return lo + (hi << 32)
- end
-
- def initialize(file="")
- if file.empty?
- @useStdin = true
- @buffered = ""
- @eof = false
- end
-
- @file = file
- @offset = 0
- end
-
- def getReadOffset
- char_to_uint64(__getReadOffset)
- end
-
- def setReadOffset(num)
- __setReadOffset(uint64_to_char(num))
- end
-
- def readNextBlock
- # in bzipreader.c, readBlock reads more than it should -- to determine the end of a block,
- # it reads the header for the subsequent block. If we're reading from a file, this is ok;
- # we can seek back to where we want to be. But when reading from stdin, it's more awkward,
- # and we have to buffer things
- # TODO: use a named pipe
- if @useStdin
- if !@buffered or (@offset > 0 and @buffered.size < 40)
- raise EOF
- end
-
- begin
- @buffered += $stdin.read(BZ_MAX_BLOCK) if @buffered.size < BZ_MAX_BLOCK and !@eof
- rescue TypeError
- @eof = true
- end
-
- tempfile = Tempfile.new('bzipreader')
- tempfile.write(@buffered)
- tempfile.flush
-
- setReadOffset(0)
-
- block = __readBlock(tempfile.path)
-
- offset = getReadOffset - 80
- @offset += offset
- bytes = (offset >> 3)
- @buffered = @buffered[bytes..-1]
-
- block
- else
- readBlock(@offset)
- end
- end
-
- def readBlock(offset)
- unless @useStdin
- if File.size(@file) < (offset >> 3) + 80 + 40 # don't ask
- raise EOF
- end
- end
- setReadOffset(offset)
- block = __readBlock(@file)
- @offset = getReadOffset
- block
- end
-
- def decompressBlock(str)
- __decompressBlock(str, str.size)
- end
-
- def computeBoundaries
- __computeBoundaries(@file)
- end
-
- def self.test(skip=0)
- b = BzipReader.new('../ga.wp.txt.bz2')
- skip.times do b.readNextBlock end
- block = b.readNextBlock
- block = b.decompressBlock(block)[0..100]
- puts block
- end
-
- def self.stdin_test(skip = 0)
- b = self.new
- skip.times do b.readNextBlock end
- blockNo = -1
-
- while true
- begin
- offset = b.offset
- block = b.readNextBlock
- plaintext = b.decompressBlock(block)
- $stderr.puts "#{blockNo += 1}\t#{offset}\t#{plaintext.gsub(/\n/, "\\n")[0..30]}"
- $stdout.write plaintext
- rescue EOF
- $stderr.puts "EOF"
- break
- end
- end
- end
-end
diff --git a/woip/rb/common.rb b/woip/rb/common.rb
deleted file mode 100644
index 1c7426e..0000000
--- a/woip/rb/common.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'rubygems'
-
-class EOF < RuntimeError; end \ No newline at end of file
diff --git a/woip/rb/index.rb b/woip/rb/index.rb
deleted file mode 100644
index dc376f9..0000000
--- a/woip/rb/index.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require File.join(File.dirname(__FILE__), 'bzipreader')
-require File.join(File.dirname(__FILE__), 'article')
-
-$nblock = -1
-$startblock = 0
-
-def get_line
- if $lines.empty?
- txt = $reader.decompressBlock($reader.readNextBlock)
- $nblock += 1
-
- $stderr.puts "#{$nblock}\t#{$reader.offset}\t#{txt.gsub(/\n/, "\\n")[0..30]}\t#{txt.size}"
-
- $lines = txt.split("\n").reverse
- end
-
- $lines.pop
-end
-
-def quote(str)
- str.gsub(/'/, "''")
-end
-
-def process_titles
- while true
- line = get_line
- block = $nblock
- if line.chomp == START_HEADING
- article = get_line.chomp
- puts "#{article} #{block}" if $startblock <= $nblock
- end
- end
-rescue EOF
- $stderr.puts "Done"
-end
-
-def main
- if ARGV[1]
- $startblock = ARGV[1].to_i
- end
-
- if ARGV.empty?
- $reader = BzipReader.new
- else
- $reader = BzipReader.new(ARGV.first)
- end
-
- $lines = []
- process_titles
-end
-
-if __FILE__ == $0
- main
-end
diff --git a/woip/rb/livesearch.rb b/woip/rb/livesearch.rb
deleted file mode 100644
index f57ae04..0000000
--- a/woip/rb/livesearch.rb
+++ /dev/null
@@ -1,106 +0,0 @@
-require 'rubygems'
-require 'curses'
-require 'inline'
-
-class TernarySearcher
- RESULTS = 10
-
- inline(:C) do |builder|
- builder.include '"ternary.h"'
- builder.add_compile_flags "-I../c -I. -DDEBUG"
- builder.add_compile_flags "../c/searcher.c"
-
- builder.prefix "
- char resultbuf[#{RESULTS}][MAXLINE];
- int haveresults;
- "
-
- builder.c "int handleResult(char *s) {
- strncpy(resultbuf[haveresults++], s, MAXLINE);
- if(haveresults == #{RESULTS}) return false;
- else return true;
- }"
-
- builder.c 'void __init(char *indexFile) {
- load_root(indexFile);
- }'
-
- builder.c 'void __prefixSearch(char *s, int n) {
- haveresults = 0;
- root_search(s, handleResult);
- }'
- end
-
- def initialize(index)
- __init(index)
- end
-
- def prefixSearch(str, n)
- @results = []
- __prefixSearch(str, n)
- end
-end
-
-class Searcher
- def initialize
- @needle = ""
- @xap = XapianSearcher.new(ARGV.first)
- end
-
- def refresh
- Curses.clear
- Curses.setpos(0, 0)
- Curses.addstr(@needle)
- draw_matches
- Curses.refresh
- end
-
- def draw_matches
- line = 1
- @matches.each do |match|
- match.draw(line += 1)
- end
- end
-
- def search
- @matches = @xap.matches(@needle).map do |match|
- Match.new(match)
- end
- end
-
- def run
- Curses.init_screen
- Curses.noecho
- Curses.stdscr.keypad(true)
-
- loop do
- char = Curses.getch
-
- if char == 127 # Backspace
- @needle = @needle[0..-2] unless @needle.empty?
- else
- @needle += char.chr
- end
- search
- refresh
- end
- ensure
- Curses.close_screen
- end
-end
-
-class Match
- def initialize(str)
- @string = str
- end
-
- def draw(line)
- Curses.setpos(line, 0)
- Curses.addstr(@string)
- end
-end
-
-if $0 == __FILE__
- puts "running..."
- Searcher.new.run
-end \ No newline at end of file
diff --git a/woip/rb/server.rb b/woip/rb/server.rb
deleted file mode 100644
index 0b2ea29..0000000
--- a/woip/rb/server.rb
+++ /dev/null
@@ -1,284 +0,0 @@
-require 'rubygems'
-require 'mongrel'
-require 'inline'
-
-READER = "WP, the free offline Wikipedia reader thing"
-MAXRES = 40
-USAGE = %Q[
-<strong>Supported requests:</strong>
-<ul>
-<li><tt>/wiki/Foo</tt> - parsed Wikipedia article on Foo</li>
-<li><tt>/raw/Foo</tt> - raw text of article</li>
-<li><tt>/search?s=foo</tt> - article titles containing foo</li>
-</ul>
-]
-SEARCH_BOX=%Q{<div width="100" style="float: right;">
- <form action="/search" method="get">
- <input type="text" name="s" accesskey="s" /></form></div>}
-
-class String
- def titleize
- self[0..0].upcase + self[1..-1]
- end
-end
-
-class Parser
- # Parser.php is 5k lines, and has a billion dependencies, transclusion logic,
- # magic-word support, langauge processing, templating code (a literally
- # Turing-complete sublanguage), and stuff... so let's just use regexps
-
- def parse_infobox(str)
- str.gsub(/^\|([^=]+)[:space:]*=[:space:]*(.*)$/) { "<b>#{$1}</b> #{$2}<br>" }
- end
-
- def parse_template(str)
- str.gsub(/\{\{(([^[:space:]]+) (\w+)$)?([^\}\{]+)\}\}/) {
- if $2 == "Infobox"
- %Q[ <div style="width: 200px; background-color: #eee; border: 1px solid #bbb; float: right">
- <h2>#{$3}</h2>
- #{parse_infobox($4)} </div> ]
- else
- ""
- end
- }
- end
-
- def parse(str)
- # Lists; this barely works in even the simplest cases
- str = str.gsub(/^\*(.+)$/) { "<span style=\"display: block\">* #{$1}</span>" }
-
- # Bold
- str = str.gsub(/'''(.+?)'''/) { "<b>#{$1}</b>" }
-
- # Italic
- str = str.gsub(/''(.+?)''/) { "<i>#{$1}</i>" }
-
- # Headings
- str = str.gsub(/(={2,})([^=]+)\1/) {"<h#{$1.size}>#{$2}</h#{$1.size}>"}
-
- # Interwiki links
- str = str.gsub(/\[\[([^\|\]]+)\|([^\]]+)\]\](\w*)/) { Article.link_to($1, $2 + $3) }
- str = str.gsub(/\[\[(.*?)\]\](\w*)/) { Article.link_to($1, $1 + $2) }
-
- # Strip refs
- str = str.gsub(/<ref>.*?<\/ref>/, '')
-
- # Templates, which may be nested, and which we need to parse from innermost first
- while (new = parse_template(str)) != str
- str = new
- end
-
- # External links
- str = str.gsub(/\[([^\][:space:]]+) ([^\]]+)\]/) {"<a href=\"#{$1}\">#{$2}</a>"}
- str = str.gsub(/\[([^\][:space:]]+)\]/) {"<a href=\"#{$1}\">#{$1}</a>"}
- end
-end
-
-class Article
- attr_accessor :text
- attr_accessor :block
- attr_accessor :title
-
- def parsed_text
- Parser.new.parse(self.text)
- end
-
- def as_html
- %Q[<html><head><title>#{title} - #{READER}</title></head>
- <body>
- #{SEARCH_BOX}
- <h1>#{title}</h1><h5>#{READER}</h5><p><small>#{text.size} bytes from block #{block}
- (<a href="/raw/#{CGI::escape(title.titleize)}">raw</a>)</small></p>
- #{parsed_text}
- </body></html>]
- end
-
- def self.link_to(name, text)
- "<a href=\"/wiki/#{CGI::escape(name.titleize)}\">#{text}</a>"
- end
-end
-
-class SearchResult
- attr_accessor :results
- attr_accessor :needle
-
- def as_html
- %Q[<html><head><title>Search: #{needle} - #{READER}</title></head>
- <body>
- #{SEARCH_BOX}
- <h1>Search: #{needle}</h1>
- <ul>#{results.map{|r| "<li>" + Article.link_to(r, r) + "</li>"}.join}</ul>
- <p><small>Searches return up to #{MAXRES} articles containing the search string anywhere in their title.
- Results are case-insensitive. Exact matches appear first, followed by prefix matches, and, lastly, substring matches.
- Press ^S to quickly jump to search.</small></p>
- </body>
- </html>]
- end
-end
-
-class WPArticleReader
- inline(:C) do |builder|
- builder.add_compile_flags "-I../c -I. -lbz2 -DDEBUG"
- builder.add_compile_flags "../c/bzipreader.c"
- builder.add_compile_flags "../c/wp.c"
- builder.add_compile_flags "../c/lsearcher.c"
- builder.add_compile_flags "../c/safe.c"
- builder.add_compile_flags "../c/blocks.c"
-
- builder.prefix %Q$
- #include "wp.h"
- #define MAXRES #{MAXRES}
- #define MAXSTR 1024
-
- wp_dump d = {0};
- wp_article a = {0};
-
- char results[MAXRES][MAXSTR];
- int nresults;
-
- bool __handle_result(char *s) {
- strncpy(results[nresults], s, MAXSTR);
- results[nresults][MAXSTR - 1] = \'\\0\';
- char *end = strrchr(results[nresults], \' \');
-
- if(end) {
- *(end - 1) = \'\\0\';
- nresults++;
- }
-
- return nresults < MAXRES;
- }
- $
-
- builder.c 'void __load_dump(char *dump, char *loc, char *ploc, char *blocks) {
- load_dump(&d, dump, loc, ploc, blocks);
- init_article(&a);
- }'
-
- builder.c 'char *__load_article(char *name) {
- a.block = 0;
- a.text[0] = \'\0\';
- load_article(&d, name, &a);
- return a.text;
- }'
-
- builder.c 'int __article_block() {
- return a.block;
- }'
-
- builder.c 'int __article_size() {
- return strlen(a.text);
- }'
-
-
- builder.c 'int __search(char *needle) {
- nresults = 0;
- search(&d.index, needle, __handle_result, NULL, true, true);
- return nresults;
- }'
-
- builder.c 'char *__result(int n) {
- return results[n];
- }'
- end
-
- def initialize(opts)
- @locatedb = opts[:locatedb]
- @prefixdb = opts[:prefixdb]
- @blockdb = opts[:blockdb]
- @dump = opts[:dump]
-
- __load_dump(@dump, @locatedb, @prefixdb, @blockdb)
- end
-
- def fetch(name)
- text = __load_article(name)
- a = Article.new
- a.text = text
- a.block = __article_block
- a.title = name
- a
- end
-
- def find(name)
- n = __search(name)
- r = SearchResult.new
- r.needle = name
- r.results = (0..n - 1).map {|n| __result(n)}
- r
- end
-end
-
-class WPHandler < Mongrel::HttpHandler
- def initialize(base)
- $stderr.puts "Using base #{base}"
- @reader = WPArticleReader.new(:locatedb => "#{base}.locate.db",
- :prefixdb => "#{base}.locate.prefixdb",
- :blockdb => "#{base}.blocks.db",
- :dump => "#{base}.processed")
- @parser = Parser.new
- end
-
- def path(req)
- CGI::unescape(req.params["REQUEST_URI"])
- end
-
- def notfound(resp, str)
- respond(resp, true, 404) { "Couldn't find #{str}. <p>#{USAGE}</p>" }
- end
-
- def respond(resp, html=true, status=200)
- resp.start(200) do |h, o|
- h["Content-type"] = (html ? 'text/html' : 'text/plain') + '; charset=utf-8'
- o.write yield
- end
- end
-
- def process(req, resp)
- if path(req) =~ /^\/(wiki|raw)\/(.+)$/
- article = @reader.fetch($2)
-
- if article.text.empty?
- notfound(resp, $2)
- else
- if $1 == "wiki"
- respond(resp) { article.as_html }
- elsif $1 == "raw"
- respond(resp, false) { article.text }
- end
- end
- elsif path(req) =~ /^\/search\?s=(.+)$/
- respond(resp) { @reader.find($1).as_html }
- else
- notfound(resp, path(req))
- end
- end
-end
-
-class WPServer
- def self.start_on(port)
- self.new(:port => port).run
- end
-
- def initialize(opts={})
- @port = opts[:port] || 9000
- @host = opts[:host] || '0.0.0.0'
- end
-
- def run
- $stderr.puts "Binding to #{@host}:#{@port}"
-
- conf = Mongrel::Configurator.new(:port => @port,
- :host => @host) {
- listener do
- uri '/', :handler => WPHandler.new(ARGV.first), :in_front => true
- end
-
- trap("INT") { stop }
-
- run
- }
-
- conf.join
- end
-end
diff --git a/woip/rb/titles.rb b/woip/rb/titles.rb
deleted file mode 100644
index ec03c22..0000000
--- a/woip/rb/titles.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require File.join(File.dirname(__FILE__), 'article')
-require File.join(File.dirname(__FILE__), 'common')
-
-def process_titles
- while true
- line = stdin_gets
- if line.chomp == START_HEADING
- puts stdin_gets.chomp
- end
- end
-rescue EOF
- $stderr.puts "Done"
-end
-
-if __FILE__ == $0
- process_titles
-end \ No newline at end of file
diff --git a/woip/rb/xapian-index.rb b/woip/rb/xapian-index.rb
deleted file mode 100644
index 2f06fa4..0000000
--- a/woip/rb/xapian-index.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'xapian'
-
-db = Xapian::WritableDatabase.new(ARGV[0], Xapian::DB_CREATE_OR_OPEN)
-stem = Xapian::TermGenerator.new()
-f = File.open(ARGV[1], 'r')
-processed = 0
-
-begin
- while (line = f.readline)
- begin
- split = line.split("|")
- next if split.first == ""
-
- doc = Xapian::Document.new
- doc.data = line
- doc.add_posting(split.first.downcase, 1)
- db.add_document(doc)
- processed += 1
-
- if processed % 100 == 0
- $stderr.puts "#{processed}\t#{split.first}"
- end
- rescue
- puts line
- raise $!
- end
- end
-rescue EOFError
- $stderr.puts "Done"
-end
diff --git a/woip/rb/xmlprocess.rb b/woip/rb/xmlprocess.rb
deleted file mode 100644
index 8638c2e..0000000
--- a/woip/rb/xmlprocess.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require "rexml/document"
-require "rexml/streamlistener"
-require File.join(File.dirname(__FILE__), 'article')
-
-include REXML
-
-class ArticleListener
- include StreamListener
-
- def initialize
- @processed = 0
- @start = Time.now
- end
-
- def text(text)
- @cur_text = text.gsub(/\n+/, "\n")
- end
-
- def print_stats
- rate = (((@processed.to_f / (Time.now - @start)) * 100).round) / 100.0
- $stderr.puts "Processed: #{@processed}\tRate: #{rate}/sec"
- end
-
- def is_desirable(article)
- not (article.title =~ /\:/ or article.title =~ /\//)
- end
-
- def tag_start(name, attrs)
- if name == 'page'
- @cur_article.write($stdout) if (@cur_article)
- @cur_article = Article.new
- @processed += 1
- print_stats if (@processed % 100) == 0
- end
- end
-
- def tag_end(name)
- if name == 'title'
- @cur_article.title = @cur_text
- elsif name == 'text'
- @cur_article.body = @cur_text
- end
- end
-end
-
-def process
- Document.parse_stream($stdin, ArticleListener.new)
-end
-
-if __FILE__ == $0
- process
-end
diff --git a/woip/sh/livesearch b/woip/sh/livesearch
deleted file mode 100755
index 9f4cc6f..0000000
--- a/woip/sh/livesearch
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-../c/livesearch $1.processed $1.locate.db $1.locate.prefixdb $1.blocks.db \ No newline at end of file
diff --git a/woip/sh/process b/woip/sh/process
deleted file mode 100755
index 9ca4476..0000000
--- a/woip/sh/process
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/zsh
-
-if [ ! -n "$1" ]; then
- echo "process <file>"
- exit -1
-else
- file=$1
-fi
-
-ofile="$file.processed"
-if [ ! -f $ofile ]; then
- echo "Creating processed version of $file..."
- bzcat $file | ruby ../rb/xmlprocess.rb | bzip2 > $ofile
-else
- echo "$ofile already exists"
-fi
-
-ifile="$file.index.txt"
-if [ ! -f $ifile ]; then
- echo "Creating index..."
- ruby ../rb/index.rb $ofile > $ifile
-else
- echo "$ifile already exists"
-fi
-
-sfile="$file.locate.db"
-if [ ! -f $sfile ]; then
- echo "Creating locate index..."
- cat $ifile | LC_ALL=C /usr/libexec/locate.mklocatedb > $sfile
-else
- echo "$sfile already exists"
-fi
-
-spfile="$file.locate.prefixdb"
-if [ ! -f $spfile ]; then
- echo "Creating locate prefix index..."
- ../c/lsearcher -f $sfile -c $spfile -n
-else
- echo "$spfile already exists"
-fi
-
-bfile="$file.blocks.db"
-if [ ! -f $bfile ]; then
- echo "Creating block index"
- ../c/bzipreader -f $ofile -l | awk '{print $2;}' | ../c/blocks $bfile
-else
- echo "$bfile already exists"
-fi
diff --git a/woip/sh/scan b/woip/sh/scan
deleted file mode 100755
index 3a49d44..0000000
--- a/woip/sh/scan
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/zsh
-# print bz2 debug info for given file in roundabout fashion
-
-file=$1
-ftmp="/tmp/$$.tmp"
-otmp="/tmp/$$.o.tmp"
-
-if [ ! -n "$1" ]; then
- echo "scan <file>" >/dev/stdout
- exit -1
-fi
-
-if [ -n "$2" ]; then
- arg=$2
-else
- arg="2>/dev/null"
-fi
-
-../c/bzipreader -f $file -l > $ftmp
-
-I=-1; while [ $((I++)) -lt 10 ];
-do
- offset=`cat $ftmp | grep -E "^$I" | awk '{print $2;}'`
- echo -n "$I\t$offset\t"
- eval "../c/bzipreader -f $file -n $I -x $arg > $otmp"
- cat $otmp | head | tr "\n" "\\" | head -c 30
- echo "" `cat $otmp | wc -c`
-done
diff --git a/woip/sh/server b/woip/sh/server
deleted file mode 100755
index 231d077..0000000
--- a/woip/sh/server
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-ruby -r ../rb/server.rb -e 'WPServer.start_on(9090)' -- $1
diff --git a/woip/sh/test b/woip/sh/test
deleted file mode 100755
index f3313ba..0000000
--- a/woip/sh/test
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/zsh
-
-file="../ga.wp.txt.bz2"
-bz="../c/bzipreader -f $file"
-pfile="../gawiki-latest-pages-articles.xml.bz2.processed"
-
-pushd ../c; make clean; make; popd
-
-function fail() {
- echo "FAIL:" $* >/dev/stdout
- exit -1
-}
-
-if ! (eval "$bz -x -n 1 2>/dev/null" | grep -q Daoine); then
- fail decompression
-fi
-
-if ! (eval "$bz -x -b 0" | grep -q Esperanto); then
- fail decompression with 0 offset
-fi
-
-last=`eval "$bz -l | tail -1 | awk '{print \\$2;}'"`
-if ! (eval "$bz -x -b $last" | grep -q Nikon); then
- fail decompression with $last offset
-fi
-
-mv $pfile ../ga.tmp
-rm ../gawiki-*
-mv ../ga.tmp $pfile
-../sh/process `echo "$pfile" | sed -E 's/\.proc.+//'`
diff --git a/wp.py b/wp.py
deleted file mode 100644
index 8fc32f6..0000000
--- a/wp.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.33
-#
-# Don't modify this file, modify the SWIG interface instead.
-# This file is compatible with both classic and new-style classes.
-
-import _wp
-import new
-new_instancemethod = new.instancemethod
-try:
- _swig_property = property
-except NameError:
- pass # Python < 2.2 doesn't have 'property'.
-def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
- if (name == "thisown"): return self.this.own(value)
- if (name == "this"):
- if type(value).__name__ == 'PySwigObject':
- self.__dict__[name] = value
- return
- method = class_type.__swig_setmethods__.get(name,None)
- if method: return method(self,value)
- if (not static) or hasattr(self,name):
- self.__dict__[name] = value
- else:
- raise AttributeError("You cannot add attributes to %s" % self)
-
-def _swig_setattr(self,class_type,name,value):
- return _swig_setattr_nondynamic(self,class_type,name,value,0)
-
-def _swig_getattr(self,class_type,name):
- if (name == "thisown"): return self.this.own()
- method = class_type.__swig_getmethods__.get(name,None)
- if method: return method(self)
- raise AttributeError,name
-
-def _swig_repr(self):
- try: strthis = "proxy of " + self.this.__repr__()
- except: strthis = ""
- return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
-
-import types
-try:
- _object = types.ObjectType
- _newclass = 1
-except AttributeError:
- class _object : pass
- _newclass = 0
-del types
-
-
-wp_load_dump = _wp.wp_load_dump
-wp_load_article = _wp.wp_load_article
-wp_article_block = _wp.wp_article_block
-wp_article_size = _wp.wp_article_size
-wp_search = _wp.wp_search
-wp_result = _wp.wp_result
-wp_article_exists = _wp.wp_article_exists
-
-