185 Commits

Author SHA1 Message Date
Nick Wellnhofer
696572248f globals: Remove unused globals
- xmlBufferAllocScheme
- xmlDefaultBufferSize
- xmlParserDebugEntities
2025-03-05 12:24:38 +01:00
Nick Wellnhofer
92d7b0cd90 xpath: Rename valuePush and valuePop 2025-03-05 12:24:38 +01:00
Nick Wellnhofer
3250a01dc2 error: Convert initGenericErrorDefaultFunc to macro 2025-03-04 16:53:59 +01:00
Nick Wellnhofer
c42b32277d parser: Convert inputPush and inputPop to macros 2025-03-04 16:53:28 +01:00
Nick Wellnhofer
361f7bff92 parser: Make nodePush, nodePop, namePush, namePop private 2025-03-04 16:47:14 +01:00
Nick Wellnhofer
0b27097a92 encoding: Rename unprefixed public functions 2025-03-04 16:46:53 +01:00
Nick Wellnhofer
e50d314a27 build: Add separate configuration option for RELAX NG
Support for RELAX NG used to be enabled together with XML Schema support
(--with-schemas). Now there's a separate option and a new feature macro
LIBXML_RELAXNG_ENABLED.
2025-03-01 15:18:20 +01:00
Nick Wellnhofer
0cf25b3de2 Regenerate docs and testapi.c 2024-12-26 21:06:09 +01:00
Nick Wellnhofer
8af55c8d20 parser: Rename new input API functions
These weren't made public yet.
2024-07-11 01:33:29 +02:00
Nick Wellnhofer
4f329dc524 parser: Implement xmlCtxtParseContent
This implements xmlCtxtParseContent, a better alternative to
xmlParseInNodeContext or xmlParseBalancedChunkMemory. It accepts a
parser context and a parser input, making it a lot more versatile.

xmlParseInNodeContext is now implemented in terms of
xmlCtxtParseContent. This makes sure that xmlParseInNodeContext never
modifies the target document, improving thread safety.
xmlParseInNodeContext is also more lenient now with regard to undeclared
entities.

Fixes #727.
2024-07-11 01:26:32 +02:00
Nick Wellnhofer
673ca0edaf tests: Regenerate testapi.c 2024-07-11 01:23:57 +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
f4e63f7a4f Regenerate libxml2-api.xml and testapi.c 2024-06-27 15:17:40 +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
5a9a0e6fe6 testapi: Don't test xmlunicode functions 2024-06-17 15:47:42 +02: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
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
7b65c90f2a Regenerate libxml2-api.xml and testapi.c 2024-06-16 18:47:12 +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
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
d3fafde7de test: Update testapi.c 2024-06-12 13:57:21 +02:00
Nick Wellnhofer
5c55332591 Revert "tree: Only allow elements in xmlDocSetRootElement"
This reverts commit 4b698dbaec9bc6775fc8341ef8a3f0d8321f8548.

lxml assumes that xmlDocSetRootElement works with non-elements.
2024-03-29 15:29:53 +01:00
Nick Wellnhofer
4196454818 tree: Rework xmlTextMerge
Return NULL on error. Check for malloc failure. Check that nodes are
distinct.
2024-03-15 19:47:07 +01:00
Nick Wellnhofer
4b698dbaec tree: Only allow elements in xmlDocSetRootElement 2024-03-15 19:47:06 +01:00
Nick Wellnhofer
f19a95108a parser: Report malloc failures
Fix many places where malloc failures aren't reported.

Make xmlErrMemory public. This is useful for custom external entity
loaders.

Introduce new API function xmlSwitchEncodingName.

Change the way how we store whether the the parser is stopped. This used
to be signaled by setting ctxt->instate to XML_PARSER_EOF which was
misdesigned and error-prone. Set ctxt->disableSAX to 2 instead and
introduce a macro PARSER_STOPPED. Also stop to remove parser inputs in
xmlHaltParser. This allows to remove many checks of ctxt->instate.

Introduce xmlErrParser to handle errors if a parser context is
available.
2023-12-11 22:13:05 +01:00
Nick Wellnhofer
f5d4d33bfa tests: Regenerate testapi.c 2023-11-23 15:39:30 +01:00
makise-homura
19b9c59b61 Regenerate testapi.c 2023-11-22 05:34:56 +00:00
Nick Wellnhofer
f92ea2ccec tests: Fix build with older MSVC
Regressed in 9b5cce7a.

Fixes #620.
2023-11-18 14:36:41 +01:00
Nick Wellnhofer
c682089421 tests: Regenerate testapi.c 2023-11-04 19:32:48 +01:00
Nick Wellnhofer
61034116d0 error: Make more xmlError structs constant
Prepare for future changes, see 45470611.
2023-10-24 15:02:36 +02:00
Nick Wellnhofer
6eb2a00da4 tests: Update testapi.c 2023-09-21 22:58:02 +02:00
Nick Wellnhofer
9fc5090c05 hash: Clean up libxml/hash.h
Rename variables, fix subincludes, whitespace.
2023-09-21 14:47:25 +02:00
Nick Wellnhofer
9b5cce7a71 include: Remove more unnecessary includes 2023-09-21 01:50:53 +02:00
David Kilzer
5f54bac9eb testapi: test_xmlSAXDefaultVersion() leaves xmlSAX2DefaultVersionValue set to 1 with LIBXML_SAX1_ENABLED
Add code to save and to restore the default value of
xmlSAX2DefaultVersionValue.

Fixes #554.
2023-06-10 10:55:38 -07:00
Nick Wellnhofer
cb8ccb1078 testapi: Don't set http_proxy environment variable
We already disable network access, so this has no effect.
2023-05-25 03:17:45 +02:00
Nick Wellnhofer
886bf4e63b Stop calling xmlMemoryDump
This was used to check for memory leaks but could potentially create a
.memdump file. These days, there are better ways to check for memory
leaks.
2023-04-30 15:48:41 +02:00
Nick Wellnhofer
6e12409b33 Regenerate docs and testapi.c 2023-04-26 21:22:17 +02:00
Nick Wellnhofer
25ea7b6aa0 testapi.c: Initialize catalog early
Avoid leak reports when testing --with-mem-debug.
2022-12-08 19:44:09 +01:00
Nick Wellnhofer
eaebf37fb6 gentest.py: Fix memory leak in API tests
Regressed in commit ff34ba3e.
2022-12-08 19:18:10 +01:00
Nick Wellnhofer
b0556e1449 testapi: Disable on Windows for now
It's incredibly slow for some reason.
2022-09-04 20:27:21 +02:00
Nick Wellnhofer
b218abce43 Don't create missing.xml when running testapi
Side effect of b31e07db. Use a non-existing directory to avoid creating
a file.
2022-08-26 02:52:17 +02:00
Nick Wellnhofer
0f568c0b73 Consolidate private header files
Private functions were previously declared

- in header files in the root directory
- in public headers guarded with IN_LIBXML
- in libxml.h
- redundantly in source files that used them.

Consolidate all private header files in include/private.
2022-08-26 02:11:56 +02:00
Nick Wellnhofer
34a050cdee Move some HTML functions to correct header file 2022-08-24 16:44:39 +02:00