1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00
Commit Graph

6828 Commits

Author SHA1 Message Date
Nick Wellnhofer
751ba00e00 parser: Don't use deprecated xmlSwitchInputEncoding 2024-07-02 13:34:04 +02:00
Nick Wellnhofer
9a4770ef84 doc: Improve documentation 2024-07-02 13:34:04 +02:00
Nick Wellnhofer
0b0dd98983 parser: Fix EBCDIC detection 2024-07-01 18:05:40 +02:00
Nick Wellnhofer
37a9ff11d8 encoding: Simplify xmlCharEncCloseFunc 2024-07-01 18:05:40 +02:00
Nick Wellnhofer
1167c3340e encoding: Don't include iconv.h from libxml/encoding.h 2024-07-01 18:05:40 +02:00
Nick Wellnhofer
95d3633350 encoding: Rework conversion error codes
This should match the old code more closely. Remove XML_ERR_PARTIAL.

It's unlikely that anyone is using these codes already.
2024-07-01 18:05:40 +02:00
Nick Wellnhofer
dd8e378513 HTML: Rework UTF8ToHtml
Optimize code. Check for XML_ENC_ERR_SPACE. Use error macros.
2024-07-01 18:05:40 +02:00
Nick Wellnhofer
30be984a0f encoding: Rework ISO-8859-X conversion
Optimize code. Pass tables as context parameter. Check for
XML_ENC_ERR_SPACE.
2024-07-01 18:05:40 +02:00
Nick Wellnhofer
282ec1d548 encoding: Rework xmlCharEncodingHandler layout
Reuse some of the old members.

The "input" and "output" function pointers are actually of type
xmlCharEncConvFunc, accepting an additional argument. For default
handlers, this argument is unused, so this should work with most ABIs.
For iconv handlers, these function pointers used to be NULL but now
point to a function which requires the extra argument.

"iconv_in" and "iconv_out" are made void pointers. "uconv_in" and
"uconv_out" are renamed and made void pointers. This is unlikely to
cause issues.

We now expect that the built-in conversion functions correctly report
XML_ENC_ERR_SPACE. For UTF8ToHtml and the ISO-8859-X code, this will be
done in the following commits.
2024-07-01 18:05:40 +02:00
Nick Wellnhofer
57e37dff4e encoding: Rework UTF-16 conversion functions
Optimize UTF-16 conversion functions. Avoid misaligned memory access.
Don't rely on 'sizeof(short) == 2'. Check for XML_ENC_ERR_SPACE. Add
some tests for UTF-16 conversion.
2024-07-01 18:05:40 +02:00
Nick Wellnhofer
bb8e81c788 encoding: Rework simple conversions function
Use a single function for ASCII conversion. Optimize code. Check for
XML_ENC_ERR_SPACE.
2024-07-01 18:05:40 +02:00
Nick Wellnhofer
501e5d195d encoding: Stop using XML_ENC_ERR_PARTIAL 2024-07-01 18:05:40 +02:00
Nick Wellnhofer
221df37529 parser: Support custom charset conversion implementations
Implement xmlCtxtSetCharEncConvImpl. I agree that the name is terrible.
2024-07-01 18:05:40 +02:00
Nick Wellnhofer
c59c24494d encoding: Support custom implementations 2024-07-01 18:05:40 +02:00
Nick Wellnhofer
1e3da9f4d4 encoding: Start with callbacks 2024-07-01 18:05:40 +02:00
Nick Wellnhofer
6d8427dc97 encoding: Rework encoding lookup
Add missing xmlCharEncoding enum values.

Simplify and speed up encoding lookup by using a table mapping names to
xmlCharEncoding enums and binary search. Rearrange the default handler
table to match the enum layout.

For some encodings we now only lookup the provided or most canonical
name instead of trying several names, expecting that iconv or ICU handle
aliases:

- IBM037 (EBCDIC)
- UCS-2
- UCS-4
- Shift_JIS
2024-07-01 18:05:40 +02:00
Nick Wellnhofer
16e7ecd478 xinclude: Check URI length
Don't report long URIs as OOM errors.
2024-07-01 18:03:06 +02:00
Nick Wellnhofer
37f7237050 xmllint: Fix unsigned integer overflow
Short-lived regression.
2024-07-01 18:03:06 +02:00
Nick Wellnhofer
64b0c64ed6 cmake: Don't install man pages if LIBXML2_WITH_PROGRAMS=OFF 2024-07-01 18:03:06 +02:00
Chun-wei Fan
a24b08bf40 meson: Don't always assume PThreads when using threads
The libxml2 code has support for Windows threads as well, so use these
instead on Windows when building threads support,
2024-07-01 15:47:29 +08:00
Nick Wellnhofer
64685e9812 autotools: Remove NON_PC_LIBS
Improves modularization.
2024-06-29 01:22:42 +02:00
Nick Wellnhofer
044ddf07b9 parser: Undeprecate some parser context members 2024-06-29 01:22:15 +02:00
Nick Wellnhofer
e72eda101e parser: Add NULL check in xmlNewIOInputStream 2024-06-29 01:22:02 +02:00
Nick Wellnhofer
bc793390d5 parser: Update documentation 2024-06-27 16:23:14 +02:00
Nick Wellnhofer
f4e63f7a4f Regenerate libxml2-api.xml and testapi.c 2024-06-27 15:17:40 +02:00
Nick Wellnhofer
193f4653a5 parser: Implement xmlCtxtGetStatus
This allows access to ctxt->wellFormed, ctxt->nsWellFormed and
ctxt->valid. It also detects several fatal non-parser errors which
really should be another error level.
2024-06-27 15:17:40 +02:00
Nick Wellnhofer
f505dcaea0 tree: Remove underscores from xmlRegisterCallbacks 2024-06-27 14:45:35 +02:00
Nick Wellnhofer
cc0cc2d3b7 parser: Add more parser context accessors 2024-06-27 14:45:33 +02:00
Nick Wellnhofer
8b1f79cea0 SAX2: Make xmlSAXDefaultVersion a no-op 2024-06-27 14:44:55 +02:00
Nick Wellnhofer
5cf5b542d9 SAX2: Deprecate xmlSAX2StartElement 2024-06-27 14:44:55 +02:00
Nick Wellnhofer
71eb710914 xmllint: Switch to xmlCtxtSetErrorHandler 2024-06-27 14:44:55 +02:00
Nick Wellnhofer
c5750fc6a7 python: Switch to xmlCtxtSetErrorHandler 2024-06-27 14:44:55 +02:00
Nick Wellnhofer
eca972e682 parser: Add getters for XML declaration to parser context
Access to struct members will be deprecated.
2024-06-27 14:44:49 +02:00
Nick Wellnhofer
598ee0d2c6 error: Remove underscores from xmlRaiseError 2024-06-27 14:43:10 +02:00
Nick Wellnhofer
3ff8a2c4b8 parser: Deprecate xmlIsLetter 2024-06-27 14:43:10 +02:00
Nick Wellnhofer
fa50be923b parser: Move implementation of xmlCtxtGetLastError 2024-06-27 14:37:53 +02:00
Nick Wellnhofer
7c11da2d98 tests: Clarify licence of test/intsubset2.xml 2024-06-27 12:49:06 +02:00
Nick Wellnhofer
b1a416bf52 encoding: Restore old lookup order in xmlOpenCharEncodingHandler
When looking up encodings with xmlLookupCharEncodingHandler, the
returned handler can have a different name than requested
(capitalization, internal aliases). This should eventually be fixed.
For now we revert part of commit 5b893fa9, start the lookup with
xmlFindHandler and add an explicit check for UTF-8.

Should fix the encoding name issue mentioned in #749.
2024-06-27 12:34:45 +02:00
Nick Wellnhofer
e6f25fdc7c uri: Fix documentation of xmlBuildRelativeURI 2024-06-27 11:55:33 +02:00
Nick Wellnhofer
c195f06fac autotools: Use AX_GCC_FUNC_ATTRIBUTE from autoconf archives 2024-06-25 22:19:47 +02:00
Nick Wellnhofer
1afaa37128 build: Move definition of ATTRIBUTE_DESTRUCTOR to libxml.h 2024-06-25 22:06:36 +02:00
Nick Wellnhofer
fd099dd8dc autotools: Fix pkg.m4 check 2024-06-24 20:37:39 +02:00
Nick Wellnhofer
c4d8343b7c encoding: Make xmlFindCharEncodingHandler return UTF-8 handler
xmlFindCharEncodingHandler must always return a handler.

Remove UTF-8 handler from default handler list.

Fixes 5b893fa9.
2024-06-24 20:08:27 +02:00
Nick Wellnhofer
54c6c7e416 uri: Only set file scheme for special Windows paths
Fixes 2ce70cde.

Also fix a test case.
2024-06-24 20:08:27 +02:00
Sam James
ec47add47c configure.ac: fix bashisms
'==' is a bashism, so use the POSIX '=' instead.
2024-06-24 17:27:50 +00:00
correctmost
c14c20f5ce doc: Add note about meson.build version bump 2024-06-23 18:52:44 -04:00
Nick Wellnhofer
2ce70cde46 uri: Handle filesystem paths in xmlBuildRelativeURISafe
This mainly fixes issues on Windows but should also fix a few general
corner cases.

Should fix #745.
2024-06-23 21:48:16 +02:00
Nick Wellnhofer
7655ed2cc0 cmake: Implement dependent options
This should make sure that configurations are valid but doesn't warn
about invalid configurations.

CMake only supports boolean options and I have no idea how features
like "minimal" or "legacy" that change default values of other options
could be supported.

Fixes #551.
2024-06-23 21:48:16 +02:00
Daniel E
600c6ca4bc cmake: Don't install meson build scripts in documentation
Add meson.build files as exclusions
2024-06-23 12:16:47 +00:00
Nick Wellnhofer
28b9bb0309 uri: Enable Windows paths on Cygwin 2024-06-22 22:07:45 +02:00