Commit Graph

225 Commits

Author SHA1 Message Date
Karl Waclawek
69af7dedff Fixed compile errors when XML_DTD and XML_CONTEXT_BYTES
were undefined.
2004-04-29 17:53:34 +00:00
Karl Waclawek
edca100c0c Added comment about the effects on well-formedness checking after
calling XML_UseForeignDTD(parser, XML_TRUE).
2004-04-27 00:49:34 +00:00
Karl Waclawek
6361de48a2 Would not build on Linux without including stddef.h before
including external.h.
2004-04-24 23:56:41 +00:00
Karl Waclawek
149774b6ec Fix for bug #920274. 2004-04-13 13:17:59 +00:00
Karl Waclawek
9b665601fd Fix for bug #923913, Calling convention problems.
For details see bug description.
2004-03-26 14:24:11 +00:00
Karl Waclawek
22fc8d15d4 Changed to allow aborting a suspended parser instance. 2004-03-16 22:14:31 +00:00
Karl Waclawek
9c48460b5e Removed ability to suspend while parsing an external parameter entity.
The problem is that on return from the externalEntityRefHandler() call-back
the parser currently assumes that parsing of the parameter entity is finished,
and updates its internal state accordingly. I do not have the time at this
point to implement and test a solution. Being able to suspend while parsing
the DTD is also less desirable than doing the same while parsing content.
2004-03-16 20:29:28 +00:00
Karl Waclawek
c50aeb9f9c When the parser was suspended while processing an internal entity,
an XML_ERROR_NO_ELEMENTS condition could happen.
The reason was that the internal entity's start tag level was not preserved
when parsing was suspended. This has been corrected.
2004-03-16 04:41:54 +00:00
Karl Waclawek
86f4b1471b Fixed the XML_GetCurrentLine/ColumnNumber() functions so that
they don't produce an access violation when the value of eventPtr is
less than the value of positionPtr. This can happen when a handler
raises an exception or potentially in some border cases.

Also added some more updates of eventPtr.
2004-03-16 04:27:18 +00:00
Karl Waclawek
2a3e8fa423 Changed signature of XML_GetParsingStatus(), changing the return value
to a parameter passed by reference (pointer). It seems that  the processing
of return values is not standardized, even when calling convention and
platform are specified. This should make Expat more usable as a shared library.
2004-03-16 03:53:24 +00:00
Karl Waclawek
5d1062a57d Fix for bug #916228. 2004-03-15 00:34:12 +00:00
Karl Waclawek
28ede67c7f Improved comments for XML_StopParser() and XML_ResumeParser(). 2004-03-10 15:56:11 +00:00
Karl Waclawek
cab3befee5 Applied a simplified version of Jeremy Kloth's patch for bug #896188.
Also removed some code that was never executed, because the condition
(prologState.documentEntity && role == XML_ROLE_INNER_PARAM_ENTITY_REF)
can never be true. Improved some comments as well.
2004-02-13 18:11:51 +00:00
Karl Waclawek
3cb7a47584 Made these compiler warnings go away:
- not all cases handled for switch based an enumeration:
  added default: ; where appropriate
- char* passed where const char* was expected:
  changed variable declarations to const char*
2004-02-11 16:42:40 +00:00
Karl Waclawek
100e0bd4a2 Cosmetic changes in function signatures - for consistency. 2004-01-27 01:48:58 +00:00
Fred L. Drake, Jr.
3fc33bf3b6 suggested patch from SF bug #846309:
avoid generating spurious warning from GCC on non-x86 platforms
2004-01-20 16:04:47 +00:00
Karl Waclawek
2335294f7c Applied patch #835123: Suspend/Resume functionality.
For details check the patch description.
2004-01-07 17:12:04 +00:00
Fred L. Drake, Jr.
1b3f0f6b1f bump the version number since the code has changed, however slightly 2003-11-02 20:37:22 +00:00
Fred L. Drake, Jr.
441247cf0c remove unused stanzas 2003-11-02 18:14:11 +00:00
Fred L. Drake, Jr.
8b57439995 Simplify preprocessor construct. 2003-11-02 09:44:55 +00:00
Fred L. Drake, Jr.
fba15ab94c remove unnecessary typecast 2003-10-30 14:58:39 +00:00
Karl Waclawek
e16720329e Make XML_ParserFree() null-safe, so that it behaves
like the standard free() memory deallocation function.
2003-10-26 08:13:54 +00:00
Fred L. Drake, Jr.
cf18cd478c avoid a few additional warnings for some compilers, and others with
warnings turned way up high
2003-10-18 04:46:02 +00:00
Karl Waclawek
b3a1f516ca Fix for bug #824420. 2003-10-16 14:26:46 +00:00
Fred L. Drake, Jr.
99609421a8 Make it possible to avoid the import of expat_config.h. This makes it
easier to compile Expat without the autoconf support.
This closes SF patch #458907.
2003-10-16 04:51:11 +00:00
Fred L. Drake, Jr.
c56983e0f0 - use spaces instead of tabs consistently
- don't allow trailing whitespace at the end of lines
- remove blank lines at the end of the file
2003-10-16 04:23:44 +00:00
Fred L. Drake, Jr.
80e8668e6f Remove the __attribute__((dllimport)) and __attribute__((dllexport))
declarations; these are needed only on an obscure platform (Windows NT
on PowerPC using GCC), and were never in previous releases of Expat.
They caused way too many spurious warnings on several platforms where
they aren't actually needed but should be ignored silently.
Removing these cannot break working code.
2003-10-16 04:20:54 +00:00
Karl Waclawek
5bdc75633d Removed unused EXPAT_EXPORTS definition. 2003-10-15 21:38:15 +00:00
Fred L. Drake, Jr.
2331e87068 clean up the macro restructuring, and make it play nice on Windows 2003-10-15 20:51:28 +00:00
Fred L. Drake, Jr.
2bba3d20f5 Deal with issue discussed in SF patch #820946: Expat doesn't handle
the use of modified default calling conventions in client code.

To deal with this issue and generally clean up the mass of macros
being used to support bits of the machinery, two new macros are being
added:

- XMLCALL, which expands to whatever is needed to nail down the
  calling convention for all calls across the library boundary.  This
  must match the convention used for the system's malloc()
  implementation.

- XMLIMPORT, defined to be whatever magic is needed to mark an entry
  point as imported from a dynamically loaded module (.dll, .so, .sl,
  whatever).

These macros are used to define the XMLPARSEAPI macro already being
used to define the API entry points.  In addition, XMLCALL is used to
define the types of callback functions, and all example code uses this
explicitly in both the distributed applications and the documentation.
2003-10-15 16:25:44 +00:00
Greg Stein
d7a766e9df Suggested fix from jtalkington@users.sf.net.
See bug #765227.

* lib/internal.h:
  (FASTCALL, PTRFASTCALL): only define these macros for the GNU C compiler
    on i386 platforms. apprently, they do not work well on PPC ports.
2003-09-28 21:57:22 +00:00
Karl Waclawek
ecceec27f2 Improved comment on hash algorithm. 2003-09-22 14:14:54 +00:00
Karl Waclawek
b28869898a Applied patch #699487. For details see patch description. 2003-09-13 17:30:30 +00:00
Fred L. Drake, Jr.
fa49735f8a - bump the versioning information
- start describing the changes in 1.95.7
2003-07-15 15:20:35 +00:00
Karl Waclawek
57455c864c Expat would report an incorrect "Unlosed token" error when
expanding %percent; in the second of these entity declarations:

<!ENTITY % percent "&#37;">
<!ENTITY %percent; y "value">

This patch was submitted by James Clark on the xml-dev mailing list.
2003-07-03 04:01:14 +00:00
Fred L. Drake, Jr.
f668c507d9 Be more defensive: only enable the *CALL macros when using GCC on
Linux, since we know the current definitions work there and have a
positive effect.
This closes SF bug #692878.
2003-03-14 17:25:12 +00:00
Fred L. Drake, Jr.
5bd3d020d3 - better explain the XML_GetCurrent*() functions (SF bug #683681) 2003-03-13 02:17:48 +00:00
Fred L. Drake, Jr.
cc454566be Fix FASTCALL for GCC on Solaris (SF bug #692878).
This file is becoming a liability.
2003-03-12 23:02:11 +00:00
Karl Waclawek
8650b04b24 Apply patch NSAttFix3.diff for bug #692964 (with one minor modification).
This also fixes bug #695401.
2003-03-07 15:54:08 +00:00
Karl Waclawek
2d3510fa5f Fix for bug #679754: compile error when XML_DTD not defined. 2003-02-03 20:32:45 +00:00
Fred L. Drake, Jr.
777344d49d Move the XML_Status enum definition earlier. Some recent versions of
GCC (3.2 at least) report an error from the forward reference.
2003-01-29 02:43:08 +00:00
Fred L. Drake, Jr.
1ffb2b424a Karl's latest patch for SF issue #673791:
Call storeAtts() for all element start tags; this is necessary to
ensure attribute defaults are properly processed for all elements
(needed to do proper namespace checking, at the very least), and that
tag names are properly cooked when there's an end-element-handler but
no start-element-handler.

This causes the new tests to pass, and closes the SF tracker issue.
2003-01-28 05:45:10 +00:00
Fred L. Drake, Jr.
a04f107e61 Karl's fix for SF bug #673791:
Error with xmlns:prefix= with namespace processing enabled.

It seems that storeAtts() has the following properties:
- when called with tagNamePtr = NULL and bindingsPtr = NULL,
  it does not process attributes incl. namespace declarations
- when called with all arguments non-NULL it processes
  attributes (incl. default attributes) and namespace declarations

We also have these requirements:

A) for start of element event:

  1) if we have a startElementHandler:
     we need to process at least default attributes,
     so we must call storeAtts with all arguments non-NULL
  2) if we have no startElementHandler, but we have attributes:
     we need to process namespace declarations,
     so we must call storeAtts with all arguments non-NULL
  3) if we have no startElementHandler and no attributes:
     we need to store the name (for the end element event, where
     the names are compared) and call only the default handler

  Note: Storing the name is a pre-requisiste for calling
        storeAtts with all arguments non-NULL.

So there really is no place for calling storeAtts with
tagNamePtr = NULL and bindingsPtr = NULL.

B) for empty element event:

  1) if we have a startElementHandler:
     we need to process at least default attributes,
     so we must call storeAtts with all arguments non-NULL
  2) if we have no startElementHandler, but we have attributes:
     we need to process namespace declarations,
     so we must call storeAtts with all arguments non-NULL
  3) if we have no startElementHandler and no attributes,
     but we have an endElementHandler:
     we need to store the name for calling the handler,
     but we need not process any attributes (default or not)
  4) if we have no start- or endElementHandler, and no attributes:
     we need to call only the default handler

Given that storeAtts will now always be called with all arguments
non-NULL we could remove a few internal checks in storeAtts,
if that improves efficiency. Not sure if that is worth it.

This patch should therefore fix the problem of namespace declarations
not being processed when no startElementHandler is set, that is,
it will fix Jeremy's NS processing patch.
2003-01-25 06:53:05 +00:00
Karl Waclawek
d9d497177a Applied patch #673791. 2003-01-24 05:01:45 +00:00
Karl Waclawek
dd2ecd7fa8 For the start of element and end of element events, it is possible that
the default handler does not get called even when no element handlers
are called, because storeAtts() may trigger the startNamespaceDeclHandler
where the application has a chance to clear the element handlers.

This patch fixes this with one issue still open, which applies to empty elements only:
When the endElement handler is called, but not the startElementHandler,
then the default handler is not called, which causes attributes to not
be reported at all. The other alternative would be to call the default handler,
but then the element would be reported twice.
2003-01-22 14:52:20 +00:00
Karl Waclawek
c56f444ab0 Prevent storeAtts() from being called twice for an empty element when
the endElementHandler is set, but not the startElementHandler.
2003-01-22 14:26:07 +00:00
Fred L. Drake, Jr.
7410374a90 Correct the version some APIs were added in. 2003-01-16 23:22:56 +00:00
Karl Waclawek
f19a5291ec Patch for bug/feature request #651754.
Implemented with two API additions:
1) For element declaration handler support:
  XML_FreeContentModel
2) Exposing Expat's memory allocation functions:
  XML_MemMalloc
  XML_MemRealloc
  XML_MemFree
2003-01-16 22:03:42 +00:00
Karl Waclawek
3bfb49007e Applied patch for bug #667511 supplied by Jeremy Kloth. 2003-01-15 00:51:15 +00:00
Fred L. Drake, Jr.
77c2d3e0ae Update comments to refer to XML_STATUS_OK, XML_STATUS_ERROR, and NULL
as appropriate.
2002-12-31 17:53:21 +00:00