1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00
Commit Graph

581 Commits

Author SHA1 Message Date
Nick Wellnhofer
70dc8ca03d xpath: Add extra info to some error messages
Fixes #660.
2025-06-27 18:54:18 +02:00
Nick Wellnhofer
6a6a46f017 doc: Fix autolink errors
Fix links, remove links to internal functions.
2025-05-28 16:02:41 +02:00
Nick Wellnhofer
7bd8d1d9cc doc: Prefix autolinks with '#'
Use `#func` instead of `func()` to ignore parameters and make all
autolinks work.
2025-05-28 16:01:52 +02:00
Nick Wellnhofer
7008740a96 parser: Consolidate scanning of XML Names
Use new productions by default.

Fixes #194.
Fixes #364.
See #707.
2025-05-19 19:58:33 +02:00
Nick Wellnhofer
adfbeb7e08 doc: Stop using *Ptr typedefs in documentation 2025-05-16 18:03:12 +02:00
Nick Wellnhofer
a40f36e7f2 include: Stop using *Ptr typedefs in public headers 2025-05-16 18:03:12 +02:00
Nick Wellnhofer
442c1903af doc: Fix some damage from automated conversions
Add some newlines, fix returns.
2025-05-11 20:29:25 +02:00
Nick Wellnhofer
9bbffec568 doc: Move brief to top, params to bottom of doc comments 2025-05-06 19:51:38 +02:00
Nick Wellnhofer
cb1635a642 doc: Use @since command 2025-05-02 19:05:25 +02:00
Nick Wellnhofer
e78e05c990 doc: Fix autolinks to functions
Unfortunately, autolinks in .c files aren't converted by Doxygen for
some reason.
2025-05-02 17:45:31 +02:00
Nick Wellnhofer
b76286de5a doc: Remove # character for autolinks 2025-05-02 17:41:26 +02:00
Nick Wellnhofer
f7c412874b doc: Remove more comment block headers 2025-05-02 17:41:26 +02:00
Nick Wellnhofer
e525564f65 doc: Remove empty lines at start of block
These lines were left over after automatic conversion.
2025-05-02 11:42:05 +02:00
Nick Wellnhofer
e549622bc5 doc: Convert documentation to Doxygen
Automated conversion based on a few regexes.
2025-05-01 23:23:42 +02:00
Nick Wellnhofer
69879da88f doc: Remove email addresses from documentation
Also remove authorship information from generated files, hash.c and
globals.c which were rewritten.
2025-05-01 23:23:42 +02:00
Nick Wellnhofer
61890e399d doc: Prepare for conversion to Doxygen
Fix many params in internal functions (not really necessary but Doxygen
warns about that in XML mode).

Fix formatting in a few corner cases that automatic conversion can't
handle.

Rearrange some DOC_DISABLE blocks.
2025-05-01 23:23:42 +02:00
Nick Wellnhofer
0bac84b1bd Add missing NULL checks to public API functions 2025-04-25 13:15:29 +02:00
Nick Wellnhofer
92d7b0cd90 xpath: Rename valuePush and valuePop 2025-03-05 12:24:38 +01:00
Nick Wellnhofer
03be993ce5 Use memcpy to avoid pointer cast warnings 2025-03-05 12:24:38 +01:00
Nick Wellnhofer
63dfcca670 fuzz: Reduce initial array size 2025-02-20 12:22:12 +01:00
Nick Wellnhofer
69b91da3a8 Revert "xpath: Make contextSize and proximityPosition default to 1"
This reverts commit afbc0a0405.
2025-02-13 20:20:17 +01:00
Nick Wellnhofer
9c16a153d8 Revert "include: Make most IS_* macros private"
This reverts commit 84a6c82ff8.
2025-02-13 20:20:17 +01:00
Nick Wellnhofer
3a1526a5f7 xpath: Don't raise OOM error on long names
Short-lived regression.
2025-02-10 19:32:32 +01:00
Nick Wellnhofer
5f1131dda5 xpath: Don't descend into OP_VALUE in debug dump
For some reason, its "ch1" value is invalid.
2025-01-17 20:10:46 +01:00
Nick Wellnhofer
ca81916023 include: Use intptr_t to cast between pointers and ints 2025-01-03 20:59:10 +01:00
Nick Wellnhofer
84a6c82ff8 include: Make most IS_* macros private
Macros like IS_DIGIT or IS_LETTER severely pollute the C namespace.
2024-12-21 20:01:30 +01:00
Nick Wellnhofer
b9feb81632 xpath: Check reallocations for overflow
Factor out node set reallocation.
2024-12-21 19:37:38 +01:00
Nick Wellnhofer
afbc0a0405 xpath: Make contextSize and proximityPosition default to 1
In the general case of processing a single node, these values should be
set to 1.
2024-12-21 16:57:39 +01:00
Nick Wellnhofer
e014cc570f xpath: Remove non-standard xf:escape-uri function
This undocumented function used an outdated namespace URI and is
unlikely to be used these days.
2024-12-21 16:55:35 +01:00
Nick Wellnhofer
bf5fcf6e64 xpath: Use separate static hash table for standard functions
This avoids registering standard functions when creating an XPath
context.

Lookup of extension functions is a bit slower now, but ultimately, all
function lookups should be moved to the compilation phase.
2024-12-21 16:55:35 +01:00
Nick Wellnhofer
459146140a xpath: Fix parsing of non-ASCII names
Fix a long-standing issue where QNames starting with a non-ASCII
character would be rejected. This became more visible after "streaming"
XPath evaluation was disabled since the latter handled non-ASCII names
correctly.

Fixes #818.
2024-11-05 12:30:44 +01:00
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
03f1bdd260 xpath: Make recursion check work with xmlXPathCompile
The check for maximum recursion depth required a parser context with an
xmlXPathContext which xmlXPathCompile didn't provide.

All other code should already set up or require an xmlXPathContext.
2024-09-13 20:59:47 +02:00
Nick Wellnhofer
5d36664fc9 memory: Deprecate xmlGcMemSetup 2024-07-16 17:42:10 +02:00
Nick Wellnhofer
be250b798f xpath: Remove union swap optimization
This would require locking to make it thread-safe.
2024-07-16 17:42:10 +02:00
Nick Wellnhofer
a221cd7849 buf: Rework xmlBuf code
Always use what the old implementation called the "IO" allocation
scheme, allowing to move the content pointer past the initial
allocation. This is inexpensive and allows efficient shrinking.

Optimize xmlBufGrow, reusing shrunken memory as much as possible.

Simplify xmlBufAdd.

Make xmlBufBackToBuffer return an error on overflow.

Make "size" exclude the terminating NULL byte.

Always provide an initial size.

Reintroduce static buffers.

Remove xmlBufResize and several other functions.
2024-07-16 17:42:10 +02:00
Nick Wellnhofer
6be79014d7 Remove unused code 2024-07-15 16:33:38 +02:00
Nick Wellnhofer
30ef77554b parser: Don't use deprecated xmlCopyChar 2024-07-02 13:34:11 +02:00
Nick Wellnhofer
598ee0d2c6 error: Remove underscores from xmlRaiseError 2024-06-27 14:43:10 +02:00
Rosen Penev
217e9b7af2 clang-tidy: don't return in void functions
Found with readability-redundant-control-flow

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-20 20:37:34 +00: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
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
e75e878e02 doc: Update and fix documentation 2024-05-20 14:23:39 +02:00
Nick Wellnhofer
8d215ac5cc xpath: Fix quadratic runtime accounting 2024-05-14 15:55:18 +02:00
Nick Wellnhofer
63ce5f9aed Make some globals const 2024-04-28 17:53:39 +02:00
Nick Wellnhofer
20b0bd9800 fuzz: Account for quadratic runtime in xmlXPathTranslateFunction
Avoid fuzzer timeouts caused by this known issue.
2024-04-09 18:00:13 +02:00
Nick Wellnhofer
047ea3ecb3 Revert "tree: Allocate XML namespace statically"
This reverts commit 2840e33c5e.
2024-03-17 21:04:40 +01:00
Nick Wellnhofer
05adfbf880 buf: Don't use default buffer size for small strings
Detaching strings from a buffer with a default size of 4096 can waste
a lot of memory.
2024-03-15 19:47:08 +01:00
Nick Wellnhofer
2840e33c5e tree: Allocate XML namespace statically 2024-03-15 19:47:07 +01:00
Nick Wellnhofer
2963a097b9 xpath: Report malloc failure in xmlXPathTranslateFunction 2024-02-05 15:35:54 +01:00