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

1220 Commits

Author SHA1 Message Date
Nick Wellnhofer
30ef77554b parser: Don't use deprecated xmlCopyChar 2024-07-02 13:34:11 +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
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
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
044ddf07b9 parser: Undeprecate some parser context members 2024-06-29 01:22:15 +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
5cf5b542d9 SAX2: Deprecate xmlSAX2StartElement 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
4b6e68282b cmake: Stop using win32config.h
Move this file to the win32 subdirectory.
2024-06-22 18:41:00 +02:00
Nick Wellnhofer
84a4f84c1c build: Don't check for required headers and functions
Unless we are on Windows, the following POSIX headers are required.
They're part of the earliest POSIX specs and it doesn't make sense to
check for them.

- fcntl.h
- unistd.h
- sys/stat.h
- sys/time.h

On Windows, io.h, fcntl.h and sys/stat.h are always available.
2024-06-22 18:41:00 +02:00
Nick Wellnhofer
02326d72d3 build: Remove socklen_t checks
socklen_t has been mandated by POSIX for ages. Always use "socklen_t" or
"int" on Win32.
2024-06-22 00:40:40 +02:00
Nick Wellnhofer
c2ccbc0fed meson: Implement option dependencies
This also removes the FreeBSD hack.
2024-06-21 23:13:17 +02:00
Nick Wellnhofer
f9c33a5519 parser: Undeprecate some xmlParserInput members 2024-06-21 18:25:11 +02:00
Nick Wellnhofer
1228b4e0e7 parser: Deprecate xmlParserCtxt->lastError
We alredy have xmlCtxtGetLastError().
2024-06-21 18:22:04 +02:00
Nick Wellnhofer
f82ca02bf5 parser: Undeprecate some xmlParserCtxt members
These are essential for SAX parsers.
2024-06-21 18:17:11 +02:00
Mike Dalessio
bbbbbb4649 parser: implement xmlCtxtGetOptions
In 712a31ab, the `options` struct member was deprecated. To allow
callers to check the status of options bits, introduce
xmlCtxtGetOptions.
2024-06-20 20:39:54 +00: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
5fca9498fd doc: Hide internal macro 2024-06-16 19:56:08 +02:00
Nick Wellnhofer
33a1f8978d legacy: Merge SAX.c into legacy.c 2024-06-16 19:17:41 +02:00
Nick Wellnhofer
1341deac13 xmllint: Move shell to xmllint
Move source code for xmllint shell to shell.c and move it from the
libxml2 library to the xmllint executable.

Also allow shell to run without XPath and debug modules.

Add stubs for old shell API functions in legacy build mode.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
1b6403583b schemas: Stop using xmlValidateNotationUse
Simplify symbol availability logic.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
fa01278dcd regexp: Hide experimental legacy code
This was never made public.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
10d60d15d6 regexp: Stop using LIBXML_AUTOMATA_ENABLED
This macro always equals LIBXML_REGEXP_ENABLED.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
11c3f84b6c SAX2: Always make xmlSAX2{Start,End}Element public
Simplify symbol availability logic.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
f307237e14 schemas: Use private copy of global NaN and Inf
Simplify symbol availability logic.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
b0fc67aa22 build: Remove --with-tree configuration option
This option would allow for a smaller, but mostly useless minimal build.
But it complicates the symbol availability logic in an insane way and
requires specialized tools like our custom C parser in doc/apibuild.py.

See #717.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
4967277931 parser: Make XML_INPUT constants signed
Avoid conversion to unsigned which triggers (harmless) UBSan warnings.
2024-06-16 18:47:12 +02:00
Nick Wellnhofer
84666581c2 catalog: Fix initialization
Initialize mutex via xmlInitParser.

Fix some other initialization calls.
2024-06-15 21:15:26 +02:00
Nick Wellnhofer
208f27f964 include: Don't define ATTRIBUTE_UNUSED in public header
Stop polluting namespace with unprefixed names.
2024-06-15 19:13:08 +02:00
Nick Wellnhofer
387f0c784f include: Readd circular dependency between tree.h and parser.h
There are dozens of downstream projects that only include tree.h but use
declarations from parser.h. This broke after the recent cleanup of
circular dependencies.

Make tree.h include parser.h again. This is a hack but doesn't change
the include directory struture.

This commit only made it into the 2.12 branch but wasn't applied to
master, so the issue turned up in 2.13.0 again.

Should fix #734.
2024-06-15 16:27:54 +02:00
Nick Wellnhofer
bd208d5fe1 xinclude: Add another missing include 2024-06-15 01:40:06 +02:00
Jan Alexander Steffens (heftig)
599ceaffad
xinclude: Add missing include
Gambas fails to compile with

    error: 'xmlStructuredErrorFunc' has not been declared
2024-06-15 00:59:54 +02:00
Nick Wellnhofer
3b4a84e4b7 encoding: Deprecate xmlCharEncodingHandler members 2024-06-13 18:09:17 +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
1c1794964e xlink: Deprecate xlinkGetDefault*
These functions read an otherwise unused global and seem useless.
2024-06-12 19:55:47 +02:00
Nick Wellnhofer
046663bc54 xlink: Deprecate xlinkSetDefault*
These functions set an otherwise unused global and seem useless.
2024-06-12 19:43:22 +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
5238404325 parser: Pass resource type to resource loader 2024-06-12 16:36:12 +02:00