1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-23 17:33:50 +03:00
Commit Graph

503 Commits

Author SHA1 Message Date
Nick Wellnhofer
c46b89e243 xpath: Deprecate xmlXPathEvalExpr
Also check the argument instead of crashing if there's no context.
2024-09-13 21:06:36 +02:00
Nick Wellnhofer
40abebbc73 python: Fix SAX driver with character streams
This apparently broke with Python 3.5 which introduced character
streams.

Fixes #790.
2024-08-29 01:31:26 +02:00
Nick Wellnhofer
eb66d03ef7 io: Deprecate a few functions 2024-07-16 17:42:10 +02:00
Nick Wellnhofer
69f12d6d47 encoding: Deprecate xmlByteConsumed
This was only used by Chromium/WebKit to detect whether xmlParseContent
really succeeded. It's a horrible, overcomplicated hack.

See 8c5848bd and #767.
2024-07-13 15:42:02 +02:00
Nick Wellnhofer
ec0881099b parser: Upgrade XML_IO_NETWORK_ATTEMPT to error
Fixes XML::LibXML test suite.
2024-07-04 15:47:20 +02:00
Nick Wellnhofer
30ef77554b parser: Don't use deprecated xmlCopyChar 2024-07-02 13:34:11 +02:00
Nick Wellnhofer
cc0cc2d3b7 parser: Add more parser context accessors 2024-06-27 14:45:33 +02:00
Nick Wellnhofer
c5750fc6a7 python: Switch to xmlCtxtSetErrorHandler 2024-06-27 14:44:55 +02:00
Nick Wellnhofer
3ff8a2c4b8 parser: Deprecate xmlIsLetter 2024-06-27 14:43:10 +02:00
Nick Wellnhofer
c2ccbc0fed meson: Implement option dependencies
This also removes the FreeBSD hack.
2024-06-21 23:13:17 +02:00
Rosen Penev
5d542feff1 libxml: define ATTRIBUTE_UNUSED for clang
Silences warnings under Clang on Windows.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-20 15:24:15 -07:00
Nick Wellnhofer
1112699cfa legacy: Remove most legacy functions from public headers
Also remove warning messages.
2024-06-17 15:47:42 +02:00
Nick Wellnhofer
2608baaf92 parser: Make failure to load main document a warning
Revert the change that made failures to load the main document an error.

This fixes the --path option of xmllint and xsltproc.

Should fix #733.
2024-06-14 20:06:07 +02:00
Nick Wellnhofer
b34dc1e4a3 tree: Deprecate xmlBuffer members 2024-06-13 18:09:17 +02:00
Nick Wellnhofer
712a31abe4 parser: Deprecate most public struct members
This will probably cause many warnings in downstream code abusing
libxml2 internals, but we can always undeprecate some members later.
2024-06-13 18:04:34 +02:00
Nick Wellnhofer
669bd34993 xpointer: Remove support for XPointer locations
The latest spec for what it essentially an XPath extension seems to be
this working draft from 2002:

    https://www.w3.org/TR/xptr-xpointer/

The xpointer() scheme is listed as "being reviewed" in the XPointer
registry since at least 2006. libxml2 seems to be the only modern
software that tries to implement this spec, but the code has many bugs
and quality issues.

If you configure --with-legacy, old symbols are retained for ABI
compatibility.
2024-06-12 18:20:01 +02:00
Nick Wellnhofer
dba1ed85a3 ftp: Remove FTP support
Remove the built-in FTP client. If you configure --with-legacy, old
symbols are retained for ABI compatibility.
2024-06-12 18:19:55 +02:00
Nick Wellnhofer
1b1e8b3c12 io: Stop invoking generic error handler for IO errors 2024-06-12 16:14:15 +02:00
Rosen Penev
f227086380 meson: convert boolean options to feature option
Simpler. Seems like they're only disabled by minimum.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-06 17:13:41 -07:00
Nick Wellnhofer
1ae68e40df python: Fix build with disabled modules 2024-06-06 22:55:15 +02:00
Nick Wellnhofer
bd7cafdbce meson: Add some TODO comments 2024-05-20 23:59:55 +02:00
Nick Wellnhofer
592546267f threads: Deprecate remaining ThrDef functions 2024-05-14 15:44:50 +02:00
Nick Wellnhofer
fdc5ff3657 parser: Always throw entity errors if external DTD is loaded
When parsing with XML_PARSE_DTDLOAD, missing entities are always an
error.

Also consolidate behavior when validating. See b717abdd.
2024-05-03 11:52:54 +02:00
Nick Wellnhofer
ae23a4ce56 unicode: Deprecate most xmlUCSIs* functions
These don't seem to be used by downstream code.
2024-04-30 17:42:59 +02:00
Nick Wellnhofer
bffef46c4c doc: Don't install example code 2024-04-28 22:58:06 +02:00
Nick Wellnhofer
1cdfece12b memory: Remove memory debugging
This is useless compared to sanitizers or valgrind and has a
considerable performance impact if enabled accidentally.
2024-04-28 20:42:55 +02:00
Nick Wellnhofer
88169bfda6 tree: Deprecate xmlSetCompressMode 2024-04-28 19:30:39 +02:00
Nick Wellnhofer
05654cfe00 html: Deprecate htmlHandleOmittedElem 2024-04-28 18:58:27 +02:00
Nick Wellnhofer
b717abdd09 parser: Consolidate error handling for undeclared entities
Always use XML_WAR_UNDECLARED_ENTITY with warning error level in
documents with external subset or parameter entities. Use
XML_ERR_UNDECLARED_ENTITY otherwise.
2024-04-23 18:36:15 +02:00
Vincent Torri
5732ce56f3 meson: Initial commit 2024-04-04 12:23:39 +02:00
Nick Wellnhofer
dc2a03d482 valid: Deprecate internal validation functions 2024-03-16 15:20:08 +01:00
Nick Wellnhofer
67e475b78e http: Improve error message for HTTPS redirects 2024-02-19 11:09:39 +01:00
Nick Wellnhofer
63986c45b9 parser: Report fatal error if document entity couldn't be loaded
Only lower error level when loading entities.

Fixes #667.
2024-01-22 21:07:41 +01:00
Nick Wellnhofer
e8fb3d639f parser: Convert some "internal errors" to meaningful codes 2024-01-02 19:48:23 +01:00
Nick Wellnhofer
e45a4d7115 io: Always forward IO errors to global handler
The HTTP module raises errors without context. This won't be fixed,
so send them to the global error handler.
2023-12-29 01:22:13 +01:00
Nick Wellnhofer
d944a41515 parser: Fix in-parameter-entity and in-external-dtd checks
Use in ctxt->input->entity instead of ctxt->inputNr to determine whether
we are inside a parameter entity.

Stop using ctxt->external to check whether we're in an external DTD.
This is signaled by ctxt->inSubset == 2.
2023-12-29 01:19:56 +01:00
Nick Wellnhofer
955c177f69 parser: Stop using 'directory' struct member
This was only used as a pointless fallback for URI resolution.
2023-12-25 23:38:40 +01:00
Nick Wellnhofer
60841beba6 parser: Make XML_IO_NETWORK_ATTEMPT behave as before
Always reported to generic error, not to parser context for backward
compatibility. Several downstream test suites rely on this behavior.
2023-12-25 23:38:40 +01:00
Nick Wellnhofer
229e5ff7f9 io: Remove support for HTTP POST
This feature is unlikely to be used these days.
2023-12-24 22:11:49 +01:00
Nick Wellnhofer
1ef3566362 io: Always use unbuffered input
Before, we often used unbuffered input via the lzma or gzip handlers,
more or less inadvertently.

Change the default file handlers from buffered (stdc FILE) to unbuffered
(POSIX fds).
2023-12-21 15:02:24 +01:00
Nick Wellnhofer
7e511f35f1 io: Pass error codes from xmlFileOpenReal to xmlNewInputFromFile
This allows to report the reason why opening a file failed to the parser
context and improve error messages. Now we can also remove the stat call
before opening a file.
2023-12-21 15:02:24 +01:00
Nick Wellnhofer
b2dbcc432b io: Rework default callbacks
Register a dummy callback struct for default callbacks. Handle them in a
separate function which will later allow to return meaningful error
codes.
2023-12-21 15:02:24 +01:00
Nick Wellnhofer
c5a8aef2f6 error: Refactor error reporting
Introduce xmlStrVASPrintf, trying to handle buggy snprintf
implementations.

Introduce xmlSetError to set errors atomically.

Introduce xmlUpdateError to set an error, fixing up node, file and line.

Introduce helper function xmlRaiseMemoryError.

Make legacy error handlers call xmlReportError, avoiding checks in
xmlVRaiseError.

Remove fragile support for getting file and line info from XInclude
nodes.
2023-12-21 02:46:27 +01:00
Nick Wellnhofer
d6812f3a48 Fix compiler warnings with disabled modules 2023-12-14 13:37:03 +01:00
Nick Wellnhofer
0e201722e4 python: Fix callback signature
Found with UBSan.
2023-12-13 15:52:29 +01:00
Nick Wellnhofer
aca16fb3d4 tree: Report malloc failures
Fix many places where malloc failures aren't reported.

Make some API function return an error code. Changing the return type
from void to int is technically an ABI break but should be safe on most
platforms.

- xmlNodeSetContent
- xmlNodeSetContentLen
- xmlNodeAddContent
- xmlNodeAddContentLen
- xmlNodeSetBase

Introduce new API functions that return a separate error code if a
memory allocation fails.

- xmlNodeGetAttrValue
- xmlNodeGetBaseSafe
- xmlGetNsListSafe

Introduce private functions xmlTreeEnsureXMLDecl and xmlSplitQName4.

Don't report low-level errors to the global error handler.

Fix tree

Introduce xmlGetNsListSafe

Fix tree
2023-12-11 22:13:05 +01:00
Nick Wellnhofer
1c7f4c70fe nanohttp: Deprecate public API
The long-term plan is to remove the built-in HTTP client. There are
still a few downstream projects that use libxml2's client for other
purposes. These users should get deprecation warnings now.
2023-11-27 13:43:06 +01:00
Nick Wellnhofer
7d6969d955 Remove Trio
Trio is a rather old cross-platform printf library which was bundled with
libxml2. It was needed for ancient pre-C99 systems without snprintf and
should be safe to remove these days.
2023-11-23 15:48:52 +01:00
makise-homura
6bc86405d1 Avoid EDG deprecation warnings for LCC compiler 2023-11-22 05:34:56 +00:00
Nick Wellnhofer
56944c517f python: Make sure to distribute new files
Add pyproject.toml and tests/setup_test.py to Makefile.am.
2023-11-04 19:32:07 +01:00