Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e58e42cf2 | ||
|
|
e5f05fd608 | ||
|
|
12a0ca511f | ||
|
|
f93c2e14fd | ||
|
|
3a6f59e946 | ||
|
|
4956ba5d3c | ||
|
|
19b7928723 | ||
|
|
973ad606fd | ||
|
|
a7cd413a1e | ||
|
|
7438be7870 | ||
|
|
d7a45119ea | ||
|
|
a5a004adf7 | ||
|
|
9e892f5642 | ||
|
|
78102b202d | ||
|
|
f9560ef835 | ||
|
|
31facc7d20 | ||
|
|
616e521daf | ||
|
|
be92e651ff | ||
|
|
82e73bbdb2 | ||
|
|
d4db56dd39 | ||
|
|
26bf97fad4 | ||
|
|
c2095e6b66 | ||
|
|
d2c1656f5f | ||
|
|
87d01c84d2 | ||
|
|
bfcc4836d0 | ||
|
|
90a5d98cdd | ||
|
|
e52f6237f6 | ||
|
|
5f9225a9f9 | ||
|
|
14196603ad | ||
|
|
7c0757fca2 | ||
|
|
9aad851790 | ||
|
|
04cd15b799 | ||
|
|
694bd5eee6 | ||
|
|
e1f854bf51 | ||
|
|
02b12ad251 | ||
|
|
46d579b2e1 | ||
|
|
347d0b6ceb | ||
|
|
2710006ea0 | ||
|
|
547d3c98b4 | ||
|
|
cd75a27f88 | ||
|
|
a7b896abe0 | ||
|
|
ad2d74caba | ||
|
|
08d228d266 | ||
|
|
e98eefc69a | ||
|
|
39603886d3 | ||
|
|
cc0924046a | ||
|
|
1494a6f171 | ||
|
|
3a67e90581 | ||
|
|
045a818850 | ||
|
|
f13f1077fb | ||
|
|
bae91258a3 | ||
|
|
7d44233713 | ||
|
|
ffcfea14b7 | ||
|
|
2aad4e436b | ||
|
|
7023da1906 | ||
|
|
845dd4dd8b | ||
|
|
13594c689a | ||
|
|
74d8ff5b12 | ||
|
|
5bfaa295f9 | ||
|
|
4b4d90b06b | ||
|
|
11d8095453 | ||
|
|
3ada492532 | ||
|
|
1fb7b5aba9 | ||
|
|
0a2a79e3fc | ||
|
|
d38b08addb | ||
|
|
48911f1641 | ||
|
|
f2e213ee4b | ||
|
|
f603b68156 | ||
|
|
b2eb817999 | ||
|
|
1e657b6c6d | ||
|
|
2967177479 | ||
|
|
9d6ef1e3c7 | ||
|
|
ee62d4d2b1 | ||
|
|
c7bfa55f73 | ||
|
|
68db987c6e | ||
|
|
7b4a0046ea | ||
|
|
ee0c6abbc1 | ||
|
|
bf7110f695 | ||
|
|
237b292db2 | ||
|
|
b395aa3afb | ||
|
|
56d37f2f38 | ||
|
|
c6b194cd9a | ||
|
|
95bcf45ce3 | ||
|
|
3d10abbb60 | ||
|
|
0ea7c9e866 | ||
|
|
9d6a61899d | ||
|
|
50b15d16b7 | ||
|
|
e5deda3f60 | ||
|
|
65fc545d5e | ||
|
|
ca00d00f4d | ||
|
|
6203e0f8ca | ||
|
|
fc76b09ee5 | ||
|
|
947cd0feac | ||
|
|
73b6649f5d | ||
|
|
4b6140b0df | ||
|
|
5a9da0c257 | ||
|
|
3f4d87b03a | ||
|
|
9d1e96afa4 | ||
|
|
950a6547e4 | ||
|
|
41fe3243ca | ||
|
|
1533718a38 | ||
|
|
a277259658 | ||
|
|
237bbb9584 | ||
|
|
58f34c124c | ||
|
|
19fa93c230 | ||
|
|
4b1b0a110c | ||
|
|
c332060f43 | ||
|
|
fe3c72da7a | ||
|
|
2b1702456d | ||
|
|
9f52171901 | ||
|
|
dac8f8295d | ||
|
|
f5f79a12ae | ||
|
|
6f563b2256 | ||
|
|
34b47abda7 | ||
|
|
2844be94b7 | ||
|
|
75405cf655 | ||
|
|
bb130e9e28 |
Executable
+779
@@ -0,0 +1,779 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Mozilla Public License version 1.1</TITLE>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF" TEXT="#000000"
|
||||
LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
|
||||
<p align=center>
|
||||
|
||||
<b><font size=+2>MOZILLA PUBLIC LICENSE</font></b>
|
||||
|
||||
<br><b>Version 1.1</b>
|
||||
</p>
|
||||
|
||||
<p><hr WIDTH="20%"></p>
|
||||
|
||||
<p><b>1. Definitions.</b>
|
||||
|
||||
<ul><b>1.0.1. "Commercial Use" </b>means distribution or otherwise making
|
||||
|
||||
the Covered Code available to a third party.
|
||||
|
||||
<p><b>1.1. ''Contributor''</b> means each entity that creates or contributes
|
||||
|
||||
to the creation of Modifications.
|
||||
|
||||
<p><b>1.2. ''Contributor Version''</b> means the combination of the Original
|
||||
|
||||
Code, prior Modifications used by a Contributor, and the Modifications
|
||||
|
||||
made by that particular Contributor.
|
||||
|
||||
<p><b>1.3. ''Covered Code''</b> means the Original Code or Modifications
|
||||
|
||||
or the combination of the Original Code and Modifications, in each case
|
||||
|
||||
including portions thereof<b>.</b>
|
||||
|
||||
<p><b>1.4. ''Electronic Distribution Mechanism''</b> means a mechanism
|
||||
|
||||
generally accepted in the software development community for the electronic
|
||||
|
||||
transfer of data.
|
||||
|
||||
<p><b>1.5. ''Executable''</b> means Covered Code in any form other than
|
||||
|
||||
Source Code.
|
||||
|
||||
<p><b>1.6. ''Initial Developer''</b> means the individual or entity identified
|
||||
|
||||
as the Initial Developer in the Source Code notice required by <b>Exhibit
|
||||
|
||||
A</b>.
|
||||
|
||||
<p><b>1.7. ''Larger Work''</b> means a work which combines Covered Code
|
||||
|
||||
or portions thereof with code not governed by the terms of this License.
|
||||
|
||||
<p><b>1.8. ''License''</b> means this document.
|
||||
|
||||
<p><b>1.8.1. "Licensable"</b> means having the right to grant, to the maximum
|
||||
|
||||
extent possible, whether at the time of the initial grant or subsequently
|
||||
|
||||
acquired, any and all of the rights conveyed herein.
|
||||
|
||||
<p><b>1.9. ''Modifications''</b> means any addition to or deletion from
|
||||
|
||||
the substance or structure of either the Original Code or any previous
|
||||
|
||||
Modifications. When Covered Code is released as a series of files, a Modification
|
||||
|
||||
is:
|
||||
|
||||
<ul><b>A.</b> Any addition to or deletion from the contents of a file containing
|
||||
|
||||
Original Code or previous Modifications.
|
||||
|
||||
<p><b>B.</b> Any new file that contains any part of the Original Code or
|
||||
|
||||
previous Modifications.
|
||||
|
||||
<br> </ul>
|
||||
|
||||
<b>1.10. ''Original Code''</b> means Source Code of computer software code
|
||||
|
||||
which is described in the Source Code notice required by <b>Exhibit A</b>
|
||||
|
||||
as Original Code, and which, at the time of its release under this License
|
||||
|
||||
is not already Covered Code governed by this License.
|
||||
|
||||
<p><b>1.10.1. "Patent Claims"</b> means any patent claim(s), now owned
|
||||
|
||||
or hereafter acquired, including without limitation, method, process,
|
||||
|
||||
and apparatus claims, in any patent Licensable by grantor.
|
||||
|
||||
<p><b>1.11. ''Source Code''</b> means the preferred form of the Covered
|
||||
|
||||
Code for making modifications to it, including all modules it contains,
|
||||
|
||||
plus any associated interface definition files, scripts used to control
|
||||
|
||||
compilation and installation of an Executable, or source code differential
|
||||
|
||||
comparisons against either the Original Code or another well known, available
|
||||
|
||||
Covered Code of the Contributor's choice. The Source Code can be in a compressed
|
||||
|
||||
or archival form, provided the appropriate decompression or de-archiving
|
||||
|
||||
software is widely available for no charge.
|
||||
|
||||
<p><b>1.12. "You'' (or "Your") </b> means an individual or a legal
|
||||
|
||||
entity exercising rights under, and complying with all of the terms of,
|
||||
|
||||
this License or a future version of this License issued under Section 6.1.
|
||||
|
||||
For legal entities, "You'' includes any entity which controls, is controlled
|
||||
|
||||
by, or is under common control with You. For purposes of this definition,
|
||||
|
||||
"control'' means (a) the power, direct or indirect, to cause the direction
|
||||
|
||||
or management of such entity, whether by contract or otherwise, or (b)
|
||||
|
||||
ownership of more than fifty percent (50%) of the outstanding shares or
|
||||
|
||||
beneficial ownership of such entity.</ul>
|
||||
|
||||
<b>2. Source Code License.</b>
|
||||
|
||||
<ul><b>2.1. The Initial Developer Grant.</b>
|
||||
|
||||
<br>The Initial Developer hereby grants You a world-wide, royalty-free,
|
||||
|
||||
non-exclusive license, subject to third party intellectual property claims:
|
||||
|
||||
<ul><b>(a)</b> <b> </b>under intellectual property rights (other than
|
||||
|
||||
patent or trademark) Licensable by Initial Developer to use, reproduce,
|
||||
|
||||
modify, display, perform, sublicense and distribute the Original Code (or
|
||||
|
||||
portions thereof) with or without Modifications, and/or as part of a Larger
|
||||
|
||||
Work; and
|
||||
|
||||
<p><b>(b)</b> under Patents Claims infringed by the making, using or selling
|
||||
|
||||
of Original Code, to make, have made, use, practice, sell, and offer for
|
||||
|
||||
sale, and/or otherwise dispose of the Original Code (or portions thereof).
|
||||
|
||||
<ul>
|
||||
|
||||
<ul> </ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<b>(c) </b>the licenses granted in this Section 2.1(a) and (b) are effective
|
||||
|
||||
on the date Initial Developer first distributes Original Code under the
|
||||
|
||||
terms of this License.
|
||||
|
||||
<p><b>(d) </b>Notwithstanding Section 2.1(b) above, no patent license is
|
||||
|
||||
granted: 1) for code that You delete from the Original Code; 2) separate
|
||||
|
||||
from the Original Code; or 3) for infringements caused by: i) the
|
||||
|
||||
modification of the Original Code or ii) the combination of the Original
|
||||
|
||||
Code with other software or devices.
|
||||
|
||||
<br> </ul>
|
||||
|
||||
<b>2.2. Contributor Grant.</b>
|
||||
|
||||
<br>Subject to third party intellectual property claims, each Contributor
|
||||
|
||||
hereby grants You a world-wide, royalty-free, non-exclusive license
|
||||
|
||||
<ul>
|
||||
|
||||
<br><b>(a)</b> <b> </b>under intellectual property rights (other than
|
||||
|
||||
patent or trademark) Licensable by Contributor, to use, reproduce, modify,
|
||||
|
||||
display, perform, sublicense and distribute the Modifications created by
|
||||
|
||||
such Contributor (or portions thereof) either on an unmodified basis, with
|
||||
|
||||
other Modifications, as Covered Code and/or as part of a Larger Work; and
|
||||
|
||||
<p><b>(b)</b> under Patent Claims infringed by the making, using, or selling
|
||||
|
||||
of Modifications made by that Contributor either alone and/or in<font color="#000000">
|
||||
|
||||
combination with its Contributor Version (or portions of such combination),
|
||||
|
||||
to make, use, sell, offer for sale, have made, and/or otherwise dispose
|
||||
|
||||
of: 1) Modifications made by that Contributor (or portions thereof); and
|
||||
|
||||
2) the combination of Modifications made by that Contributor with
|
||||
|
||||
its Contributor Version (or portions of such combination).</font>
|
||||
|
||||
<p><b>(c) </b>the licenses granted in Sections 2.2(a) and 2.2(b) are effective
|
||||
|
||||
on the date Contributor first makes Commercial Use of the Covered Code.
|
||||
|
||||
<p><b>(d) </b> Notwithstanding Section 2.2(b) above, no
|
||||
|
||||
patent license is granted: 1) for any code that Contributor has deleted
|
||||
|
||||
from the Contributor Version; 2) separate from the Contributor Version;
|
||||
|
||||
3) for infringements caused by: i) third party modifications of Contributor
|
||||
|
||||
Version or ii) the combination of Modifications made by that Contributor
|
||||
|
||||
with other software (except as part of the Contributor Version) or
|
||||
|
||||
other devices; or 4) under Patent Claims infringed by Covered Code in the
|
||||
|
||||
absence of Modifications made by that Contributor.</ul>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<p><br><b>3. Distribution Obligations.</b>
|
||||
|
||||
<ul><b>3.1. Application of License.</b>
|
||||
|
||||
<br>The Modifications which You create or to which You contribute are governed
|
||||
|
||||
by the terms of this License, including without limitation Section <b>2.2</b>.
|
||||
|
||||
The Source Code version of Covered Code may be distributed only under the
|
||||
|
||||
terms of this License or a future version of this License released under
|
||||
|
||||
Section <b>6.1</b>, and You must include a copy of this License with every
|
||||
|
||||
copy of the Source Code You distribute. You may not offer or impose any
|
||||
|
||||
terms on any Source Code version that alters or restricts the applicable
|
||||
|
||||
version of this License or the recipients' rights hereunder. However, You
|
||||
|
||||
may include an additional document offering the additional rights described
|
||||
|
||||
in Section <b>3.5</b>.
|
||||
|
||||
<p><b>3.2. Availability of Source Code.</b>
|
||||
|
||||
<br>Any Modification which You create or to which You contribute must be
|
||||
|
||||
made available in Source Code form under the terms of this License either
|
||||
|
||||
on the same media as an Executable version or via an accepted Electronic
|
||||
|
||||
Distribution Mechanism to anyone to whom you made an Executable version
|
||||
|
||||
available; and if made available via Electronic Distribution Mechanism,
|
||||
|
||||
must remain available for at least twelve (12) months after the date it
|
||||
|
||||
initially became available, or at least six (6) months after a subsequent
|
||||
|
||||
version of that particular Modification has been made available to such
|
||||
|
||||
recipients. You are responsible for ensuring that the Source Code version
|
||||
|
||||
remains available even if the Electronic Distribution Mechanism is maintained
|
||||
|
||||
by a third party.
|
||||
|
||||
<p><b>3.3. Description of Modifications.</b>
|
||||
|
||||
<br>You must cause all Covered Code to which You contribute to contain
|
||||
|
||||
a file documenting the changes You made to create that Covered Code and
|
||||
|
||||
the date of any change. You must include a prominent statement that the
|
||||
|
||||
Modification is derived, directly or indirectly, from Original Code provided
|
||||
|
||||
by the Initial Developer and including the name of the Initial Developer
|
||||
|
||||
in (a) the Source Code, and (b) in any notice in an Executable version
|
||||
|
||||
or related documentation in which You describe the origin or ownership
|
||||
|
||||
of the Covered Code.
|
||||
|
||||
<p><b>3.4. Intellectual Property Matters</b>
|
||||
|
||||
<ul><b>(a) Third Party Claims</b>.
|
||||
|
||||
<br>If Contributor has knowledge that a license under a third party's intellectual
|
||||
|
||||
property rights is required to exercise the rights granted by such Contributor
|
||||
|
||||
under Sections 2.1 or 2.2, Contributor must include a text file with the
|
||||
|
||||
Source Code distribution titled "LEGAL'' which describes the claim and
|
||||
|
||||
the party making the claim in sufficient detail that a recipient will know
|
||||
|
||||
whom to contact. If Contributor obtains such knowledge after the Modification
|
||||
|
||||
is made available as described in Section 3.2, Contributor shall promptly
|
||||
|
||||
modify the LEGAL file in all copies Contributor makes available thereafter
|
||||
|
||||
and shall take other steps (such as notifying appropriate mailing lists
|
||||
|
||||
or newsgroups) reasonably calculated to inform those who received the Covered
|
||||
|
||||
Code that new knowledge has been obtained.
|
||||
|
||||
<p><b>(b) Contributor APIs</b>.
|
||||
|
||||
<br>If Contributor's Modifications include an application programming interface
|
||||
|
||||
and Contributor has knowledge of patent licenses which are reasonably necessary
|
||||
|
||||
to implement that API, Contributor must also include this information in
|
||||
|
||||
the LEGAL file.
|
||||
|
||||
<br> </ul>
|
||||
|
||||
<b>(c)
|
||||
|
||||
Representations.</b>
|
||||
|
||||
<ul>Contributor represents that, except as disclosed pursuant to Section
|
||||
|
||||
3.4(a) above, Contributor believes that Contributor's Modifications are
|
||||
|
||||
Contributor's original creation(s) and/or Contributor has sufficient rights
|
||||
|
||||
to grant the rights conveyed by this License.</ul>
|
||||
|
||||
|
||||
|
||||
<p><br><b>3.5. Required Notices.</b>
|
||||
|
||||
<br>You must duplicate the notice in <b>Exhibit A</b> in each file of the
|
||||
|
||||
Source Code. If it is not possible to put such notice in a particular
|
||||
|
||||
Source Code file due to its structure, then You must include such notice
|
||||
|
||||
in a location (such as a relevant directory) where a user would be likely
|
||||
|
||||
to look for such a notice. If You created one or more Modification(s)
|
||||
|
||||
You may add your name as a Contributor to the notice described in <b>Exhibit
|
||||
|
||||
A</b>. You must also duplicate this License in any documentation
|
||||
|
||||
for the Source Code where You describe recipients' rights or ownership
|
||||
|
||||
rights relating to Covered Code. You may choose to offer, and to
|
||||
|
||||
charge a fee for, warranty, support, indemnity or liability obligations
|
||||
|
||||
to one or more recipients of Covered Code. However, You may do so only
|
||||
|
||||
on Your own behalf, and not on behalf of the Initial Developer or any Contributor.
|
||||
|
||||
You must make it absolutely clear than any such warranty, support, indemnity
|
||||
|
||||
or liability obligation is offered by You alone, and You hereby agree to
|
||||
|
||||
indemnify the Initial Developer and every Contributor for any liability
|
||||
|
||||
incurred by the Initial Developer or such Contributor as a result of warranty,
|
||||
|
||||
support, indemnity or liability terms You offer.
|
||||
|
||||
<p><b>3.6. Distribution of Executable Versions.</b>
|
||||
|
||||
<br>You may distribute Covered Code in Executable form only if the requirements
|
||||
|
||||
of Section <b>3.1-3.5</b> have been met for that Covered Code, and if You
|
||||
|
||||
include a notice stating that the Source Code version of the Covered Code
|
||||
|
||||
is available under the terms of this License, including a description of
|
||||
|
||||
how and where You have fulfilled the obligations of Section <b>3.2</b>.
|
||||
|
||||
The notice must be conspicuously included in any notice in an Executable
|
||||
|
||||
version, related documentation or collateral in which You describe recipients'
|
||||
|
||||
rights relating to the Covered Code. You may distribute the Executable
|
||||
|
||||
version of Covered Code or ownership rights under a license of Your choice,
|
||||
|
||||
which may contain terms different from this License, provided that You
|
||||
|
||||
are in compliance with the terms of this License and that the license for
|
||||
|
||||
the Executable version does not attempt to limit or alter the recipient's
|
||||
|
||||
rights in the Source Code version from the rights set forth in this License.
|
||||
|
||||
If You distribute the Executable version under a different license You
|
||||
|
||||
must make it absolutely clear that any terms which differ from this License
|
||||
|
||||
are offered by You alone, not by the Initial Developer or any Contributor.
|
||||
|
||||
You hereby agree to indemnify the Initial Developer and every Contributor
|
||||
|
||||
for any liability incurred by the Initial Developer or such Contributor
|
||||
|
||||
as a result of any such terms You offer.
|
||||
|
||||
<p><b>3.7. Larger Works.</b>
|
||||
|
||||
<br>You may create a Larger Work by combining Covered Code with other code
|
||||
|
||||
not governed by the terms of this License and distribute the Larger Work
|
||||
|
||||
as a single product. In such a case, You must make sure the requirements
|
||||
|
||||
of this License are fulfilled for the Covered Code.</ul>
|
||||
|
||||
<b>4. Inability to Comply Due to Statute or Regulation.</b>
|
||||
|
||||
<ul>If it is impossible for You to comply with any of the terms of this
|
||||
|
||||
License with respect to some or all of the Covered Code due to statute,
|
||||
|
||||
judicial order, or regulation then You must: (a) comply with the terms
|
||||
|
||||
of this License to the maximum extent possible; and (b) describe the limitations
|
||||
|
||||
and the code they affect. Such description must be included in the LEGAL
|
||||
|
||||
file described in Section <b>3.4</b> and must be included with all distributions
|
||||
|
||||
of the Source Code. Except to the extent prohibited by statute or regulation,
|
||||
|
||||
such description must be sufficiently detailed for a recipient of ordinary
|
||||
|
||||
skill to be able to understand it.</ul>
|
||||
|
||||
<b>5. Application of this License.</b>
|
||||
|
||||
<ul>This License applies to code to which the Initial Developer has attached
|
||||
|
||||
the notice in <b>Exhibit A</b> and to related Covered Code.</ul>
|
||||
|
||||
<b>6. Versions of the License.</b>
|
||||
|
||||
<ul><b>6.1. New Versions</b>.
|
||||
|
||||
<br>Netscape Communications Corporation (''Netscape'') may publish revised
|
||||
|
||||
and/or new versions of the License from time to time. Each version will
|
||||
|
||||
be given a distinguishing version number.
|
||||
|
||||
<p><b>6.2. Effect of New Versions</b>.
|
||||
|
||||
<br>Once Covered Code has been published under a particular version of
|
||||
|
||||
the License, You may always continue to use it under the terms of that
|
||||
|
||||
version. You may also choose to use such Covered Code under the terms of
|
||||
|
||||
any subsequent version of the License published by Netscape. No one other
|
||||
|
||||
than Netscape has the right to modify the terms applicable to Covered Code
|
||||
|
||||
created under this License.
|
||||
|
||||
<p><b>6.3. Derivative Works</b>.
|
||||
|
||||
<br>If You create or use a modified version of this License (which you
|
||||
|
||||
may only do in order to apply it to code which is not already Covered Code
|
||||
|
||||
governed by this License), You must (a) rename Your license so that the
|
||||
|
||||
phrases ''Mozilla'', ''MOZILLAPL'', ''MOZPL'', ''Netscape'', "MPL", ''NPL''
|
||||
|
||||
or any confusingly similar phrase do not appear in your license (except
|
||||
|
||||
to note that your license differs from this License) and (b) otherwise
|
||||
|
||||
make it clear that Your version of the license contains terms which differ
|
||||
|
||||
from the Mozilla Public License and Netscape Public License. (Filling in
|
||||
|
||||
the name of the Initial Developer, Original Code or Contributor in the
|
||||
|
||||
notice described in <b>Exhibit A</b> shall not of themselves be deemed
|
||||
|
||||
to be modifications of this License.)</ul>
|
||||
|
||||
<b>7. DISCLAIMER OF WARRANTY.</b>
|
||||
|
||||
<ul>COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT
|
||||
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
|
||||
|
||||
WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT
|
||||
|
||||
FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY
|
||||
|
||||
AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE
|
||||
|
||||
PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
|
||||
|
||||
CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
|
||||
|
||||
NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.</ul>
|
||||
|
||||
<b>8. TERMINATION.</b>
|
||||
|
||||
<ul><b>8.1. </b>This License and the rights granted hereunder will
|
||||
|
||||
terminate automatically if You fail to comply with terms herein and fail
|
||||
|
||||
to cure such breach within 30 days of becoming aware of the breach. All
|
||||
|
||||
sublicenses to the Covered Code which are properly granted shall survive
|
||||
|
||||
any termination of this License. Provisions which, by their nature, must
|
||||
|
||||
remain in effect beyond the termination of this License shall survive.
|
||||
|
||||
<p><b>8.2. </b>If You initiate litigation by asserting a patent infringement
|
||||
|
||||
claim (excluding declatory judgment actions) against Initial Developer
|
||||
|
||||
or a Contributor (the Initial Developer or Contributor against whom You
|
||||
|
||||
file such action is referred to as "Participant") alleging that:
|
||||
|
||||
<p><b>(a) </b>such Participant's Contributor Version directly or
|
||||
|
||||
indirectly infringes any patent, then any and all rights granted by such
|
||||
|
||||
Participant to You under Sections 2.1 and/or 2.2 of this License shall,
|
||||
|
||||
upon 60 days notice from Participant terminate prospectively, unless if
|
||||
|
||||
within 60 days after receipt of notice You either: (i) agree in writing
|
||||
|
||||
to pay Participant a mutually agreeable reasonable royalty for Your past
|
||||
|
||||
and future use of Modifications made by such Participant, or (ii) withdraw
|
||||
|
||||
Your litigation claim with respect to the Contributor Version against such
|
||||
|
||||
Participant. If within 60 days of notice, a reasonable royalty and
|
||||
|
||||
payment arrangement are not mutually agreed upon in writing by the parties
|
||||
|
||||
or the litigation claim is not withdrawn, the rights granted by Participant
|
||||
|
||||
to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration
|
||||
|
||||
of the 60 day notice period specified above.
|
||||
|
||||
<p><b>(b)</b> any software, hardware, or device, other than such
|
||||
|
||||
Participant's Contributor Version, directly or indirectly infringes any
|
||||
|
||||
patent, then any rights granted to You by such Participant under Sections
|
||||
|
||||
2.1(b) and 2.2(b) are revoked effective as of the date You first made,
|
||||
|
||||
used, sold, distributed, or had made, Modifications made by that Participant.
|
||||
|
||||
<p><b>8.3. </b>If You assert a patent infringement claim against
|
||||
|
||||
Participant alleging that such Participant's Contributor Version directly
|
||||
|
||||
or indirectly infringes any patent where such claim is resolved (such as
|
||||
|
||||
by license or settlement) prior to the initiation of patent infringement
|
||||
|
||||
litigation, then the reasonable value of the licenses granted by such Participant
|
||||
|
||||
under Sections 2.1 or 2.2 shall be taken into account in determining the
|
||||
|
||||
amount or value of any payment or license.
|
||||
|
||||
<p><b>8.4.</b> In the event of termination under Sections 8.1 or
|
||||
|
||||
8.2 above, all end user license agreements (excluding distributors
|
||||
|
||||
and resellers) which have been validly granted by You or any distributor
|
||||
|
||||
hereunder prior to termination shall survive termination.</ul>
|
||||
|
||||
<b>9. LIMITATION OF LIABILITY.</b>
|
||||
|
||||
<ul>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
|
||||
|
||||
NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER,
|
||||
|
||||
ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER
|
||||
|
||||
OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
|
||||
|
||||
INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
|
||||
|
||||
LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE
|
||||
|
||||
OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN
|
||||
|
||||
IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR
|
||||
|
||||
PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE
|
||||
|
||||
LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
|
||||
|
||||
OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION
|
||||
|
||||
AND LIMITATION MAY NOT APPLY TO YOU.</ul>
|
||||
|
||||
<b>10. U.S. GOVERNMENT END USERS.</b>
|
||||
|
||||
<ul>The Covered Code is a ''commercial item,'' as that term is defined
|
||||
|
||||
in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software''
|
||||
|
||||
and ''commercial computer software documentation,'' as such terms are used
|
||||
|
||||
in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and
|
||||
|
||||
48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government
|
||||
|
||||
End Users acquire Covered Code with only those rights set forth herein.</ul>
|
||||
|
||||
<b>11. MISCELLANEOUS.</b>
|
||||
|
||||
<ul>This License represents the complete agreement concerning subject matter
|
||||
|
||||
hereof. If any provision of this License is held to be unenforceable, such
|
||||
|
||||
provision shall be reformed only to the extent necessary to make it enforceable.
|
||||
|
||||
This License shall be governed by California law provisions (except to
|
||||
|
||||
the extent applicable law, if any, provides otherwise), excluding its conflict-of-law
|
||||
|
||||
provisions. With respect to disputes in which at least one party is a citizen
|
||||
|
||||
of, or an entity chartered or registered to do business in the United States
|
||||
|
||||
of America, any litigation relating to this License shall be subject to
|
||||
|
||||
the jurisdiction of the Federal Courts of the Northern District of California,
|
||||
|
||||
with venue lying in Santa Clara County, California, with the losing party
|
||||
|
||||
responsible for costs, including without limitation, court costs and reasonable
|
||||
|
||||
attorneys' fees and expenses. The application of the United Nations Convention
|
||||
|
||||
on Contracts for the International Sale of Goods is expressly excluded.
|
||||
|
||||
Any law or regulation which provides that the language of a contract shall
|
||||
|
||||
be construed against the drafter shall not apply to this License.</ul>
|
||||
|
||||
<b>12. RESPONSIBILITY FOR CLAIMS.</b>
|
||||
|
||||
<ul>As between Initial Developer and the Contributors, each party is responsible
|
||||
|
||||
for claims and damages arising, directly or indirectly, out of its utilization
|
||||
|
||||
of rights under this License and You agree to work with Initial Developer
|
||||
|
||||
and Contributors to distribute such responsibility on an equitable basis.
|
||||
|
||||
Nothing herein is intended or shall be deemed to constitute any admission
|
||||
|
||||
of liability.</ul>
|
||||
|
||||
<b>13. MULTIPLE-LICENSED CODE.</b>
|
||||
|
||||
<ul>Initial Developer may designate portions of the Covered Code as “Multiple-Licensed”.
|
||||
|
||||
“Multiple-Licensed” means that the Initial Developer permits you to utilize
|
||||
|
||||
portions of the Covered Code under Your choice of the NPL or the alternative
|
||||
|
||||
licenses, if any, specified by the Initial Developer in the file described
|
||||
|
||||
in Exhibit A.</ul>
|
||||
|
||||
|
||||
|
||||
<p><br><b>EXHIBIT A -Mozilla Public License.</b>
|
||||
|
||||
<ul>``The contents of this file are subject to the Mozilla Public License
|
||||
|
||||
Version 1.1 (the "License"); you may not use this file except in compliance
|
||||
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
<br>http://www.mozilla.org/MPL/
|
||||
|
||||
<p>Software distributed under the License is distributed on an "AS IS"
|
||||
|
||||
basis, WITHOUT WARRANTY OF
|
||||
|
||||
<br>ANY KIND, either express or implied. See the License for the specific
|
||||
|
||||
language governing rights and
|
||||
|
||||
<br>limitations under the License.
|
||||
|
||||
<p>The Original Code is ______________________________________.
|
||||
|
||||
<p>The Initial Developer of the Original Code is ________________________.
|
||||
|
||||
Portions created by
|
||||
|
||||
<br> ______________________ are Copyright (C) ______ _______________________.
|
||||
|
||||
All Rights
|
||||
|
||||
<br>Reserved.
|
||||
|
||||
<p>Contributor(s): ______________________________________.
|
||||
|
||||
<p>Alternatively, the contents of this file may be used under the terms
|
||||
|
||||
of the _____ license (the “[___] License”), in which case the provisions
|
||||
|
||||
of [______] License are applicable instead of those above.
|
||||
|
||||
If you wish to allow use of your version of this file only under the terms
|
||||
|
||||
of the [____] License and not to allow others to use your version of this
|
||||
|
||||
file under the MPL, indicate your decision by deleting the provisions
|
||||
|
||||
above and replace them with the notice and other provisions required
|
||||
|
||||
by the [___] License. If you do not delete the provisions above,
|
||||
|
||||
a recipient may use your version of this file under either the MPL or the
|
||||
|
||||
[___] License."
|
||||
|
||||
<p>[NOTE: The text of this Exhibit A may differ slightly from the text
|
||||
|
||||
of the notices in the Source Code files of the Original Code. You should
|
||||
|
||||
use the text of this Exhibit A rather than the text found in the Original
|
||||
|
||||
Code Source Code for Your Modifications.]
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
+7
-4
@@ -1,14 +1,17 @@
|
||||
CC=gcc
|
||||
# If you know what your system's byte order is, define BYTE_ORDER:
|
||||
# use -DBYTE_ORDER=12 for little-endian byte order;
|
||||
# use -DBYTE_ORDER=21 for big-endian (network) byte order.
|
||||
CFLAGS=-O2 -Ixmltok -Ixmlparse
|
||||
# If you know what your system's byte order is, define XML_BYTE_ORDER:
|
||||
# use -DXML_BYTE_ORDER=12 for little-endian byte order;
|
||||
# use -DXML_BYTE_ORDER=21 for big-endian (network) byte order.
|
||||
# -DXML_NS adds support for checking of lexical aspects of XML namespaces spec
|
||||
# -DXML_MIN_SIZE makes a smaller but slower parser
|
||||
CFLAGS=-O2 -Ixmltok -Ixmlparse -DXML_NS
|
||||
# Use one of the next two lines; unixfilemap is better if it works.
|
||||
FILEMAP_OBJ=xmlwf/unixfilemap.o
|
||||
#FILEMAP_OBJ=xmlwf/readfilemap.o
|
||||
OBJS=xmltok/xmltok.o \
|
||||
xmltok/xmlrole.o \
|
||||
xmlwf/xmlwf.o \
|
||||
xmlwf/xmlfile.o \
|
||||
xmlwf/codepage.o \
|
||||
xmlparse/xmlparse.o \
|
||||
xmlparse/hashtable.o \
|
||||
|
||||
Executable
+71
@@ -0,0 +1,71 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "gennmtab"=".\gennmtab\gennmtab.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "xmlparse"=".\xmlparse\xmlparse.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name xmltok
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "xmltok"=".\xmltok\xmltok.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "xmlwf"=".\xmlwf\xmlwf.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name xmlparse
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
+24
-12
@@ -9,18 +9,21 @@
|
||||
|
||||
<H1>expat - XML Parser Toolkit</H1>
|
||||
|
||||
<H3>Version 19980621</H3>
|
||||
<H3>Version 1.1</H3>
|
||||
|
||||
<P>Copyright (c) 1998 James Clark. Expat is subject to the <A
|
||||
HREF="MPL-1_0.html">Mozilla Public License Version 1.0</A>. You may
|
||||
not use expat except in compliance with this license. Please contact
|
||||
me if you wish to negotiate an alternative license.</P><P> Expat is an
|
||||
<A HREF="http://www.w3.org/TR/1998/REC-xml-19980210">XML 1.0</A>
|
||||
parser written in C. It aims to be fully conforming. It is currently
|
||||
not a validating XML processor. Expat can be downloaded from <A href
|
||||
= "ftp://ftp.jclark.com/pub/xml/expat.zip"
|
||||
>ftp://ftp.jclark.com/pub/xml/expat.zip</A>. This is a beta-test
|
||||
version.</P>
|
||||
<P>Copyright (c) 1998, 1999 James Clark. Expat is subject to the <A
|
||||
HREF="http://www.mozilla.org/NPL/NPL-1_1Final.html">Mozilla Public
|
||||
License Version 1.1</A>. Alternatively you may use expat under the <A
|
||||
href="http://www.gnu.org/copyleft/gpl.html">GNU General Public
|
||||
License</A> instead. Please contact me if you wish to negotiate an
|
||||
alternative license.</P>
|
||||
|
||||
<P>Expat is an <A
|
||||
HREF="http://www.w3.org/TR/1998/REC-xml-19980210">XML 1.0</A> parser
|
||||
written in C. It aims to be fully conforming. It is currently not a
|
||||
validating XML processor. The current production version of expat can
|
||||
be downloaded from <A href = "ftp://ftp.jclark.com/pub/xml/expat.zip"
|
||||
>ftp://ftp.jclark.com/pub/xml/expat.zip</A>.</P>
|
||||
|
||||
<P>The directory <SAMP>xmltok</SAMP> contains a low-level library for
|
||||
tokenizing XML. The interface is documented in
|
||||
@@ -43,11 +46,20 @@ href="http://www.jclark.com/xml/canonxml.html">canonical XML</A> will
|
||||
be written to <SAMP>dir/<VAR>f</VAR></SAMP>, where
|
||||
<SAMP><VAR>f</VAR></SAMP> is the filename (without any path) of the
|
||||
input file. A <CODE>-x</CODE> option will cause references to
|
||||
external general entities to be processed.</P>
|
||||
external general entities to be processed. A <CODE>-s</CODE> option
|
||||
will make documents that are not standalone cause an error (a document
|
||||
is considered standalone if either it is intrinsically standalone
|
||||
because it has no external subset and no references to parameter
|
||||
entities in the internal subset or it is declared as standalone in the
|
||||
XML declaration).</P>
|
||||
|
||||
<P>The <SAMP>bin</SAMP> directory contains Win32 executables. The
|
||||
<SAMP>lib</SAMP> directory contains Win32 import libraries.</P>
|
||||
|
||||
<P>Answers to some frequently asked questions about expat can be found
|
||||
in the <A HREF="http://www.jclark.com/xml/expatfaq.html">expat
|
||||
FAQ</A>.</P>
|
||||
|
||||
<P></P>
|
||||
|
||||
<ADDRESS>
|
||||
|
||||
+46
-29
@@ -1,35 +1,52 @@
|
||||
--MKS Project--
|
||||
$Revision: 1.17 $
|
||||
block _mks_variant_projects
|
||||
1.11=vp0000.pj, "V1_0maintain"
|
||||
end
|
||||
EndOptions
|
||||
$(projectdir)/MPL-1_0.html a 1.1
|
||||
$(projectdir)/Makefile a 1.6
|
||||
$(projectdir)/expat.html a 1.7
|
||||
$(projectdir)/Makefile a 1.11
|
||||
$(projectdir)/expat.dsw a 1.1
|
||||
$(projectdir)/expat.html a 1.19
|
||||
$(projectdir)/expat.mak a 1.14
|
||||
$(projectdir)/files.txt a 1.3
|
||||
$(projectdir)/makedist.ksh a 1.1
|
||||
$(projectdir)/gennmtab/gennmtab.c a 1.2
|
||||
$(projectdir)/expatfaq.html a 1.3
|
||||
$(projectdir)/files.txt a 1.11
|
||||
$(projectdir)/makedist.ksh a 1.2
|
||||
$(projectdir)/win32files.txt a 1.1
|
||||
$(projectdir)/gennmtab/gennmtab.c a 1.3
|
||||
$(projectdir)/gennmtab/gennmtab.dsp a 1.1
|
||||
$(projectdir)/sample/build.bat a 1.2
|
||||
$(projectdir)/sample/elements.c a 1.1
|
||||
$(projectdir)/xmlparse/hashtable.c a 1.5
|
||||
$(projectdir)/xmlparse/hashtable.h a 1.4
|
||||
$(projectdir)/xmlparse/xmlparse.c a 1.52
|
||||
$(projectdir)/xmlparse/xmlparse.h a 1.21
|
||||
$(projectdir)/xmltok/asciitab.h a 1.4
|
||||
$(projectdir)/xmltok/dllmain.c a 1.2
|
||||
$(projectdir)/xmltok/iasciitab.h a 1.2
|
||||
$(projectdir)/xmltok/latin1tab.h a 1.2
|
||||
$(projectdir)/xmltok/utf8tab.h a 1.4
|
||||
$(projectdir)/xmltok/xmldef.h a 1.3
|
||||
$(projectdir)/xmltok/xmlrole.c a 1.9
|
||||
$(projectdir)/xmltok/xmlrole.h a 1.5
|
||||
$(projectdir)/xmltok/xmltok.c a 1.33
|
||||
$(projectdir)/xmltok/xmltok.h a 1.24
|
||||
$(projectdir)/xmltok/xmltok_impl.c a 1.26
|
||||
$(projectdir)/xmltok/xmltok_impl.h a 1.5
|
||||
$(projectdir)/xmlwf/codepage.c a 1.4
|
||||
$(projectdir)/xmlwf/codepage.h a 1.3
|
||||
$(projectdir)/xmlwf/filemap.h a 1.3
|
||||
$(projectdir)/xmlwf/readfilemap.c a 1.3
|
||||
$(projectdir)/xmlwf/unixfilemap.c a 1.2
|
||||
$(projectdir)/xmlwf/win32filemap.c a 1.4
|
||||
$(projectdir)/xmlwf/xmlwf.c a 1.31
|
||||
$(projectdir)/xmlparse/hashtable.c a 1.9
|
||||
$(projectdir)/xmlparse/hashtable.h a 1.6
|
||||
$(projectdir)/xmlparse/xmlparse.c a 1.85
|
||||
$(projectdir)/xmlparse/xmlparse.dsp a 1.6
|
||||
$(projectdir)/xmlparse/xmlparse.h a 1.35
|
||||
$(projectdir)/xmltok/asciitab.h a 1.6
|
||||
$(projectdir)/xmltok/dllmain.c a 1.4
|
||||
$(projectdir)/xmltok/iasciitab.h a 1.4
|
||||
$(projectdir)/xmltok/latin1tab.h a 1.3
|
||||
$(projectdir)/xmltok/utf8tab.h a 1.5
|
||||
$(projectdir)/xmltok/xmldef.h a 1.8
|
||||
$(projectdir)/xmltok/xmlrole.c a 1.11
|
||||
$(projectdir)/xmltok/xmlrole.h a 1.6
|
||||
$(projectdir)/xmltok/xmltok.c a 1.47
|
||||
$(projectdir)/xmltok/xmltok.dsp a 1.5
|
||||
$(projectdir)/xmltok/xmltok.h a 1.27
|
||||
$(projectdir)/xmltok/xmltok_impl.c a 1.34
|
||||
$(projectdir)/xmltok/xmltok_impl.h a 1.7
|
||||
$(projectdir)/xmltok/xmltok_ns.c a 1.4
|
||||
$(projectdir)/xmlwf/codepage.c a 1.6
|
||||
$(projectdir)/xmlwf/codepage.h a 1.4
|
||||
$(projectdir)/xmlwf/filemap.h a 1.4
|
||||
$(projectdir)/xmlwf/readfilemap.c a 1.4
|
||||
$(projectdir)/xmlwf/unixfilemap.c a 1.3
|
||||
$(projectdir)/xmlwf/win32filemap.c a 1.7
|
||||
$(projectdir)/xmlwf/xmlfile.c a 1.3
|
||||
$(projectdir)/xmlwf/xmlfile.h a 1.2
|
||||
$(projectdir)/xmlwf/xmlmime.c a 1.1
|
||||
$(projectdir)/xmlwf/xmlmime.h a 1.1
|
||||
$(projectdir)/xmlwf/xmltchar.h a 1.1
|
||||
$(projectdir)/xmlwf/xmlurl.h a 1.1
|
||||
$(projectdir)/xmlwf/xmlwf.c a 1.44
|
||||
$(projectdir)/xmlwf/xmlwf.dsp a 1.2
|
||||
$(projectdir)/xmlwf/xmlwin32url.cxx a 1.1
|
||||
|
||||
Executable
+111
@@ -0,0 +1,111 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
|
||||
<HTML>
|
||||
|
||||
<TITLE>expat FAQ</TITLE>
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>Frequently Asked Questions about Expat</H1>
|
||||
|
||||
<H4>Where can I get the latest version of expat?</H4>
|
||||
|
||||
<p>The latest production version is always available from <a
|
||||
href="ftp://ftp.jclark.com/pub/xml/expat.zip"
|
||||
>ftp://ftp.jclark.com/pub/xml/expat.zip</a>. If there is a test
|
||||
version, then it will be available from <a
|
||||
href="ftp://ftp.jclark.com/pub/test/expat.zip"
|
||||
>ftp://ftp.jclark.com/pub/test/expat.zip</a>.</p>
|
||||
|
||||
<H4>Where can I get help in using expat?</H4>
|
||||
|
||||
<p>Try the xml-dev mailing list (subscribe by mailing to <a
|
||||
href="mailto:majordomo@ic.ac.uk">majordomo@ic.ac.uk</a> with the
|
||||
message <code>subscribe xml-dev</code>). Alternatively try the <a
|
||||
href="news:comp.text.xml">comp.text.xml</a> USENET newsgroup.</p>
|
||||
|
||||
<H4>Where is expat's API documented?</H4>
|
||||
|
||||
<p>In <code>xmlparse/xmlparse.h</code>. There's also an advanced,
|
||||
low-level API you can use which is documented in
|
||||
<code>xmltok/xmltok.h</code>.</p>
|
||||
|
||||
<H4>Is there a simple example of using expat's API?</H4>
|
||||
|
||||
<p>See <code>sample/elements.c</code></p>
|
||||
|
||||
<H4>How can I get expat to deal with non-ASCII characters?</H4>
|
||||
|
||||
<P>By default, expat assumes that documents are encoded in UTF-8. In
|
||||
UTF-8, ASCII characters are represented by a single byte as they would
|
||||
be in ASCII, but non-ASCII characters are represented by a sequence of
|
||||
two or more bytes all with the 8th bit set. The encoding most widely
|
||||
used for European languages is ISO 8859-1 which is not compatible with
|
||||
UTF-8. To use this encoding, expat must be told either by supplying
|
||||
an argument of <code>"iso-8859-1"</code> to
|
||||
<code>XML_ParserCreate</code>, or by starting the document with
|
||||
<code><?xml version="1.0" encoding="iso-8859-1"?></code>.</P>
|
||||
|
||||
<H4>What encodings does expat support?</H4>
|
||||
|
||||
<P>expat has built in support for the following encodings:</P>
|
||||
|
||||
<ul>
|
||||
<li><code>utf-8</code></li>
|
||||
<li><code>utf-16</code></li>
|
||||
<li><code>iso-8859-1</code></li>
|
||||
<li><code>us-ascii</code></li>
|
||||
</ul>
|
||||
|
||||
<P>Additional encodings can be supported by using
|
||||
<code>XML_SetUnknownEncodingHandler</code>.</P>
|
||||
|
||||
<H4>How can I get expat to validate my XML documents?</H4>
|
||||
|
||||
<p>You can't. expat is not a validating parser.</p>
|
||||
|
||||
<H4>How can I get expat to read my DTD?</H4>
|
||||
|
||||
<p>expat only reads the internal DTD subset. It doesn't process an
|
||||
external DTD nor parameter entity references. This behaviour is in
|
||||
conformance with the XML Recommendation.</p>
|
||||
|
||||
<H4>Why does expat give the wrong result for the more complex example in
|
||||
Appendix D of the XML Recommendation?</H4>
|
||||
|
||||
<P>expat does not process parameter entity references. (The XML
|
||||
Recommendation only requires parsers to process parameter entity
|
||||
references when validating. See section 4.4.8.)</P>
|
||||
|
||||
<H4>Why does expat give the wrong result for test cases in James
|
||||
Clark's test suite in the <code>xmltest/valid/not-sa</code>?</H4>
|
||||
|
||||
<P>expat doesn't process parameter entities.</P>
|
||||
|
||||
<H4>How can I get expat to recover from errors?</H4>
|
||||
|
||||
<p>You can't. All well-formedness errors stop processing. Note that
|
||||
the XML Recommendation does not permit conforming XML processors to
|
||||
continue normal processing after a fatal error.</p>
|
||||
|
||||
<H4>How do I get at the characters between tags?</H4>
|
||||
|
||||
<p>Use <code>XML_SetCharacterDataHandler</code>.</p>
|
||||
|
||||
<H4>How can I minimize the size of expat?</H4>
|
||||
|
||||
<p>Compile with <code>-DXML_MIN_SIZE</code>. With Visual C++, use the
|
||||
<code>Win32 MinSize</code> configuration: this creates an
|
||||
<code>xmlparse.dll</code> that does not require
|
||||
<code>xmltok.dll</code>.</p>
|
||||
|
||||
<ADDRESS>
|
||||
|
||||
<A HREF="mailto:jjc@jclark.com">James Clark</A>
|
||||
|
||||
</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
|
||||
</HTML>
|
||||
+4
-3
@@ -1,5 +1,4 @@
|
||||
expat.html
|
||||
MPL-1_0.html
|
||||
xmltok/asciitab.h
|
||||
xmltok/dllmain.c
|
||||
gennmtab/gennmtab.c
|
||||
@@ -13,9 +12,9 @@ xmltok/xmlrole.c
|
||||
xmltok/xmlrole.h
|
||||
xmltok/xmltok.c
|
||||
xmltok/xmltok.h
|
||||
expat.mak
|
||||
xmltok/xmltok_impl.c
|
||||
xmltok/xmltok_impl.h
|
||||
xmltok/xmltok_ns.c
|
||||
xmlparse/hashtable.c
|
||||
xmlparse/hashtable.h
|
||||
xmlparse/xmlparse.c
|
||||
@@ -26,6 +25,8 @@ xmlwf/filemap.h
|
||||
xmlwf/readfilemap.c
|
||||
xmlwf/unixfilemap.c
|
||||
xmlwf/win32filemap.c
|
||||
xmlwf/xmlfile.c
|
||||
xmlwf/xmlfile.h
|
||||
xmlwf/xmltchar.h
|
||||
xmlwf/xmlwf.c
|
||||
sample/elements.c
|
||||
sample/build.bat
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
Executable
+101
@@ -0,0 +1,101 @@
|
||||
# Microsoft Developer Studio Project File - Name="gennmtab" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=gennmtab - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "gennmtab.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "gennmtab.mak" CFG="gennmtab - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "gennmtab - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "gennmtab - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "gennmtab - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir "."
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Target_Dir "."
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "gennmtab - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir "."
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\Debug"
|
||||
# PROP Intermediate_Dir ".\Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "."
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "gennmtab - Win32 Release"
|
||||
# Name "gennmtab - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gennmtab.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
Executable
+55
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
|
||||
<HTML>
|
||||
|
||||
<TITLE>Using the GPL for expat</TITLE>
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>Using the GPL for expat</H1>
|
||||
|
||||
<P>Instead of using the Mozilla Public License, you may instead elect
|
||||
to use the <A href="http://www.gnu.org/copyleft/gpl.html">GNU General
|
||||
Public License</A> (GPL) for a particular copy of expat. The election
|
||||
to use the GPL is irrevocable for that particular copy. If you do
|
||||
elect to use the GPL, then you must replace the copyright notice on
|
||||
each file with the following:</P>
|
||||
|
||||
<PRE>
|
||||
expat XML parser
|
||||
Copyright (C) 1998 James Clark
|
||||
|
||||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
</PRE>
|
||||
|
||||
<P>and you must change readme.html to say that an election has been
|
||||
made to use this copy under the GPL. If you redistribute expat, you
|
||||
should also include a copy of the GPL.</P>
|
||||
|
||||
<P>Note that I will probably not accept patches under terms that allow
|
||||
me to distribute them only under the GPL.</P>
|
||||
|
||||
<P></P>
|
||||
|
||||
<ADDRESS>
|
||||
|
||||
<A HREF="mailto:jjc@jclark.com">James Clark</A>
|
||||
|
||||
</ADDRESS>
|
||||
|
||||
</BODY>
|
||||
|
||||
</HTML>
|
||||
+4
-10
@@ -1,15 +1,9 @@
|
||||
xcopy xmltok\\Release\\xmltok.lib lib
|
||||
xcopy xmlparse\\Release\\xmlparse.lib lib
|
||||
rm -fr expat
|
||||
mkdir expat
|
||||
tar cf - `cat files.txt` | (cd expat; tar xf -)
|
||||
files=`grep -v expat.mak files.txt`
|
||||
(cd expat; flip -u $files)
|
||||
mkdir expat/bin
|
||||
mkdir expat/lib
|
||||
xcopy bin\\xmltok.dll expat\\bin
|
||||
xcopy bin\\xmlparse.dll expat\\bin
|
||||
xcopy xmltok\\Release\\xmltok.lib expat\\lib
|
||||
xcopy xmlparse\\Release\\xmlparse.lib expat\\lib
|
||||
xcopy bin\\xmlwf.exe expat\\bin
|
||||
tar cf - `cat files.txt win32files.txt` | (cd expat; tar xf -)
|
||||
(cd expat; flip -u `cat ../files.txt`)
|
||||
rm -f expat.zip
|
||||
zip -qr expat.zip expat
|
||||
rm -fr expat
|
||||
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
expat.dsw
|
||||
expat.mak
|
||||
gennmtab/gennmtab.dsp
|
||||
sample/build.bat
|
||||
xmlparse/xmlparse.dsp
|
||||
xmltok/xmltok.dsp
|
||||
xmlwf/xmlwf.dsp
|
||||
bin/xmltok.dll
|
||||
bin/xmlparse.dll
|
||||
bin/xmlwf.exe
|
||||
lib/xmltok.lib
|
||||
lib/xmlparse.lib
|
||||
+28
-11
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
csompliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,26 +12,43 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "xmldef.h"
|
||||
#include "hashtable.h"
|
||||
|
||||
#ifdef XML_UNICODE
|
||||
#define keycmp wcscmp
|
||||
#else
|
||||
#define keycmp strcmp
|
||||
#ifdef XML_UNICODE_WCHAR_T
|
||||
#ifndef XML_UNICODE
|
||||
#define XML_UNICODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "hashtable.h"
|
||||
|
||||
#define INIT_SIZE 64
|
||||
|
||||
static
|
||||
int keyeq(KEY s1, KEY s2)
|
||||
{
|
||||
for (; *s1 == *s2; s1++, s2++)
|
||||
if (*s1 == 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
unsigned long hash(KEY s)
|
||||
{
|
||||
@@ -59,7 +76,7 @@ NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize)
|
||||
for (i = h & (table->size - 1);
|
||||
table->v[i];
|
||||
i == 0 ? i = table->size - 1 : --i) {
|
||||
if (keycmp(name, table->v[i]->name) == 0)
|
||||
if (keyeq(name, table->v[i]->name))
|
||||
return table->v[i];
|
||||
}
|
||||
if (!createSize)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,20 +12,38 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef XML_UNICODE
|
||||
|
||||
#ifdef XML_UNICODE_WCHAR_T
|
||||
typedef const wchar_t *KEY;
|
||||
#else
|
||||
#else /* not XML_UNICODE_WCHAR_T */
|
||||
typedef const unsigned short *KEY;
|
||||
#endif /* not XML_UNICODE_WCHAR_T */
|
||||
|
||||
#else /* not XML_UNICODE */
|
||||
|
||||
typedef const char *KEY;
|
||||
#endif
|
||||
|
||||
#endif /* not XML_UNICODE */
|
||||
|
||||
typedef struct {
|
||||
KEY name;
|
||||
|
||||
+944
-261
File diff suppressed because it is too large
Load Diff
Executable
+202
@@ -0,0 +1,202 @@
|
||||
# Microsoft Developer Studio Project File - Name="xmlparse" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=xmlparse - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "xmlparse.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "xmlparse.mak" CFG="xmlparse - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "xmlparse - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "xmlparse - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "xmlparse - Win32 MinSize" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "xmlparse - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir "."
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "."
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\xmltok" /I "..\xmlwf" /D XMLTOKAPI=__declspec(dllimport) /D XMLPARSEAPI=__declspec(dllexport) /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:I386 /out:"..\bin\xmlparse.dll" /link50compat
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmlparse - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir "."
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\Debug"
|
||||
# PROP Intermediate_Dir ".\Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "."
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\xmltok" /I "..\xmlwf" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D XMLTOKAPI=__declspec(dllimport) /D XMLPARSEAPI=__declspec(dllexport) /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x20000000" /subsystem:windows /dll /debug /machine:I386 /out:"..\dbgbin\xmlparse.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmlparse - Win32 MinSize"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "MinSize"
|
||||
# PROP BASE Intermediate_Dir "MinSize"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "MinSize"
|
||||
# PROP Intermediate_Dir "MinSize"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\xmltok" /I "..\xmlwf" /D XMLTOKAPI=__declspec(dllimport) /D XMLPARSEAPI=__declspec(dllexport) /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O1 /I "..\xmltok" /I "..\xmlwf" /D "XML_MIN_SIZE" /D "XML_WINLIB" /D XMLPARSEAPI=__declspec(dllexport) /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x20000000" /subsystem:windows /dll /machine:I386 /out:"..\bin\xmlparse.dll"
|
||||
# SUBTRACT BASE LINK32 /profile
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x20000000" /entry:"DllMain" /subsystem:windows /dll /machine:I386 /out:"..\bin\xmlparse.dll"
|
||||
# SUBTRACT LINK32 /profile /nodefaultlib
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "xmlparse - Win32 Release"
|
||||
# Name "xmlparse - Win32 Debug"
|
||||
# Name "xmlparse - Win32 MinSize"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\xmltok\dllmain.c
|
||||
|
||||
!IF "$(CFG)" == "xmlparse - Win32 Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmlparse - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmlparse - Win32 MinSize"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hashtable.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmlparse.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\xmltok\xmlrole.c
|
||||
|
||||
!IF "$(CFG)" == "xmlparse - Win32 Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmlparse - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmlparse - Win32 MinSize"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\xmltok\xmltok.c
|
||||
|
||||
!IF "$(CFG)" == "xmlparse - Win32 Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmlparse - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmlparse - Win32 MinSize"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hashtable.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmlparse.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
+121
-21
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#ifndef XmlParse_INCLUDED
|
||||
@@ -70,6 +80,19 @@ protocol or null if there is none specified. */
|
||||
XML_Parser XMLPARSEAPI
|
||||
XML_ParserCreate(const XML_Char *encoding);
|
||||
|
||||
/* Constructs a new parser and namespace processor. Element type names
|
||||
and attribute names that belong to a namespace will be expanded;
|
||||
unprefixed attribute names are never expanded; unprefixed element type
|
||||
names are expanded only if there is a default namespace. The expanded
|
||||
name is the concatenation of the namespace URI, the namespace separator character,
|
||||
and the local part of the name. If the namespace separator is '\0' then
|
||||
the namespace URI and the local part will be concatenated without any
|
||||
separator. When a namespace is not declared, the name and prefix will be
|
||||
passed through without expansion. */
|
||||
|
||||
XML_Parser XMLPARSEAPI
|
||||
XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
|
||||
|
||||
|
||||
/* atts is array of name/value pairs, terminated by 0;
|
||||
names and values are 0 terminated. */
|
||||
@@ -91,6 +114,12 @@ typedef void (*XML_ProcessingInstructionHandler)(void *userData,
|
||||
const XML_Char *target,
|
||||
const XML_Char *data);
|
||||
|
||||
/* data is 0 terminated */
|
||||
typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data);
|
||||
|
||||
typedef void (*XML_StartCdataSectionHandler)(void *userData);
|
||||
typedef void (*XML_EndCdataSectionHandler)(void *userData);
|
||||
|
||||
/* This is called for any characters in the XML document for
|
||||
which there is no applicable handler. This includes both
|
||||
characters that are part of markup which is of a kind that is
|
||||
@@ -100,10 +129,9 @@ for which no handler has been supplied. The characters are passed
|
||||
exactly as they were in the XML document except that
|
||||
they will be encoded in UTF-8. Line boundaries are not normalized.
|
||||
Note that a byte order mark character is not passed to the default handler.
|
||||
If a default handler is set, internal entity references
|
||||
are not expanded. There are no guarantees about
|
||||
how characters are divided between calls to the default handler:
|
||||
for example, a comment might be split between multiple calls. */
|
||||
There are no guarantees about how characters are divided between calls
|
||||
to the default handler: for example, a comment might be split between
|
||||
multiple calls. */
|
||||
|
||||
typedef void (*XML_DefaultHandler)(void *userData,
|
||||
const XML_Char *s,
|
||||
@@ -131,6 +159,27 @@ typedef void (*XML_NotationDeclHandler)(void *userData,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId);
|
||||
|
||||
/* When namespace processing is enabled, these are called once for
|
||||
each namespace declaration. The call to the start and end element
|
||||
handlers occur between the calls to the start and end namespace
|
||||
declaration handlers. For an xmlns attribute, prefix will be null.
|
||||
For an xmlns="" attribute, uri will be null. */
|
||||
|
||||
typedef void (*XML_StartNamespaceDeclHandler)(void *userData,
|
||||
const XML_Char *prefix,
|
||||
const XML_Char *uri);
|
||||
|
||||
typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
|
||||
const XML_Char *prefix);
|
||||
|
||||
/* This is called if the document is not standalone (it has an
|
||||
external subset or a reference to a parameter entity, but does not
|
||||
have standalone="yes"). If this handler returns 0, then processing
|
||||
will not continue, and the parser will return a
|
||||
XML_ERROR_NOT_STANDALONE error. */
|
||||
|
||||
typedef int (*XML_NotStandaloneHandler)(void *userData);
|
||||
|
||||
/* This is called for a reference to an external parsed general entity.
|
||||
The referenced entity is not automatically parsed.
|
||||
The application can parse it immediately or later using
|
||||
@@ -145,10 +194,9 @@ it may be null.
|
||||
The publicId argument is the public identifier as specified in the entity declaration,
|
||||
or null if none was specified; the whitespace in the public identifier
|
||||
will have been normalized as required by the XML spec.
|
||||
The openEntityNames argument is a space-separated list of the names of the entities
|
||||
that are open for the parse of this entity (including the name of the referenced
|
||||
entity); this can be passed as the openEntityNames argument to
|
||||
XML_ExternalEntityParserCreate; openEntityNames is valid only until the handler
|
||||
The context argument specifies the parsing context in the format
|
||||
expected by the context argument to
|
||||
XML_ExternalEntityParserCreate; context is valid only until the handler
|
||||
returns, so if the referenced entity is to be parsed later, it must be copied.
|
||||
The handler should return 0 if processing should not continue because of
|
||||
a fatal error in the handling of the external entity.
|
||||
@@ -157,7 +205,7 @@ error.
|
||||
Note that unlike other handlers the first argument is the parser, not userData. */
|
||||
|
||||
typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser,
|
||||
const XML_Char *openEntityNames,
|
||||
const XML_Char *context,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId);
|
||||
@@ -237,11 +285,29 @@ XML_SetCharacterDataHandler(XML_Parser parser,
|
||||
void XMLPARSEAPI
|
||||
XML_SetProcessingInstructionHandler(XML_Parser parser,
|
||||
XML_ProcessingInstructionHandler handler);
|
||||
void XMLPARSEAPI
|
||||
XML_SetCommentHandler(XML_Parser parser,
|
||||
XML_CommentHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetCdataSectionHandler(XML_Parser parser,
|
||||
XML_StartCdataSectionHandler start,
|
||||
XML_EndCdataSectionHandler end);
|
||||
|
||||
/* This sets the default handler and also inhibits expansion of internal entities.
|
||||
The entity reference will be passed to the default handler. */
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetDefaultHandler(XML_Parser parser,
|
||||
XML_DefaultHandler handler);
|
||||
|
||||
/* This sets the default handler but does not inhibit expansion of internal entities.
|
||||
The entity reference will not be passed to the default handler. */
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetDefaultHandlerExpand(XML_Parser parser,
|
||||
XML_DefaultHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
|
||||
XML_UnparsedEntityDeclHandler handler);
|
||||
@@ -250,10 +316,25 @@ void XMLPARSEAPI
|
||||
XML_SetNotationDeclHandler(XML_Parser parser,
|
||||
XML_NotationDeclHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetNamespaceDeclHandler(XML_Parser parser,
|
||||
XML_StartNamespaceDeclHandler start,
|
||||
XML_EndNamespaceDeclHandler end);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetNotStandaloneHandler(XML_Parser parser,
|
||||
XML_NotStandaloneHandler handler);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetExternalEntityRefHandler(XML_Parser parser,
|
||||
XML_ExternalEntityRefHandler handler);
|
||||
|
||||
/* If a non-null value for arg is specified here, then it will be passed
|
||||
as the first argument to the external entity ref handler instead
|
||||
of the parser object. */
|
||||
void XMLPARSEAPI
|
||||
XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg);
|
||||
|
||||
void XMLPARSEAPI
|
||||
XML_SetUnknownEncodingHandler(XML_Parser parser,
|
||||
XML_UnknownEncodingHandler handler,
|
||||
@@ -261,10 +342,7 @@ XML_SetUnknownEncodingHandler(XML_Parser parser,
|
||||
|
||||
/* This can be called within a handler for a start element, end element,
|
||||
processing instruction or character data. It causes the corresponding
|
||||
markup to be passed to the default handler.
|
||||
Within the expansion of an internal entity, nothing will be passed
|
||||
to the default handler, although this usually will not happen since
|
||||
setting a default handler inhibits expansion of internal entities. */
|
||||
markup to be passed to the default handler. */
|
||||
void XMLPARSEAPI XML_DefaultCurrent(XML_Parser parser);
|
||||
|
||||
/* This value is passed as the userData argument to callbacks. */
|
||||
@@ -274,6 +352,13 @@ XML_SetUserData(XML_Parser parser, void *userData);
|
||||
/* Returns the last value set by XML_SetUserData or null. */
|
||||
#define XML_GetUserData(parser) (*(void **)(parser))
|
||||
|
||||
/* This is equivalent to supplying an encoding argument
|
||||
to XML_CreateParser. It must not be called after XML_Parse
|
||||
or XML_ParseBuffer. */
|
||||
|
||||
int XMLPARSEAPI
|
||||
XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
|
||||
|
||||
/* If this function is called, then the parser will be passed
|
||||
as the first argument to callbacks instead of userData.
|
||||
The userData will still be accessible using XML_GetUserData. */
|
||||
@@ -294,6 +379,12 @@ XML_SetBase(XML_Parser parser, const XML_Char *base);
|
||||
const XML_Char XMLPARSEAPI *
|
||||
XML_GetBase(XML_Parser parser);
|
||||
|
||||
/* Returns the number of the attributes passed in last call to the
|
||||
XML_StartElementHandler that were specified in the start-tag rather
|
||||
than defaulted. */
|
||||
|
||||
int XMLPARSEAPI XML_GetSpecifiedAttributeCount(XML_Parser parser);
|
||||
|
||||
/* Parses some input. Returns 0 if a fatal error is detected.
|
||||
The last call to XML_Parse must have isFinal true;
|
||||
len may be zero for this call (or any other). */
|
||||
@@ -307,10 +398,13 @@ int XMLPARSEAPI
|
||||
XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
|
||||
|
||||
/* Creates an XML_Parser object that can parse an external general entity;
|
||||
openEntityNames is a space-separated list of the names of the entities that are open
|
||||
for the parse of this entity (including the name of this one);
|
||||
encoding is the externally specified encoding,
|
||||
context is a '\0'-terminated string specifying the parse context;
|
||||
encoding is a '\0'-terminated string giving the name of the externally specified encoding,
|
||||
or null if there is no externally specified encoding.
|
||||
The context string consists of a sequence of tokens separated by formfeeds (\f);
|
||||
a token consisting of a name specifies that the general entity of the name
|
||||
is open; a token of the form prefix=uri specifies the namespace for a particular
|
||||
prefix; a token of the form =uri specifies the default namespace.
|
||||
This can be called at any point after the first call to an ExternalEntityRefHandler
|
||||
so longer as the parser has not yet been freed.
|
||||
The new parser is completely independent and may safely be used in a separate thread.
|
||||
@@ -318,7 +412,7 @@ The handlers and userData are initialized from the parser argument.
|
||||
Returns 0 if out of memory. Otherwise returns a new XML_Parser object. */
|
||||
XML_Parser XMLPARSEAPI
|
||||
XML_ExternalEntityParserCreate(XML_Parser parser,
|
||||
const XML_Char *openEntityNames,
|
||||
const XML_Char *context,
|
||||
const XML_Char *encoding);
|
||||
|
||||
enum XML_Error {
|
||||
@@ -343,7 +437,8 @@ enum XML_Error {
|
||||
XML_ERROR_UNKNOWN_ENCODING,
|
||||
XML_ERROR_INCORRECT_ENCODING,
|
||||
XML_ERROR_UNCLOSED_CDATA_SECTION,
|
||||
XML_ERROR_EXTERNAL_ENTITY_HANDLING
|
||||
XML_ERROR_EXTERNAL_ENTITY_HANDLING,
|
||||
XML_ERROR_NOT_STANDALONE
|
||||
};
|
||||
|
||||
/* If XML_Parse or XML_ParseBuffer have returned 0, then XML_GetErrorCode
|
||||
@@ -363,10 +458,15 @@ int XMLPARSEAPI XML_GetCurrentLineNumber(XML_Parser parser);
|
||||
int XMLPARSEAPI XML_GetCurrentColumnNumber(XML_Parser parser);
|
||||
long XMLPARSEAPI XML_GetCurrentByteIndex(XML_Parser parser);
|
||||
|
||||
/* Return the number of bytes in the current event.
|
||||
Returns 0 if the event is in an internal entity. */
|
||||
|
||||
int XMLPARSEAPI XML_GetCurrentByteCount(XML_Parser parser);
|
||||
|
||||
/* For backwards compatibility with previous versions. */
|
||||
#define XML_GetErrorLineNumber XML_GetCurrentLineNumber
|
||||
#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
|
||||
#define XML_GetErrorByteIndexNumber XML_GetCurrentByteIndexNumber
|
||||
#define XML_GetErrorByteIndex XML_GetCurrentByteIndex
|
||||
|
||||
/* Frees memory used by the parser. */
|
||||
void XMLPARSEAPI
|
||||
|
||||
+13
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
@@ -32,7 +42,7 @@ Contributor(s):
|
||||
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
|
||||
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_NMSTRT, BT_SEMI,
|
||||
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
|
||||
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
|
||||
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
|
||||
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
|
||||
|
||||
+15
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,12 +12,25 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#define STRICT 1
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
|
||||
@@ -33,7 +43,7 @@ Contributor(s):
|
||||
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
|
||||
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_NMSTRT, BT_SEMI,
|
||||
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
|
||||
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
|
||||
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
|
||||
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
|
||||
+12
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
+34
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,19 +12,50 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef XML_WINLIB
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
|
||||
#define malloc(x) HeapAlloc(GetProcessHeap(), 0, (x))
|
||||
#define calloc(x, y) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (x)*(y))
|
||||
#define free(x) HeapFree(GetProcessHeap(), 0, (x))
|
||||
#define realloc(x, y) HeapReAlloc(GetProcessHeap(), 0, x, y)
|
||||
#define abort() /* as nothing */
|
||||
|
||||
#else /* not XML_WINLIB */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#endif /* not XML_WINLIB */
|
||||
|
||||
/* This file can be used for any definitions needed in
|
||||
particular environments. */
|
||||
|
||||
#ifdef MOZILLA
|
||||
|
||||
#include "nspr.h"
|
||||
#define malloc(x) PR_Calloc(1,(x))
|
||||
#define malloc(x) PR_Malloc(x)
|
||||
#define realloc(x, y) PR_Realloc((x), (y))
|
||||
#define calloc(x, y) PR_Calloc((x),(y))
|
||||
#define free(x) PR_Free(x)
|
||||
#define int int32
|
||||
|
||||
+20
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#include "xmldef.h"
|
||||
@@ -149,6 +159,7 @@ int doctype0(PROLOG_STATE *state,
|
||||
case XML_TOK_PROLOG_S:
|
||||
return XML_ROLE_NONE;
|
||||
case XML_TOK_NAME:
|
||||
case XML_TOK_PREFIXED_NAME:
|
||||
state->handler = doctype1;
|
||||
return XML_ROLE_DOCTYPE_NAME;
|
||||
}
|
||||
@@ -610,6 +621,7 @@ int attlist0(PROLOG_STATE *state,
|
||||
case XML_TOK_PROLOG_S:
|
||||
return XML_ROLE_NONE;
|
||||
case XML_TOK_NAME:
|
||||
case XML_TOK_PREFIXED_NAME:
|
||||
state->handler = attlist1;
|
||||
return XML_ROLE_ATTLIST_ELEMENT_NAME;
|
||||
}
|
||||
@@ -630,6 +642,7 @@ int attlist1(PROLOG_STATE *state,
|
||||
state->handler = internalSubset;
|
||||
return XML_ROLE_NONE;
|
||||
case XML_TOK_NAME:
|
||||
case XML_TOK_PREFIXED_NAME:
|
||||
state->handler = attlist2;
|
||||
return XML_ROLE_ATTRIBUTE_NAME;
|
||||
}
|
||||
@@ -689,6 +702,7 @@ int attlist3(PROLOG_STATE *state,
|
||||
return XML_ROLE_NONE;
|
||||
case XML_TOK_NMTOKEN:
|
||||
case XML_TOK_NAME:
|
||||
case XML_TOK_PREFIXED_NAME:
|
||||
state->handler = attlist4;
|
||||
return XML_ROLE_ATTRIBUTE_ENUM_VALUE;
|
||||
}
|
||||
@@ -836,6 +850,7 @@ int element0(PROLOG_STATE *state,
|
||||
case XML_TOK_PROLOG_S:
|
||||
return XML_ROLE_NONE;
|
||||
case XML_TOK_NAME:
|
||||
case XML_TOK_PREFIXED_NAME:
|
||||
state->handler = element1;
|
||||
return XML_ROLE_ELEMENT_NAME;
|
||||
}
|
||||
@@ -893,6 +908,7 @@ int element2(PROLOG_STATE *state,
|
||||
state->handler = element6;
|
||||
return XML_ROLE_GROUP_OPEN;
|
||||
case XML_TOK_NAME:
|
||||
case XML_TOK_PREFIXED_NAME:
|
||||
state->handler = element7;
|
||||
return XML_ROLE_CONTENT_ELEMENT;
|
||||
case XML_TOK_NAME_QUESTION:
|
||||
@@ -940,6 +956,7 @@ int element4(PROLOG_STATE *state,
|
||||
case XML_TOK_PROLOG_S:
|
||||
return XML_ROLE_NONE;
|
||||
case XML_TOK_NAME:
|
||||
case XML_TOK_PREFIXED_NAME:
|
||||
state->handler = element5;
|
||||
return XML_ROLE_CONTENT_ELEMENT;
|
||||
}
|
||||
@@ -980,6 +997,7 @@ int element6(PROLOG_STATE *state,
|
||||
state->level += 1;
|
||||
return XML_ROLE_GROUP_OPEN;
|
||||
case XML_TOK_NAME:
|
||||
case XML_TOK_PREFIXED_NAME:
|
||||
state->handler = element7;
|
||||
return XML_ROLE_CONTENT_ELEMENT;
|
||||
case XML_TOK_NAME_QUESTION:
|
||||
|
||||
+12
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#ifndef XmlRole_INCLUDED
|
||||
|
||||
+634
-242
File diff suppressed because it is too large
Load Diff
Executable
+163
@@ -0,0 +1,163 @@
|
||||
# Microsoft Developer Studio Project File - Name="xmltok" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=xmltok - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "xmltok.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "xmltok.mak" CFG="xmltok - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "xmltok - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "xmltok - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "xmltok - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir "."
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "."
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D XMLTOKAPI=__declspec(dllexport) /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"DllMain" /subsystem:windows /dll /machine:I386 /out:"..\bin\xmltok.dll" /link50compat
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmltok - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir "."
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\Debug"
|
||||
# PROP Intermediate_Dir ".\Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "."
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D XMLTOKAPI=__declspec(dllexport) /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"..\dbgbin\xmltok.dll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "xmltok - Win32 Release"
|
||||
# Name "xmltok - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dllmain.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmlrole.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmltok.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\asciitab.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\iasciitab.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\latin1tab.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\nametab.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\utf8tab.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmldef.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmlrole.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmltok.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmltok_impl.c
|
||||
# PROP BASE Exclude_From_Build 1
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmltok_impl.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmltok_ns.c
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
+34
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#ifndef XmlTok_INCLUDED
|
||||
@@ -94,6 +104,10 @@ extern "C" {
|
||||
/* The following token is returned only by XmlCdataSectionTok */
|
||||
#define XML_TOK_CDATA_SECT_CLOSE 40
|
||||
|
||||
/* With namespace processing this is returned by XmlPrologTok
|
||||
for a name with a colon. */
|
||||
#define XML_TOK_PREFIXED_NAME 41
|
||||
|
||||
#define XML_N_STATES 3
|
||||
#define XML_PROLOG_STATE 0
|
||||
#define XML_CONTENT_STATE 1
|
||||
@@ -266,9 +280,26 @@ int XMLTOKAPI XmlSizeOfUnknownEncoding();
|
||||
ENCODING XMLTOKAPI *
|
||||
XmlInitUnknownEncoding(void *mem,
|
||||
int *table,
|
||||
int (*convert)(void *userData, const char *p),
|
||||
int (*conv)(void *userData, const char *p),
|
||||
void *userData);
|
||||
|
||||
int XMLTOKAPI XmlParseXmlDeclNS(int isGeneralTextEntity,
|
||||
const ENCODING *enc,
|
||||
const char *ptr,
|
||||
const char *end,
|
||||
const char **badPtr,
|
||||
const char **versionPtr,
|
||||
const char **encodingNamePtr,
|
||||
const ENCODING **namedEncodingPtr,
|
||||
int *standalonePtr);
|
||||
int XMLTOKAPI XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
|
||||
const ENCODING XMLTOKAPI *XmlGetUtf8InternalEncodingNS();
|
||||
const ENCODING XMLTOKAPI *XmlGetUtf16InternalEncodingNS();
|
||||
ENCODING XMLTOKAPI *
|
||||
XmlInitUnknownEncodingNS(void *mem,
|
||||
int *table,
|
||||
int (*conv)(void *userData, const char *p),
|
||||
void *userData);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+302
-199
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
enum {
|
||||
@@ -42,6 +52,7 @@ enum {
|
||||
BT_LSQB,
|
||||
BT_S,
|
||||
BT_NMSTRT,
|
||||
BT_COLON,
|
||||
BT_HEX,
|
||||
BT_DIGIT,
|
||||
BT_NAME,
|
||||
|
||||
Executable
+96
@@ -0,0 +1,96 @@
|
||||
const ENCODING *NS(XmlGetUtf8InternalEncoding)()
|
||||
{
|
||||
return &ns(internal_utf8_encoding).enc;
|
||||
}
|
||||
|
||||
const ENCODING *NS(XmlGetUtf16InternalEncoding)()
|
||||
{
|
||||
#if XML_BYTE_ORDER == 12
|
||||
return &ns(internal_little2_encoding).enc;
|
||||
#elif XML_BYTE_ORDER == 21
|
||||
return &ns(internal_big2_encoding).enc;
|
||||
#else
|
||||
const short n = 1;
|
||||
return *(const char *)&n ? &ns(internal_little2_encoding).enc : &ns(internal_big2_encoding).enc;
|
||||
#endif
|
||||
}
|
||||
|
||||
static
|
||||
const ENCODING *NS(encodings)[] = {
|
||||
&ns(latin1_encoding).enc,
|
||||
&ns(ascii_encoding).enc,
|
||||
&ns(utf8_encoding).enc,
|
||||
&ns(big2_encoding).enc,
|
||||
&ns(big2_encoding).enc,
|
||||
&ns(little2_encoding).enc,
|
||||
&ns(utf8_encoding).enc /* NO_ENC */
|
||||
};
|
||||
|
||||
static
|
||||
int NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
const char **nextTokPtr)
|
||||
{
|
||||
return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE, ptr, end, nextTokPtr);
|
||||
}
|
||||
|
||||
static
|
||||
int NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
const char **nextTokPtr)
|
||||
{
|
||||
return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE, ptr, end, nextTokPtr);
|
||||
}
|
||||
|
||||
int NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, const char *name)
|
||||
{
|
||||
int i = getEncodingIndex(name);
|
||||
if (i == UNKNOWN_ENC)
|
||||
return 0;
|
||||
INIT_ENC_INDEX(p) = (char)i;
|
||||
p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
|
||||
p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
|
||||
p->initEnc.updatePosition = initUpdatePosition;
|
||||
p->encPtr = encPtr;
|
||||
*encPtr = &(p->initEnc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static
|
||||
const ENCODING *NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
|
||||
{
|
||||
#define ENCODING_MAX 128
|
||||
char buf[ENCODING_MAX];
|
||||
char *p = buf;
|
||||
int i;
|
||||
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
|
||||
if (ptr != end)
|
||||
return 0;
|
||||
*p = 0;
|
||||
if (streqci(buf, "UTF-16") && enc->minBytesPerChar == 2)
|
||||
return enc;
|
||||
i = getEncodingIndex(buf);
|
||||
if (i == UNKNOWN_ENC)
|
||||
return 0;
|
||||
return NS(encodings)[i];
|
||||
}
|
||||
|
||||
int NS(XmlParseXmlDecl)(int isGeneralTextEntity,
|
||||
const ENCODING *enc,
|
||||
const char *ptr,
|
||||
const char *end,
|
||||
const char **badPtr,
|
||||
const char **versionPtr,
|
||||
const char **encodingName,
|
||||
const ENCODING **encoding,
|
||||
int *standalone)
|
||||
{
|
||||
return doParseXmlDecl(NS(findEncoding),
|
||||
isGeneralTextEntity,
|
||||
enc,
|
||||
ptr,
|
||||
end,
|
||||
badPtr,
|
||||
versionPtr,
|
||||
encodingName,
|
||||
encoding,
|
||||
standalone);
|
||||
}
|
||||
+15
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,15 +12,28 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#include "codepage.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#define STRICT 1
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
int codepageMap(int cp, int *map)
|
||||
|
||||
+12
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
int codepageMap(int cp, int *map);
|
||||
|
||||
+12
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,10 +12,20 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,13 +12,31 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#define STRICT 1
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
|
||||
#ifdef XML_UNICODE_WCHAR_T
|
||||
#ifndef XML_UNICODE
|
||||
#define XML_UNICODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef XML_UNICODE
|
||||
#define UNICODE
|
||||
#define _UNICODE
|
||||
|
||||
Executable
+238
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS"
|
||||
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing rights and limitations
|
||||
under the License.
|
||||
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include "xmlparse.h"
|
||||
#include "xmlfile.h"
|
||||
#include "xmltchar.h"
|
||||
#include "filemap.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef _POSIX_SOURCE
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef O_BINARY
|
||||
#ifdef _O_BINARY
|
||||
#define O_BINARY _O_BINARY
|
||||
#else
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define READ_SIZE 16
|
||||
#else
|
||||
#define READ_SIZE (1024*8)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
XML_Parser parser;
|
||||
int *retPtr;
|
||||
} PROCESS_ARGS;
|
||||
|
||||
static
|
||||
void reportError(XML_Parser parser, const XML_Char *filename)
|
||||
{
|
||||
int code = XML_GetErrorCode(parser);
|
||||
const XML_Char *message = XML_ErrorString(code);
|
||||
if (message)
|
||||
ftprintf(stdout, T("%s:%d:%ld: %s\n"),
|
||||
filename,
|
||||
XML_GetErrorLineNumber(parser),
|
||||
XML_GetErrorColumnNumber(parser),
|
||||
message);
|
||||
else
|
||||
ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code);
|
||||
}
|
||||
|
||||
static
|
||||
void processFile(const void *data,
|
||||
size_t size,
|
||||
const XML_Char *filename,
|
||||
void *args)
|
||||
{
|
||||
XML_Parser parser = ((PROCESS_ARGS *)args)->parser;
|
||||
int *retPtr = ((PROCESS_ARGS *)args)->retPtr;
|
||||
if (!XML_Parse(parser, data, size, 1)) {
|
||||
reportError(parser, filename);
|
||||
*retPtr = 0;
|
||||
}
|
||||
else
|
||||
*retPtr = 1;
|
||||
}
|
||||
|
||||
static
|
||||
int isAsciiLetter(XML_Char c)
|
||||
{
|
||||
return (T('a') <= c && c <= T('z')) || (T('A') <= c && c <= T('Z'));
|
||||
}
|
||||
|
||||
static
|
||||
const XML_Char *resolveSystemId(const XML_Char *base, const XML_Char *systemId, XML_Char **toFree)
|
||||
{
|
||||
XML_Char *s;
|
||||
*toFree = 0;
|
||||
if (!base
|
||||
|| *systemId == T('/')
|
||||
#ifdef WIN32
|
||||
|| *systemId == T('\\')
|
||||
|| (isAsciiLetter(systemId[0]) && systemId[1] == T(':'))
|
||||
#endif
|
||||
)
|
||||
return systemId;
|
||||
*toFree = (XML_Char *)malloc((tcslen(base) + tcslen(systemId) + 2)*sizeof(XML_Char));
|
||||
if (!*toFree)
|
||||
return systemId;
|
||||
tcscpy(*toFree, base);
|
||||
s = *toFree;
|
||||
if (tcsrchr(s, T('/')))
|
||||
s = tcsrchr(s, T('/')) + 1;
|
||||
#ifdef WIN32
|
||||
if (tcsrchr(s, T('\\')))
|
||||
s = tcsrchr(s, T('\\')) + 1;
|
||||
#endif
|
||||
tcscpy(s, systemId);
|
||||
return *toFree;
|
||||
}
|
||||
|
||||
static
|
||||
int externalEntityRefFilemap(XML_Parser parser,
|
||||
const XML_Char *context,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId)
|
||||
{
|
||||
int result;
|
||||
XML_Char *s;
|
||||
const XML_Char *filename;
|
||||
XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0);
|
||||
PROCESS_ARGS args;
|
||||
args.retPtr = &result;
|
||||
args.parser = entParser;
|
||||
filename = resolveSystemId(base, systemId, &s);
|
||||
XML_SetBase(entParser, filename);
|
||||
if (!filemap(filename, processFile, &args))
|
||||
result = 0;
|
||||
free(s);
|
||||
XML_ParserFree(entParser);
|
||||
return result;
|
||||
}
|
||||
|
||||
static
|
||||
int processStream(const XML_Char *filename, XML_Parser parser)
|
||||
{
|
||||
int fd = topen(filename, O_BINARY|O_RDONLY);
|
||||
if (fd < 0) {
|
||||
tperror(filename);
|
||||
return 0;
|
||||
}
|
||||
for (;;) {
|
||||
int nread;
|
||||
char *buf = XML_GetBuffer(parser, READ_SIZE);
|
||||
if (!buf) {
|
||||
close(fd);
|
||||
ftprintf(stderr, T("%s: out of memory\n"), filename);
|
||||
return 0;
|
||||
}
|
||||
nread = read(fd, buf, READ_SIZE);
|
||||
if (nread < 0) {
|
||||
tperror(filename);
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
if (!XML_ParseBuffer(parser, nread, nread == 0)) {
|
||||
reportError(parser, filename);
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
if (nread == 0) {
|
||||
close(fd);
|
||||
break;;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static
|
||||
int externalEntityRefStream(XML_Parser parser,
|
||||
const XML_Char *context,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId)
|
||||
{
|
||||
XML_Char *s;
|
||||
const XML_Char *filename;
|
||||
int ret;
|
||||
XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0);
|
||||
filename = resolveSystemId(base, systemId, &s);
|
||||
XML_SetBase(entParser, filename);
|
||||
ret = processStream(filename, entParser);
|
||||
free(s);
|
||||
XML_ParserFree(entParser);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int XML_ProcessFile(XML_Parser parser,
|
||||
const XML_Char *filename,
|
||||
unsigned flags)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (!XML_SetBase(parser, filename)) {
|
||||
ftprintf(stderr, T("%s: out of memory"), filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (flags & XML_EXTERNAL_ENTITIES)
|
||||
XML_SetExternalEntityRefHandler(parser,
|
||||
(flags & XML_MAP_FILE)
|
||||
? externalEntityRefFilemap
|
||||
: externalEntityRefStream);
|
||||
if (flags & XML_MAP_FILE) {
|
||||
PROCESS_ARGS args;
|
||||
args.retPtr = &result;
|
||||
args.parser = parser;
|
||||
if (!filemap(filename, processFile, &args))
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
result = processStream(filename, parser);
|
||||
return result;
|
||||
}
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS"
|
||||
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing rights and limitations
|
||||
under the License.
|
||||
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#define XML_MAP_FILE 01
|
||||
#define XML_EXTERNAL_ENTITIES 02
|
||||
|
||||
extern int XML_ProcessFile(XML_Parser parser,
|
||||
const XML_Char *filename,
|
||||
unsigned flags);
|
||||
Executable
+161
@@ -0,0 +1,161 @@
|
||||
#include <string.h>
|
||||
#include "xmlmime.h"
|
||||
|
||||
static
|
||||
const char *getTok(const char **pp)
|
||||
{
|
||||
/* inComment means one level of nesting; inComment+1 means two levels etc */
|
||||
enum { inAtom, inString, init, inComment };
|
||||
int state = init;
|
||||
const char *tokStart = 0;
|
||||
for (;;) {
|
||||
switch (**pp) {
|
||||
case '\0':
|
||||
if (state == inAtom)
|
||||
return tokStart;
|
||||
return 0;
|
||||
case ' ':
|
||||
case '\r':
|
||||
case '\t':
|
||||
case '\n':
|
||||
if (state == inAtom)
|
||||
return tokStart;
|
||||
break;
|
||||
case '(':
|
||||
if (state == inAtom)
|
||||
return tokStart;
|
||||
if (state != inString)
|
||||
state++;
|
||||
break;
|
||||
case ')':
|
||||
if (state > init)
|
||||
--state;
|
||||
else if (state != inString)
|
||||
return 0;
|
||||
break;
|
||||
case ';':
|
||||
case '/':
|
||||
case '=':
|
||||
if (state == inAtom)
|
||||
return tokStart;
|
||||
if (state == init)
|
||||
return (*pp)++;
|
||||
break;
|
||||
case '\\':
|
||||
++*pp;
|
||||
if (**pp == '\0')
|
||||
return 0;
|
||||
break;
|
||||
case '"':
|
||||
switch (state) {
|
||||
case inString:
|
||||
++*pp;
|
||||
return tokStart;
|
||||
case inAtom:
|
||||
return tokStart;
|
||||
case init:
|
||||
tokStart = *pp;
|
||||
state = inString;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (state == init) {
|
||||
tokStart = *pp;
|
||||
state = inAtom;
|
||||
}
|
||||
break;
|
||||
}
|
||||
++*pp;
|
||||
}
|
||||
/* not reached */
|
||||
}
|
||||
|
||||
/* key must be lowercase ASCII */
|
||||
|
||||
static
|
||||
int matchkey(const char *start, const char *end, const char *key)
|
||||
{
|
||||
if (!start)
|
||||
return 0;
|
||||
for (; start != end; start++, key++)
|
||||
if (*start != *key && *start != 'A' + (*key - 'a'))
|
||||
return 0;
|
||||
return *key == '\0';
|
||||
}
|
||||
|
||||
void getXMLCharset(const char *buf, char *charset)
|
||||
{
|
||||
const char *next, *p;
|
||||
|
||||
charset[0] = '\0';
|
||||
next = buf;
|
||||
p = getTok(&next);
|
||||
if (matchkey(p, next, "text"))
|
||||
strcpy(charset, "us-ascii");
|
||||
else if (!matchkey(p, next, "application"))
|
||||
return;
|
||||
p = getTok(&next);
|
||||
if (!p || *p != '/')
|
||||
return;
|
||||
p = getTok(&next);
|
||||
#if 0
|
||||
if (!matchkey(p, next, "xml") && charset[0] == '\0')
|
||||
return;
|
||||
#endif
|
||||
p = getTok(&next);
|
||||
while (p) {
|
||||
if (*p == ';') {
|
||||
p = getTok(&next);
|
||||
if (matchkey(p, next, "charset")) {
|
||||
p = getTok(&next);
|
||||
if (p && *p == '=') {
|
||||
p = getTok(&next);
|
||||
if (p) {
|
||||
char *s = charset;
|
||||
if (*p == '"') {
|
||||
while (++p != next - 1) {
|
||||
if (*p == '\\')
|
||||
++p;
|
||||
if (s == charset + CHARSET_MAX - 1) {
|
||||
charset[0] = '\0';
|
||||
break;
|
||||
}
|
||||
*s++ = *p;
|
||||
}
|
||||
*s++ = '\0';
|
||||
}
|
||||
else {
|
||||
if (next - p > CHARSET_MAX - 1)
|
||||
break;
|
||||
while (p != next)
|
||||
*s++ = *p++;
|
||||
*s = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
p = getTok(&next);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char buf[CHARSET_MAX];
|
||||
if (argc <= 1)
|
||||
return 1;
|
||||
printf("%s\n", argv[1]);
|
||||
getXMLCharset(argv[1], buf);
|
||||
printf("charset=\"%s\"\n", buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* TEST */
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Registered charset names are at most 40 characters long. */
|
||||
|
||||
#define CHARSET_MAX 41
|
||||
|
||||
/* Figure out the charset to use from the ContentType.
|
||||
buf contains the body of the header field (the part after "Content-Type:").
|
||||
charset gets the charset to use. It must be at least CHARSET_MAX chars long.
|
||||
charset will be empty if the default charset should be used. */
|
||||
|
||||
void getXMLCharset(const char *buf, char *charset);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#ifdef XML_UNICODE
|
||||
#ifndef XML_UNICODE_WCHAR_T
|
||||
#error xmlwf requires a 16-bit Unicode-compatible wchar_t
|
||||
#endif
|
||||
#define T(x) L ## x
|
||||
#define ftprintf fwprintf
|
||||
#define tfopen _wfopen
|
||||
#define fputts fputws
|
||||
#define puttc putwc
|
||||
#define tcscmp wcscmp
|
||||
#define tcscpy wcscpy
|
||||
#define tcscat wcscat
|
||||
#define tcschr wcschr
|
||||
#define tcsrchr wcsrchr
|
||||
#define tcslen wcslen
|
||||
#define tperror _wperror
|
||||
#define topen _wopen
|
||||
#define tmain wmain
|
||||
#define tremove _wremove
|
||||
#else /* not XML_UNICODE */
|
||||
#define T(x) x
|
||||
#define ftprintf fprintf
|
||||
#define tfopen fopen
|
||||
#define fputts fputs
|
||||
#define puttc putc
|
||||
#define tcscmp strcmp
|
||||
#define tcscpy strcpy
|
||||
#define tcscat strcat
|
||||
#define tcschr strchr
|
||||
#define tcsrchr strrchr
|
||||
#define tcslen strlen
|
||||
#define tperror perror
|
||||
#define topen open
|
||||
#define tmain main
|
||||
#define tremove remove
|
||||
#endif /* not XML_UNICODE */
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int XML_URLInit();
|
||||
void XML_URLUninit();
|
||||
int XML_ProcessURL(XML_Parser parser,
|
||||
const XML_Char *url,
|
||||
unsigned flags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+256
-252
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
@@ -12,84 +12,37 @@ under the License.
|
||||
The Original Code is expat.
|
||||
|
||||
The Initial Developer of the Original Code is James Clark.
|
||||
Portions created by James Clark are Copyright (C) 1998
|
||||
Portions created by James Clark are Copyright (C) 1998, 1999
|
||||
James Clark. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
*/
|
||||
|
||||
#include "xmlparse.h"
|
||||
#include "filemap.h"
|
||||
#include "codepage.h"
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License (the "GPL"), in which case the
|
||||
provisions of the GPL are applicable instead of those above. If you
|
||||
wish to allow use of your version of this file only under the terms of
|
||||
the GPL and not to allow others to use your version of this file under
|
||||
the MPL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the
|
||||
GPL. If you do not delete the provisions above, a recipient may use
|
||||
your version of this file under either the MPL or the GPL.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef _POSIX_SOURCE
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef O_BINARY
|
||||
#ifdef _O_BINARY
|
||||
#define O_BINARY _O_BINARY
|
||||
#else
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
#endif
|
||||
#include "xmlparse.h"
|
||||
#include "codepage.h"
|
||||
#include "xmlfile.h"
|
||||
#include "xmltchar.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define READ_SIZE 16
|
||||
#else
|
||||
#define READ_SIZE (1024*8)
|
||||
#endif
|
||||
|
||||
#ifdef XML_UNICODE
|
||||
#ifndef XML_UNICODE_WCHAR_T
|
||||
#error xmlwf requires a 16-bit Unicode-compatible wchar_t
|
||||
#endif
|
||||
#define T(x) L ## x
|
||||
#define ftprintf fwprintf
|
||||
#define tfopen _wfopen
|
||||
#define fputts fputws
|
||||
#define puttc putwc
|
||||
#define tcscmp wcscmp
|
||||
#define tcscpy wcscpy
|
||||
#define tcscat wcscat
|
||||
#define tcschr wcschr
|
||||
#define tcsrchr wcsrchr
|
||||
#define tcslen wcslen
|
||||
#define tperror _wperror
|
||||
#define topen _wopen
|
||||
#define tmain wmain
|
||||
#define tremove _wremove
|
||||
#else /* not XML_UNICODE */
|
||||
#define T(x) x
|
||||
#define ftprintf fprintf
|
||||
#define tfopen fopen
|
||||
#define fputts fputs
|
||||
#define puttc putc
|
||||
#define tcscmp strcmp
|
||||
#define tcscpy strcpy
|
||||
#define tcscat strcat
|
||||
#define tcschr strchr
|
||||
#define tcsrchr strrchr
|
||||
#define tcslen strlen
|
||||
#define tperror perror
|
||||
#define topen open
|
||||
#define tmain main
|
||||
#define tremove remove
|
||||
#endif /* not XML_UNICODE */
|
||||
#define NSSEP T('#')
|
||||
|
||||
static void characterData(void *userData, const XML_Char *s, int len)
|
||||
{
|
||||
@@ -163,6 +116,73 @@ static void endElement(void *userData, const XML_Char *name)
|
||||
puttc(T('>'), fp);
|
||||
}
|
||||
|
||||
static void startElementNS(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
int nAtts;
|
||||
int nsi;
|
||||
const XML_Char **p;
|
||||
FILE *fp = userData;
|
||||
const XML_Char *sep;
|
||||
puttc(T('<'), fp);
|
||||
|
||||
sep = tcsrchr(name, NSSEP);
|
||||
if (sep) {
|
||||
fputts(T("ns0:"), fp);
|
||||
fputts(sep + 1, fp);
|
||||
fputts(T(" xmlns:ns0=\""), fp);
|
||||
characterData(userData, name, sep - name);
|
||||
puttc(T('"'), fp);
|
||||
nsi = 1;
|
||||
}
|
||||
else {
|
||||
fputts(name, fp);
|
||||
nsi = 0;
|
||||
}
|
||||
|
||||
p = atts;
|
||||
while (*p)
|
||||
++p;
|
||||
nAtts = (p - atts) >> 1;
|
||||
if (nAtts > 1)
|
||||
qsort((void *)atts, nAtts, sizeof(XML_Char *) * 2, attcmp);
|
||||
while (*atts) {
|
||||
name = *atts++;
|
||||
sep = tcsrchr(name, NSSEP);
|
||||
if (sep) {
|
||||
ftprintf(fp, T(" xmlns:ns%d=\""), nsi);
|
||||
characterData(userData, name, sep - name);
|
||||
puttc(T('"'), fp);
|
||||
name = sep + 1;
|
||||
ftprintf(fp, T(" ns%d:"), nsi++);
|
||||
}
|
||||
else
|
||||
puttc(T(' '), fp);
|
||||
fputts(name, fp);
|
||||
puttc(T('='), fp);
|
||||
puttc(T('"'), fp);
|
||||
characterData(userData, *atts, tcslen(*atts));
|
||||
puttc(T('"'), fp);
|
||||
atts++;
|
||||
}
|
||||
puttc(T('>'), fp);
|
||||
}
|
||||
|
||||
static void endElementNS(void *userData, const XML_Char *name)
|
||||
{
|
||||
FILE *fp = userData;
|
||||
const XML_Char *sep;
|
||||
puttc(T('<'), fp);
|
||||
puttc(T('/'), fp);
|
||||
sep = tcsrchr(name, NSSEP);
|
||||
if (sep) {
|
||||
fputts(T("ns0:"), fp);
|
||||
fputts(sep + 1, fp);
|
||||
}
|
||||
else
|
||||
fputts(name, fp);
|
||||
puttc(T('>'), fp);
|
||||
}
|
||||
|
||||
static void processingInstruction(void *userData, const XML_Char *target, const XML_Char *data)
|
||||
{
|
||||
FILE *fp = userData;
|
||||
@@ -195,6 +215,22 @@ static void defaultProcessingInstruction(XML_Parser parser, const XML_Char *targ
|
||||
XML_DefaultCurrent(parser);
|
||||
}
|
||||
|
||||
static void nopCharacterData(XML_Parser parser, const XML_Char *s, int len)
|
||||
{
|
||||
}
|
||||
|
||||
static void nopStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
}
|
||||
|
||||
static void nopEndElement(XML_Parser parser, const XML_Char *name)
|
||||
{
|
||||
}
|
||||
|
||||
static void nopProcessingInstruction(XML_Parser parser, const XML_Char *target, const XML_Char *data)
|
||||
{
|
||||
}
|
||||
|
||||
static void markup(XML_Parser parser, const XML_Char *s, int len)
|
||||
{
|
||||
FILE *fp = XML_GetUserData(parser);
|
||||
@@ -209,16 +245,31 @@ void metaLocation(XML_Parser parser)
|
||||
if (uri)
|
||||
ftprintf(XML_GetUserData(parser), T(" uri=\"%s\""), uri);
|
||||
ftprintf(XML_GetUserData(parser),
|
||||
T(" byte=\"%ld\" line=\"%d\" col=\"%d\""),
|
||||
T(" byte=\"%ld\" nbytes=\"%d\" line=\"%d\" col=\"%d\""),
|
||||
XML_GetCurrentByteIndex(parser),
|
||||
XML_GetCurrentByteCount(parser),
|
||||
XML_GetCurrentLineNumber(parser),
|
||||
XML_GetCurrentColumnNumber(parser));
|
||||
}
|
||||
|
||||
static
|
||||
void metaStartDocument(XML_Parser parser)
|
||||
{
|
||||
fputts(T("<document>\n"), XML_GetUserData(parser));
|
||||
}
|
||||
|
||||
static
|
||||
void metaEndDocument(XML_Parser parser)
|
||||
{
|
||||
fputts(T("</document>\n"), XML_GetUserData(parser));
|
||||
}
|
||||
|
||||
static
|
||||
void metaStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
FILE *fp = XML_GetUserData(parser);
|
||||
const XML_Char **specifiedAttsEnd
|
||||
= atts + 2*XML_GetSpecifiedAttributeCount(parser);
|
||||
ftprintf(fp, T("<starttag name=\"%s\""), name);
|
||||
metaLocation(parser);
|
||||
if (*atts) {
|
||||
@@ -226,7 +277,10 @@ void metaStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **
|
||||
do {
|
||||
ftprintf(fp, T("<attribute name=\"%s\" value=\""), atts[0]);
|
||||
characterData(fp, atts[1], tcslen(atts[1]));
|
||||
fputts(T("\"/>\n"), fp);
|
||||
if (atts >= specifiedAttsEnd)
|
||||
fputs(T("\" defaulted=\"yes\"/>\n"), fp);
|
||||
else
|
||||
fputts(T("\"/>\n"), fp);
|
||||
} while (*(atts += 2));
|
||||
fputts(T("</starttag>\n"), fp);
|
||||
}
|
||||
@@ -254,6 +308,35 @@ void metaProcessingInstruction(XML_Parser parser, const XML_Char *target, const
|
||||
fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static
|
||||
void metaComment(XML_Parser parser, const XML_Char *data)
|
||||
{
|
||||
FILE *fp = XML_GetUserData(parser);
|
||||
fputts(T("<comment data=\""), fp);
|
||||
characterData(fp, data, tcslen(data));
|
||||
puttc(T('"'), fp);
|
||||
metaLocation(parser);
|
||||
fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static
|
||||
void metaStartCdataSection(XML_Parser parser)
|
||||
{
|
||||
FILE *fp = XML_GetUserData(parser);
|
||||
fputts(T("<startcdata"), fp);
|
||||
metaLocation(parser);
|
||||
fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static
|
||||
void metaEndCdataSection(XML_Parser parser)
|
||||
{
|
||||
FILE *fp = XML_GetUserData(parser);
|
||||
fputts(T("<endcdata"), fp);
|
||||
metaLocation(parser);
|
||||
fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static
|
||||
void metaCharacterData(XML_Parser parser, const XML_Char *s, int len)
|
||||
{
|
||||
@@ -305,148 +388,32 @@ void metaNotationDecl(XML_Parser parser,
|
||||
fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
XML_Parser parser;
|
||||
int *retPtr;
|
||||
} PROCESS_ARGS;
|
||||
|
||||
static
|
||||
void reportError(XML_Parser parser, const XML_Char *filename)
|
||||
void metaStartNamespaceDecl(XML_Parser parser,
|
||||
const XML_Char *prefix,
|
||||
const XML_Char *uri)
|
||||
{
|
||||
int code = XML_GetErrorCode(parser);
|
||||
const XML_Char *message = XML_ErrorString(code);
|
||||
if (message)
|
||||
ftprintf(stdout, T("%s:%d:%ld: %s\n"),
|
||||
filename,
|
||||
XML_GetErrorLineNumber(parser),
|
||||
XML_GetErrorColumnNumber(parser),
|
||||
message);
|
||||
else
|
||||
ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code);
|
||||
}
|
||||
|
||||
static
|
||||
void processFile(const void *data, size_t size, const XML_Char *filename, void *args)
|
||||
{
|
||||
XML_Parser parser = ((PROCESS_ARGS *)args)->parser;
|
||||
int *retPtr = ((PROCESS_ARGS *)args)->retPtr;
|
||||
if (!XML_Parse(parser, data, size, 1)) {
|
||||
reportError(parser, filename);
|
||||
*retPtr = 0;
|
||||
FILE *fp = XML_GetUserData(parser);
|
||||
fputts(T("<startns"), fp);
|
||||
if (prefix)
|
||||
ftprintf(fp, T(" prefix=\"%s\""), prefix);
|
||||
if (uri) {
|
||||
fputts(T(" ns=\""), fp);
|
||||
characterData(fp, uri, tcslen(uri));
|
||||
fputts(T("\"/>\n"), fp);
|
||||
}
|
||||
else
|
||||
*retPtr = 1;
|
||||
fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static
|
||||
int isAsciiLetter(XML_Char c)
|
||||
void metaEndNamespaceDecl(XML_Parser parser, const XML_Char *prefix)
|
||||
{
|
||||
return (T('a') <= c && c <= T('z')) || (T('A') <= c && c <= T('Z'));
|
||||
}
|
||||
|
||||
static
|
||||
const XML_Char *resolveSystemId(const XML_Char *base, const XML_Char *systemId, XML_Char **toFree)
|
||||
{
|
||||
XML_Char *s;
|
||||
*toFree = 0;
|
||||
if (!base
|
||||
|| *systemId == T('/')
|
||||
#ifdef WIN32
|
||||
|| *systemId == T('\\')
|
||||
|| (isAsciiLetter(systemId[0]) && systemId[1] == T(':'))
|
||||
#endif
|
||||
)
|
||||
return systemId;
|
||||
*toFree = (XML_Char *)malloc((tcslen(base) + tcslen(systemId) + 2)*sizeof(XML_Char));
|
||||
if (!*toFree)
|
||||
return systemId;
|
||||
tcscpy(*toFree, base);
|
||||
s = *toFree;
|
||||
if (tcsrchr(s, T('/')))
|
||||
s = tcsrchr(s, T('/')) + 1;
|
||||
#ifdef WIN32
|
||||
if (tcsrchr(s, T('\\')))
|
||||
s = tcsrchr(s, T('\\')) + 1;
|
||||
#endif
|
||||
tcscpy(s, systemId);
|
||||
return *toFree;
|
||||
}
|
||||
|
||||
static
|
||||
int externalEntityRefFilemap(XML_Parser parser,
|
||||
const XML_Char *openEntityNames,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId)
|
||||
{
|
||||
int result;
|
||||
XML_Char *s;
|
||||
const XML_Char *filename;
|
||||
XML_Parser entParser = XML_ExternalEntityParserCreate(parser, openEntityNames, 0);
|
||||
PROCESS_ARGS args;
|
||||
args.retPtr = &result;
|
||||
args.parser = entParser;
|
||||
filename = resolveSystemId(base, systemId, &s);
|
||||
XML_SetBase(entParser, filename);
|
||||
if (!filemap(filename, processFile, &args))
|
||||
result = 0;
|
||||
free(s);
|
||||
XML_ParserFree(entParser);
|
||||
return result;
|
||||
}
|
||||
|
||||
static
|
||||
int processStream(const XML_Char *filename, XML_Parser parser)
|
||||
{
|
||||
int fd = topen(filename, O_BINARY|O_RDONLY);
|
||||
if (fd < 0) {
|
||||
tperror(filename);
|
||||
return 0;
|
||||
}
|
||||
for (;;) {
|
||||
int nread;
|
||||
char *buf = XML_GetBuffer(parser, READ_SIZE);
|
||||
if (!buf) {
|
||||
close(fd);
|
||||
ftprintf(stderr, T("%s: out of memory\n"), filename);
|
||||
return 0;
|
||||
}
|
||||
nread = read(fd, buf, READ_SIZE);
|
||||
if (nread < 0) {
|
||||
tperror(filename);
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
if (!XML_ParseBuffer(parser, nread, nread == 0)) {
|
||||
reportError(parser, filename);
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
if (nread == 0) {
|
||||
close(fd);
|
||||
break;;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static
|
||||
int externalEntityRefStream(XML_Parser parser,
|
||||
const XML_Char *openEntityNames,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId)
|
||||
{
|
||||
XML_Char *s;
|
||||
const XML_Char *filename;
|
||||
int ret;
|
||||
XML_Parser entParser = XML_ExternalEntityParserCreate(parser, openEntityNames, 0);
|
||||
filename = resolveSystemId(base, systemId, &s);
|
||||
XML_SetBase(entParser, filename);
|
||||
ret = processStream(filename, entParser);
|
||||
free(s);
|
||||
XML_ParserFree(entParser);
|
||||
return ret;
|
||||
FILE *fp = XML_GetUserData(parser);
|
||||
if (!prefix)
|
||||
fputts(T("<endns/>\n"), fp);
|
||||
else
|
||||
ftprintf(fp, T("<endns prefix=\"%s\"/>\n"), prefix);
|
||||
}
|
||||
|
||||
static
|
||||
@@ -493,56 +460,81 @@ int unknownEncoding(void *userData,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static
|
||||
int notStandalone(void *userData)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
void usage(const XML_Char *prog)
|
||||
{
|
||||
ftprintf(stderr, T("usage: %s [-r] [-w] [-x] [-d output-dir] [-e encoding] file ...\n"), prog);
|
||||
ftprintf(stderr, T("usage: %s [-n] [-r] [-s] [-w] [-x] [-d output-dir] [-e encoding] file ...\n"), prog);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int tmain(int argc, XML_Char **argv)
|
||||
{
|
||||
int i;
|
||||
int i, j;
|
||||
const XML_Char *outputDir = 0;
|
||||
const XML_Char *encoding = 0;
|
||||
int useFilemap = 1;
|
||||
int processExternalEntities = 0;
|
||||
unsigned processFlags = XML_MAP_FILE;
|
||||
int windowsCodePages = 0;
|
||||
int outputType = 0;
|
||||
int useNamespaces = 0;
|
||||
int requireStandalone = 0;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
|
||||
i = 1;
|
||||
while (i < argc && argv[i][0] == T('-')) {
|
||||
int j;
|
||||
if (argv[i][1] == T('-') && argv[i][2] == T('\0')) {
|
||||
i++;
|
||||
j = 0;
|
||||
while (i < argc) {
|
||||
if (j == 0) {
|
||||
if (argv[i][0] != T('-'))
|
||||
break;
|
||||
if (argv[i][1] == T('-') && argv[i][2] == T('\0')) {
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
switch (argv[i][j]) {
|
||||
case T('r'):
|
||||
processFlags &= ~XML_MAP_FILE;
|
||||
j++;
|
||||
break;
|
||||
}
|
||||
j = 1;
|
||||
if (argv[i][j] == T('r')) {
|
||||
useFilemap = 0;
|
||||
case T('s'):
|
||||
requireStandalone = 1;
|
||||
j++;
|
||||
}
|
||||
if (argv[i][j] == T('x')) {
|
||||
processExternalEntities = 1;
|
||||
break;
|
||||
case T('n'):
|
||||
useNamespaces = 1;
|
||||
j++;
|
||||
}
|
||||
if (argv[i][j] == T('w')) {
|
||||
break;
|
||||
case T('x'):
|
||||
processFlags |= XML_EXTERNAL_ENTITIES;
|
||||
j++;
|
||||
break;
|
||||
case T('w'):
|
||||
windowsCodePages = 1;
|
||||
j++;
|
||||
}
|
||||
if (argv[i][j] == T('m')) {
|
||||
break;
|
||||
case T('m'):
|
||||
outputType = 'm';
|
||||
j++;
|
||||
}
|
||||
if (argv[i][j] == T('c')) {
|
||||
break;
|
||||
case T('c'):
|
||||
outputType = 'c';
|
||||
useNamespaces = 0;
|
||||
j++;
|
||||
}
|
||||
if (argv[i][j] == T('d')) {
|
||||
break;
|
||||
case T('t'):
|
||||
outputType = 't';
|
||||
j++;
|
||||
break;
|
||||
case T('d'):
|
||||
if (argv[i][j + 1] == T('\0')) {
|
||||
if (++i == argc)
|
||||
usage(argv[0]);
|
||||
@@ -551,8 +543,9 @@ int tmain(int argc, XML_Char **argv)
|
||||
else
|
||||
outputDir = argv[i] + j + 1;
|
||||
i++;
|
||||
}
|
||||
else if (argv[i][j] == T('e')) {
|
||||
j = 0;
|
||||
break;
|
||||
case T('e'):
|
||||
if (argv[i][j + 1] == T('\0')) {
|
||||
if (++i == argc)
|
||||
usage(argv[0]);
|
||||
@@ -561,11 +554,18 @@ int tmain(int argc, XML_Char **argv)
|
||||
else
|
||||
encoding = argv[i] + j + 1;
|
||||
i++;
|
||||
}
|
||||
else if (argv[i][j] == T('\0') && j > 1)
|
||||
i++;
|
||||
else
|
||||
j = 0;
|
||||
break;
|
||||
case T('\0'):
|
||||
if (j > 1) {
|
||||
i++;
|
||||
j = 0;
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
default:
|
||||
usage(argv[0]);
|
||||
}
|
||||
}
|
||||
if (i == argc)
|
||||
usage(argv[0]);
|
||||
@@ -573,8 +573,22 @@ int tmain(int argc, XML_Char **argv)
|
||||
FILE *fp = 0;
|
||||
XML_Char *outName = 0;
|
||||
int result;
|
||||
XML_Parser parser = XML_ParserCreate(encoding);
|
||||
if (outputDir) {
|
||||
XML_Parser parser;
|
||||
if (useNamespaces)
|
||||
parser = XML_ParserCreateNS(encoding, NSSEP);
|
||||
else
|
||||
parser = XML_ParserCreate(encoding);
|
||||
if (requireStandalone)
|
||||
XML_SetNotStandaloneHandler(parser, notStandalone);
|
||||
if (outputType == 't') {
|
||||
/* This is for doing timings; this gives a more realistic estimate of
|
||||
the parsing time. */
|
||||
outputDir = 0;
|
||||
XML_SetElementHandler(parser, nopStartElement, nopEndElement);
|
||||
XML_SetCharacterDataHandler(parser, nopCharacterData);
|
||||
XML_SetProcessingInstructionHandler(parser, nopProcessingInstruction);
|
||||
}
|
||||
else if (outputDir) {
|
||||
const XML_Char *file = argv[i];
|
||||
if (tcsrchr(file, T('/')))
|
||||
file = tcsrchr(file, T('/')) + 1;
|
||||
@@ -591,6 +605,7 @@ int tmain(int argc, XML_Char **argv)
|
||||
tperror(outName);
|
||||
exit(1);
|
||||
}
|
||||
setvbuf(fp, NULL, _IOFBF, 16384);
|
||||
#ifdef XML_UNICODE
|
||||
puttc(0xFEFF, fp);
|
||||
#endif
|
||||
@@ -598,12 +613,15 @@ int tmain(int argc, XML_Char **argv)
|
||||
switch (outputType) {
|
||||
case 'm':
|
||||
XML_UseParserAsHandlerArg(parser);
|
||||
fputts(T("<document>\n"), fp);
|
||||
XML_SetElementHandler(parser, metaStartElement, metaEndElement);
|
||||
XML_SetProcessingInstructionHandler(parser, metaProcessingInstruction);
|
||||
XML_SetCommentHandler(parser, metaComment);
|
||||
XML_SetCdataSectionHandler(parser, metaStartCdataSection, metaEndCdataSection);
|
||||
XML_SetCharacterDataHandler(parser, metaCharacterData);
|
||||
XML_SetUnparsedEntityDeclHandler(parser, metaUnparsedEntityDecl);
|
||||
XML_SetNotationDeclHandler(parser, metaNotationDecl);
|
||||
XML_SetNamespaceDeclHandler(parser, metaStartNamespaceDecl, metaEndNamespaceDecl);
|
||||
metaStartDocument(parser);
|
||||
break;
|
||||
case 'c':
|
||||
XML_UseParserAsHandlerArg(parser);
|
||||
@@ -613,7 +631,10 @@ int tmain(int argc, XML_Char **argv)
|
||||
XML_SetProcessingInstructionHandler(parser, defaultProcessingInstruction);
|
||||
break;
|
||||
default:
|
||||
XML_SetElementHandler(parser, startElement, endElement);
|
||||
if (useNamespaces)
|
||||
XML_SetElementHandler(parser, startElementNS, endElementNS);
|
||||
else
|
||||
XML_SetElementHandler(parser, startElement, endElement);
|
||||
XML_SetCharacterDataHandler(parser, characterData);
|
||||
XML_SetProcessingInstructionHandler(parser, processingInstruction);
|
||||
break;
|
||||
@@ -621,27 +642,10 @@ int tmain(int argc, XML_Char **argv)
|
||||
}
|
||||
if (windowsCodePages)
|
||||
XML_SetUnknownEncodingHandler(parser, unknownEncoding, 0);
|
||||
if (!XML_SetBase(parser, argv[i])) {
|
||||
ftprintf(stderr, T("%s: out of memory"), argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
if (processExternalEntities)
|
||||
XML_SetExternalEntityRefHandler(parser,
|
||||
useFilemap
|
||||
? externalEntityRefFilemap
|
||||
: externalEntityRefStream);
|
||||
if (useFilemap) {
|
||||
PROCESS_ARGS args;
|
||||
args.retPtr = &result;
|
||||
args.parser = parser;
|
||||
if (!filemap(argv[i], processFile, &args))
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
result = processStream(argv[i], parser);
|
||||
result = XML_ProcessFile(parser, argv[i], processFlags);
|
||||
if (outputDir) {
|
||||
if (outputType == 'm')
|
||||
fputts(T("</document>\n"), fp);
|
||||
metaEndDocument(parser);
|
||||
fclose(fp);
|
||||
if (!result)
|
||||
tremove(outName);
|
||||
|
||||
Executable
+136
@@ -0,0 +1,136 @@
|
||||
# Microsoft Developer Studio Project File - Name="xmlwf" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=xmlwf - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "xmlwf.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "xmlwf.mak" CFG="xmlwf - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "xmlwf - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "xmlwf - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "xmlwf - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir "."
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "."
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\xmlparse" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D XMLTOKAPI=__declspec(dllimport) /D XMLPARSEAPI=__declspec(dllimport) /YX /FD /c
|
||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 setargv.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\bin\xmlwf.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmlwf - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir "."
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\Debug"
|
||||
# PROP Intermediate_Dir ".\Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir "."
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\xmlparse" /I "..\xmlparse" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D XMLTOKAPI=__declspec(dllimport) /D XMLPARSEAPI=__declspec(dllimport) /YX /FD /c
|
||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
|
||||
# ADD LINK32 setargv.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\dbgbin\xmlwf.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "xmlwf - Win32 Release"
|
||||
# Name "xmlwf - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\codepage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\readfilemap.c
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\unixfilemap.c
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\win32filemap.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmlfile.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmlwf.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\codepage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmlfile.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xmltchar.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
Executable
+371
@@ -0,0 +1,371 @@
|
||||
#include "xmlparse.h"
|
||||
#ifdef XML_UNICODE
|
||||
#define UNICODE
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <urlmon.h>
|
||||
#include <wininet.h>
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
#include "xmlurl.h"
|
||||
#include "xmlmime.h"
|
||||
|
||||
static
|
||||
int processURL(XML_Parser parser, IMoniker *baseMoniker, const XML_Char *url);
|
||||
|
||||
typedef void (*StopHandler)(void *, HRESULT);
|
||||
|
||||
class Callback : public IBindStatusCallback {
|
||||
public:
|
||||
// IUnknown methods
|
||||
STDMETHODIMP QueryInterface(REFIID,void **);
|
||||
STDMETHODIMP_(ULONG) AddRef();
|
||||
STDMETHODIMP_(ULONG) Release();
|
||||
// IBindStatusCallback methods
|
||||
STDMETHODIMP OnStartBinding(DWORD, IBinding *);
|
||||
STDMETHODIMP GetPriority(LONG *);
|
||||
STDMETHODIMP OnLowResource(DWORD);
|
||||
STDMETHODIMP OnProgress(ULONG, ULONG, ULONG, LPCWSTR);
|
||||
STDMETHODIMP OnStopBinding(HRESULT, LPCWSTR);
|
||||
STDMETHODIMP GetBindInfo(DWORD *, BINDINFO *);
|
||||
STDMETHODIMP OnDataAvailable(DWORD, DWORD, FORMATETC *, STGMEDIUM *);
|
||||
STDMETHODIMP OnObjectAvailable(REFIID, IUnknown *);
|
||||
Callback(XML_Parser, IMoniker *, StopHandler, void *);
|
||||
~Callback();
|
||||
int externalEntityRef(const XML_Char *context, const XML_Char *systemId, const XML_Char *publicId);
|
||||
private:
|
||||
XML_Parser parser_;
|
||||
IMoniker *baseMoniker_;
|
||||
DWORD totalRead_;
|
||||
ULONG ref_;
|
||||
IBinding *pBinding_;
|
||||
StopHandler stopHandler_;
|
||||
void *stopArg_;
|
||||
};
|
||||
|
||||
STDMETHODIMP_(ULONG) Callback::AddRef()
|
||||
{
|
||||
return ref_++;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG) Callback::Release()
|
||||
{
|
||||
if (--ref_ == 0) {
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return ref_;
|
||||
}
|
||||
|
||||
STDMETHODIMP Callback::QueryInterface(REFIID riid, void** ppv)
|
||||
{
|
||||
if (IsEqualGUID(riid, IID_IUnknown))
|
||||
*ppv = (IUnknown *)this;
|
||||
else if (IsEqualGUID(riid, IID_IBindStatusCallback))
|
||||
*ppv = (IBindStatusCallback *)this;
|
||||
else
|
||||
return E_NOINTERFACE;
|
||||
((LPUNKNOWN)*ppv)->AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP Callback::OnStartBinding(DWORD, IBinding* pBinding)
|
||||
{
|
||||
pBinding_ = pBinding;
|
||||
pBinding->AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP Callback::GetPriority(LONG *)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
STDMETHODIMP Callback::OnLowResource(DWORD)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
STDMETHODIMP Callback::OnProgress(ULONG, ULONG, ULONG, LPCWSTR)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP Callback::OnStopBinding(HRESULT hr, LPCWSTR szError)
|
||||
{
|
||||
if (pBinding_) {
|
||||
pBinding_->Release();
|
||||
pBinding_ = 0;
|
||||
}
|
||||
if (baseMoniker_) {
|
||||
baseMoniker_->Release();
|
||||
baseMoniker_ = 0;
|
||||
}
|
||||
stopHandler_(stopArg_, hr);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP Callback::GetBindInfo(DWORD* pgrfBINDF, BINDINFO* pbindinfo)
|
||||
{
|
||||
*pgrfBINDF = BINDF_ASYNCHRONOUS;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static
|
||||
void reportError(XML_Parser parser)
|
||||
{
|
||||
int code = XML_GetErrorCode(parser);
|
||||
const XML_Char *message = XML_ErrorString(code);
|
||||
if (message)
|
||||
_ftprintf(stderr, _T("%s:%d:%ld: %s\n"),
|
||||
XML_GetBase(parser),
|
||||
XML_GetErrorLineNumber(parser),
|
||||
XML_GetErrorColumnNumber(parser),
|
||||
message);
|
||||
else
|
||||
_ftprintf(stderr, _T("%s: (unknown message %d)\n"), XML_GetBase(parser), code);
|
||||
}
|
||||
|
||||
STDMETHODIMP Callback::OnDataAvailable(DWORD grfBSCF,
|
||||
DWORD dwSize,
|
||||
FORMATETC *pfmtetc,
|
||||
STGMEDIUM* pstgmed)
|
||||
{
|
||||
if (grfBSCF & BSCF_FIRSTDATANOTIFICATION) {
|
||||
IWinInetHttpInfo *hp;
|
||||
HRESULT hr = pBinding_->QueryInterface(IID_IWinInetHttpInfo, (void **)&hp);
|
||||
if (SUCCEEDED(hr)) {
|
||||
char contentType[1024];
|
||||
DWORD bufSize = sizeof(contentType);
|
||||
DWORD flags = 0;
|
||||
contentType[0] = 0;
|
||||
hr = hp->QueryInfo(HTTP_QUERY_CONTENT_TYPE, contentType, &bufSize, 0, NULL);
|
||||
if (SUCCEEDED(hr)) {
|
||||
char charset[CHARSET_MAX];
|
||||
getXMLCharset(contentType, charset);
|
||||
if (charset[0]) {
|
||||
#ifdef XML_UNICODE
|
||||
XML_Char wcharset[CHARSET_MAX];
|
||||
XML_Char *p1 = wcharset;
|
||||
const char *p2 = charset;
|
||||
while ((*p1++ = (unsigned char)*p2++) != 0)
|
||||
;
|
||||
XML_SetEncoding(parser_, wcharset);
|
||||
#else
|
||||
XML_SetEncoding(parser_, charset);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
hp->Release();
|
||||
}
|
||||
}
|
||||
if (!parser_)
|
||||
return E_ABORT;
|
||||
if (pstgmed->tymed == TYMED_ISTREAM) {
|
||||
while (totalRead_ < dwSize) {
|
||||
#define READ_MAX (64*1024)
|
||||
DWORD nToRead = dwSize - totalRead_;
|
||||
if (nToRead > READ_MAX)
|
||||
nToRead = READ_MAX;
|
||||
void *buf = XML_GetBuffer(parser_, nToRead);
|
||||
if (!buf) {
|
||||
_ftprintf(stderr, _T("out of memory\n"));
|
||||
return E_ABORT;
|
||||
}
|
||||
DWORD nRead;
|
||||
HRESULT hr = pstgmed->pstm->Read(buf, nToRead, &nRead);
|
||||
if (SUCCEEDED(hr)) {
|
||||
totalRead_ += nRead;
|
||||
if (!XML_ParseBuffer(parser_,
|
||||
nRead,
|
||||
(grfBSCF & BSCF_LASTDATANOTIFICATION) != 0
|
||||
&& totalRead_ == dwSize)) {
|
||||
reportError(parser_);
|
||||
return E_ABORT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP Callback::OnObjectAvailable(REFIID, IUnknown *)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
int Callback::externalEntityRef(const XML_Char *context, const XML_Char *systemId, const XML_Char *publicId)
|
||||
{
|
||||
XML_Parser entParser = XML_ExternalEntityParserCreate(parser_, context, 0);
|
||||
XML_SetBase(entParser, systemId);
|
||||
int ret = processURL(entParser, baseMoniker_, systemId);
|
||||
XML_ParserFree(entParser);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Callback::Callback(XML_Parser parser, IMoniker *baseMoniker, StopHandler stopHandler, void *stopArg)
|
||||
: parser_(parser),
|
||||
baseMoniker_(baseMoniker),
|
||||
ref_(0),
|
||||
pBinding_(0),
|
||||
totalRead_(0),
|
||||
stopHandler_(stopHandler),
|
||||
stopArg_(stopArg)
|
||||
{
|
||||
if (baseMoniker_)
|
||||
baseMoniker_->AddRef();
|
||||
}
|
||||
|
||||
Callback::~Callback()
|
||||
{
|
||||
if (pBinding_)
|
||||
pBinding_->Release();
|
||||
if (baseMoniker_)
|
||||
baseMoniker_->Release();
|
||||
}
|
||||
|
||||
static
|
||||
int externalEntityRef(void *arg,
|
||||
const XML_Char *context,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId)
|
||||
{
|
||||
return ((Callback *)arg)->externalEntityRef(context, systemId, publicId);
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
HRESULT openStream(XML_Parser parser,
|
||||
IMoniker *baseMoniker,
|
||||
const XML_Char *uri,
|
||||
StopHandler stopHandler, void *stopArg)
|
||||
{
|
||||
if (!XML_SetBase(parser, uri))
|
||||
return E_OUTOFMEMORY;
|
||||
HRESULT hr;
|
||||
IMoniker *m;
|
||||
#ifdef XML_UNICODE
|
||||
hr = CreateURLMoniker(0, uri, &m);
|
||||
#else
|
||||
LPWSTR uriw = new wchar_t[strlen(uri) + 1];
|
||||
for (int i = 0;; i++) {
|
||||
uriw[i] = uri[i];
|
||||
if (uriw[i] == 0)
|
||||
break;
|
||||
}
|
||||
hr = CreateURLMoniker(baseMoniker, uriw, &m);
|
||||
delete [] uriw;
|
||||
#endif
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
IBindStatusCallback *cb = new Callback(parser, m, stopHandler, stopArg);
|
||||
XML_SetExternalEntityRefHandler(parser, externalEntityRef);
|
||||
XML_SetExternalEntityRefHandlerArg(parser, cb);
|
||||
cb->AddRef();
|
||||
IBindCtx *b;
|
||||
if (FAILED(hr = CreateAsyncBindCtx(0, cb, 0, &b))) {
|
||||
cb->Release();
|
||||
m->Release();
|
||||
return hr;
|
||||
}
|
||||
cb->Release();
|
||||
IStream *pStream;
|
||||
hr = m->BindToStorage(b, 0, IID_IStream, (void **)&pStream);
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (pStream)
|
||||
pStream->Release();
|
||||
}
|
||||
if (hr == MK_S_ASYNCHRONOUS)
|
||||
hr = S_OK;
|
||||
m->Release();
|
||||
b->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
struct QuitInfo {
|
||||
const XML_Char *url;
|
||||
HRESULT hr;
|
||||
int stop;
|
||||
};
|
||||
|
||||
static
|
||||
void winPerror(const XML_Char *url, HRESULT hr)
|
||||
{
|
||||
LPVOID buf;
|
||||
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
|
||||
| FORMAT_MESSAGE_FROM_HMODULE,
|
||||
GetModuleHandleA("urlmon.dll"),
|
||||
hr,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR) &buf,
|
||||
0,
|
||||
NULL)
|
||||
|| FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
|
||||
| FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
0,
|
||||
hr,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR) &buf,
|
||||
0,
|
||||
NULL)) {
|
||||
/* The system error messages seem to end with a newline. */
|
||||
_ftprintf(stderr, _T("%s: %s"), url, buf);
|
||||
fflush(stderr);
|
||||
LocalFree(buf);
|
||||
}
|
||||
else
|
||||
_ftprintf(stderr, _T("%s: error %x\n"), url, hr);
|
||||
}
|
||||
|
||||
static void threadQuit(void *p, HRESULT hr)
|
||||
{
|
||||
QuitInfo *qi = (QuitInfo *)p;
|
||||
qi->hr = hr;
|
||||
qi->stop = 1;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
int XML_URLInit()
|
||||
{
|
||||
return SUCCEEDED(CoInitialize(0));
|
||||
}
|
||||
|
||||
extern "C"
|
||||
void XML_URLUninit()
|
||||
{
|
||||
CoUninitialize();
|
||||
}
|
||||
|
||||
static
|
||||
int processURL(XML_Parser parser, IMoniker *baseMoniker, const XML_Char *url)
|
||||
{
|
||||
QuitInfo qi;
|
||||
qi.stop = 0;
|
||||
qi.url = url;
|
||||
|
||||
XML_SetBase(parser, url);
|
||||
HRESULT hr = openStream(parser, baseMoniker, url, threadQuit, &qi);
|
||||
if (FAILED(hr)) {
|
||||
winPerror(url, hr);
|
||||
return 0;
|
||||
}
|
||||
else if (FAILED(qi.hr)) {
|
||||
winPerror(url, qi.hr);
|
||||
return 0;
|
||||
}
|
||||
MSG msg;
|
||||
while (!qi.stop && GetMessage (&msg, NULL, 0, 0)) {
|
||||
TranslateMessage (&msg);
|
||||
DispatchMessage (&msg);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
int XML_ProcessURL(XML_Parser parser,
|
||||
const XML_Char *url,
|
||||
unsigned flags)
|
||||
{
|
||||
return processURL(parser, 0, url);
|
||||
}
|
||||
Reference in New Issue
Block a user