Commit Graph

190 Commits

Author SHA1 Message Date
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
Fred L. Drake, Jr.
eb280e7260 Change the API to return XML_Status values where possible.
Existing client code is 100% compatible.
2002-12-30 20:12:52 +00:00
Fred L. Drake, Jr.
f379e9315f When returning a status value through the public API, use
XML_STATUS_OK / XML_STATUS_ERROR.  Internal status returns are not
affected.
2002-12-30 20:02:28 +00:00
Karl Waclawek
e6802bb514 Fix for bug/feature request #653180. 2002-12-16 04:02:02 +00:00
Karl Waclawek
ed47baa513 Applied patch for bug #653449. 2002-12-14 03:12:18 +00:00
Karl Waclawek
f162999a26 Annotated MS VC++ DEF files. 2002-12-08 14:35:34 +00:00
Patrick McConnell
2fd9d5e8d6 Moving the Borland .def files to the BCB5 directory and correcting an
error in the LIBRARY entry
2002-12-08 03:16:38 +00:00
Patrick McConnell
7c008489b1 libexpat dll def files for borland initial release 2002-12-07 08:25:58 +00:00
Karl Waclawek
48cb2c35b0 Added additional patch for bug #644334. Includes workaround for
bad API typedef of externalEntityRefHandler.
2002-11-27 17:11:32 +00:00
Fred L. Drake, Jr.
9a41111b9d Add some type casts to deal with MALLOC signature checking for
some platforms.
Closes SF bug #644334.
2002-11-27 04:03:33 +00:00
Fred L. Drake, Jr.
d0d21d7253 The feature name pointers should be marked const. This reportedly
avoids some warnings on HP-UX using the aCC compiler.
Closes SF bug #644461.
2002-11-27 03:31:23 +00:00
Fred L. Drake, Jr.
4e95e87acb Make sure all lines end with a newline. 2002-11-20 04:27:32 +00:00
Fred L. Drake, Jr.
0a40843bde Remove trailing whitespace. 2002-11-12 21:49:36 +00:00
Fred L. Drake, Jr.
47d66b73ba Remove trailing whitespace. 2002-11-12 21:44:18 +00:00
Karl Waclawek
c61a46c305 * Applied patch #620822 - Windows Dll build with DEF file
* Changed macro for static linking from _STATIC to XML_STATIC
  and modified expat.h accordingly
* Added ReadMe file to Win32 subdirectory documenting Windows builds
* Changed static build settings to create libraries with names different
  from the Dll stub library libexpat(w).lib
2002-10-21 21:19:41 +00:00
Karl Waclawek
b6a92c7a8f Improved documentation of XML_ExternalEntityRefHandler. 2002-10-17 16:47:45 +00:00
Karl Waclawek
e3bfa4a70a Applied patch for bug # 620106. 2002-10-09 13:21:45 +00:00
Fred L. Drake, Jr.
f4befc31c3 SF bug #620343: segfault: bad API/callback interaction
The start-namespace-decl callback can set the start-element callback to
NULL, but Expat tried to call it anyway.
2002-10-08 17:04:55 +00:00
Fred L. Drake, Jr.
6fca489398 Bump version numbers. 2002-10-07 20:26:31 +00:00
Karl Waclawek
7edd98f770 Applied patch #618199. 2002-10-03 19:41:26 +00:00
Karl Waclawek
ea4dc4d03f Applied fix for bug #616863. 2002-10-01 16:58:54 +00:00
Karl Waclawek
8666c2388d Forgot to re-establish implicit namespace context (prefix xml)
in XML_ParserReset().
2002-09-30 12:11:26 +00:00
Karl Waclawek
74e6874851 Fix for bug #615606. 2002-09-28 14:47:34 +00:00
Karl Waclawek
5ca83cc911 Changed calling convention macros to differentiate between
different types of function calls - see comments in internal.h.
2002-09-20 03:42:43 +00:00
Fred L. Drake, Jr.
d784ead9cb A last-minute report suggests a problem with this using at least some
versions of egcs, so disable FASTCALL for GCC as well.  We are now not using
this for any platform.  ;-(
2002-09-06 21:49:57 +00:00
Fred L. Drake, Jr.
9bd525992b Disable FASTCALL on Windows since it turned out not to be as effective
as hoped.  Leaving the definition in the file so we'll know what it
was that didn't work, and hopefully find something better in the
future.
2002-09-06 21:29:46 +00:00
Karl Waclawek
633caf8040 Fred and I added FASTCALL directives to xmltok.c and related files. 2002-09-05 18:21:01 +00:00
Karl Waclawek
6483b5cbdd Make FASTCALL function pointer declaration compile under VC++. 2002-09-05 15:25:06 +00:00
Fred L. Drake, Jr.
858593e849 Use the FASTCALL macro for many of the internal functions. 2002-09-05 01:58:27 +00:00
Fred L. Drake, Jr.
ca524b2c69 Added new header for common internal definitions. These are all performance-
related at the moment.
2002-09-05 01:56:29 +00:00
Fred L. Drake, Jr.
ad0e1a943b Elaborate the XML_GetFeatureList() API a bit, and add additional info
that may be needed by a hughly flexible client.  (Or at least used to check
that the Expat that it links to matches client expectations.)
2002-09-05 01:48:26 +00:00
Karl Waclawek
c6160c2aee Added some comments regarding previous fix (bug #602729). 2002-08-31 02:27:20 +00:00
Karl Waclawek
fb523d10cc Fix bug reported by Rolf Ade:
CR at end of buffer in epilog causes memory access violation.
2002-08-30 23:22:20 +00:00
Fred L. Drake, Jr.
a759c51ca1 The strings returned as part of the XML_Feature structure should be of type
XML_LChar*, not XML_Char*.
2002-08-29 15:29:52 +00:00
Fred L. Drake, Jr.
e5cf509115 Revise the XML_GetFeatureList() function signature so that we maintain the
behavior that all strings returned from Expat are affected by the XML_UNICODE
and XML_UNICODE_WCHAR_T feature-test macros, and ensure that an application
that needs to determine what type of character data is returned can do so
with reasonable ease.
2002-08-29 04:54:04 +00:00
Fred L. Drake, Jr.
d9be20e8f0 Make the arg to XML_ErrorString() an XML_Error value. Compatible
since enums are binary compatible with ints.
2002-08-27 22:58:25 +00:00