mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
Merge topic 'update-expat'
67c0de15bdMerge branch 'upstream-expat' into update-expat10c41e4e83expat 2026-11-02 (a70841d9)5077ff9935expat: Update script to get Expat 2.10.0 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !12762
This commit is contained in:
commit
3575332950
12 files changed
+872
-152
No files matched your search
@@ -8,7 +8,7 @@ readonly name="expat"
|
||||
readonly ownership="Expat Upstream <kwrobot@kitware.com>"
|
||||
readonly subtree="Utilities/cmexpat"
|
||||
readonly repo="https://github.com/libexpat/libexpat.git"
|
||||
readonly tag="R_2_9_0"
|
||||
readonly tag="R_2_10_0"
|
||||
readonly shortlog=false
|
||||
readonly exact_tree_match=false
|
||||
readonly paths="
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
> Thank you! :heart: :pray:
|
||||
|
||||
|
||||
# Expat, Release 2.9.0
|
||||
# Expat, Release 2.10.0
|
||||
|
||||
This is Expat, a C99 library for parsing
|
||||
[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2007 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017-2026 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
@@ -113,6 +113,7 @@
|
||||
#define ASCII_LT 0x3C
|
||||
#define ASCII_EQUALS 0x3D
|
||||
#define ASCII_GT 0x3E
|
||||
#define ASCII_QUEST 0x3F
|
||||
#define ASCII_LSQB 0x5B
|
||||
#define ASCII_RSQB 0x5D
|
||||
#define ASCII_UNDERSCORE 0x5F
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/* Internal helpers related to entities
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 2026 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#if ! defined(EXPAT_ENTITIES_H)
|
||||
# define EXPAT_ENTITIES_H 1
|
||||
|
||||
# include "expat_config.h" // for XML_GE
|
||||
# include "expat_external.h" // for XML_Char
|
||||
# include "internal.h" // for XML_NONTESTING_STATIC
|
||||
# include <stdbool.h> // for size_t
|
||||
# include <stddef.h> // for size_t
|
||||
|
||||
typedef struct {
|
||||
const XML_Char *name;
|
||||
const XML_Char *textPtr;
|
||||
size_t textLen; /* length in XML_Chars */
|
||||
size_t processed; /* # of processed bytes - when suspended */
|
||||
const XML_Char *systemId;
|
||||
const XML_Char *base;
|
||||
const XML_Char *publicId;
|
||||
const XML_Char *notation;
|
||||
bool open;
|
||||
bool hasMore; /* true if entity has not been completely processed */
|
||||
/* An entity can be open while being already completely processed (!hasMore).
|
||||
The reason is the delayed closing of entities until their inner
|
||||
entities are processed and closed */
|
||||
bool is_param;
|
||||
bool is_internal; /* true if declared in internal subset outside PE */
|
||||
# if XML_GE == 1
|
||||
/* Indirect accounting bytes charged when this entity is expanded: 1 per text
|
||||
character, plus each reference's "&name;"/"%name;" token length and its own
|
||||
expansion. Matches XML_ACCOUNT_ENTITY_EXPANSION, so it is not the
|
||||
replacement-text size. 0 means "not computed yet" (an empty entity is 0
|
||||
too, told apart by textLen == 0). */
|
||||
XmlBigCount expandedSize;
|
||||
bool beingAnalyzed; /* on the resolveEntityClosureExpandedSize depth-first
|
||||
search stack; used for cycle detection */
|
||||
const XML_Char
|
||||
*scanPtr; /* cursor position into the entity's replacement text; NULL when
|
||||
`textPtr` is NULL, else a pointer into the entity value,
|
||||
ranging from `.textPtr` to `.textPtr + .textLen`. */
|
||||
# endif /* XML_GE == 1 */
|
||||
} ENTITY;
|
||||
|
||||
# if XML_GE == 1
|
||||
/* How a scanEntityText call ended. */
|
||||
enum EntityScanResult {
|
||||
ENTITY_SCAN_COMPLETE, /* reached end of text; *expandedSize is final */
|
||||
ENTITY_SCAN_BLOCKED, /* stopped at a defined entity whose expanded
|
||||
size has not been computed yet; *blockerOut
|
||||
names the entity whose size to compute
|
||||
first */
|
||||
ENTITY_SCAN_OVERFLOW /* the expanded size would exceed XmlBigCount;
|
||||
callers must abort parsing */
|
||||
};
|
||||
|
||||
XML_NONTESTING_STATIC int isCDataCommentOrPIStart(const XML_Char *pos,
|
||||
size_t maxLen,
|
||||
size_t *openTextLen);
|
||||
|
||||
XML_NONTESTING_STATIC int isPredefinedEntityName(const XML_Char *name,
|
||||
size_t nameLen);
|
||||
|
||||
XML_NONTESTING_STATIC enum EntityScanResult
|
||||
scanEntityText(XML_Parser parser, ENTITY *entity, const XML_Char **posPtr,
|
||||
XmlBigCount *expandedSize, ENTITY **blockerOut);
|
||||
# endif /* XML_GE == 1 */
|
||||
|
||||
#endif // ! defined(EXPAT_ENTITIES_H)
|
||||
@@ -21,6 +21,7 @@
|
||||
Copyright (c) 2024 Taichi Haradaguchi <20001722@ymail.ne.jp>
|
||||
Copyright (c) 2025 Matthew Fernandez <matthew.fernandez@gmail.com>
|
||||
Copyright (c) 2026 Braian Plaku <braianplaku@gmail.com>
|
||||
Copyright (c) 2026 Xisco Fauli <xiscofauli@libreoffice.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
@@ -1084,7 +1085,7 @@ enum XML_Parser_Property {
|
||||
# if defined(XML_TESTING)
|
||||
XML_PROP_INVALID = 0,
|
||||
# endif
|
||||
# if XML_GE == 1
|
||||
# if defined(XML_GE) && XML_GE == 1
|
||||
XML_PROP_ALLOC_TRACKER_ACTIVATION_THRESHOLD = 1, // of type `uint64_t`
|
||||
XML_PROP_ALLOC_TRACKER_MAXIMUM_AMPLIFICATION = 2, // of type `double`
|
||||
XML_PROP_BILLION_LAUGHS_ACTIVATION_THRESHOLD = 3, // of type `uint64_t`
|
||||
@@ -1146,7 +1147,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
|
||||
See https://semver.org
|
||||
*/
|
||||
# define XML_MAJOR_VERSION 2
|
||||
# define XML_MINOR_VERSION 9
|
||||
# define XML_MINOR_VERSION 10
|
||||
# define XML_MICRO_VERSION 0
|
||||
|
||||
# ifdef __cplusplus
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016-2026 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
|
||||
Copyright (c) 2026 Matthew Fernandez <matthew.fernandez@gmail.com>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
Copyright (c) 2026 Matthew Wozniczka <mattheww@simba.com>
|
||||
Copyright (c) 2026 Braian Plaku <braianplaku@gmail.com>
|
||||
Copyright (c) 2026 Florian Schmaus <florian.schmaus@codasip.com>
|
||||
Copyright (c) 2026 Brooks Davis <brooks@one-eyed-alien.net>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
@@ -90,11 +91,10 @@
|
||||
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u"
|
||||
# endif
|
||||
# else
|
||||
# include <inttypes.h> // PRIdPTR, PRIuPTR
|
||||
# define EXPAT_FMT_LLX(midpart) "%" midpart "llx"
|
||||
# define EXPAT_FMT_ULL(midpart) "%" midpart "llu"
|
||||
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart PRIdPTR
|
||||
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart PRIuPTR
|
||||
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "td"
|
||||
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "zu"
|
||||
# endif
|
||||
|
||||
# ifndef UNUSED_P
|
||||
@@ -127,6 +127,8 @@ union expat_align {
|
||||
|
||||
# include "expat.h" // so we can use type XML_Parser below
|
||||
|
||||
typedef unsigned long long XmlBigCount;
|
||||
|
||||
void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
|
||||
const char **fromLimRef);
|
||||
|
||||
|
||||
@@ -88,3 +88,24 @@ xcsncmp(const XML_Char *a, const XML_Char *b, size_t len) {
|
||||
return strncmp(a, b, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
// A port of `strnstr(3bsd)` to `XML_Char`
|
||||
const XML_Char *
|
||||
xcsnstr(const XML_Char *haystack, const XML_Char *needle, size_t maxLen) {
|
||||
// NOTE: We are not calling `xcsnlen(haystack, maxLen)` because
|
||||
// `haystack` could be long and `xcsnlen` could be used in a loop
|
||||
// and we need to avoid quadratic runtime behavior.
|
||||
if (! *needle)
|
||||
return haystack; // i.e. empty needle is always a match
|
||||
const size_t needleLen = xcslen(needle);
|
||||
if (needleLen > maxLen)
|
||||
return NULL;
|
||||
const size_t maxTries = (maxLen - needleLen) + 1;
|
||||
for (size_t i = 0; i < maxTries && haystack[i]; i++) {
|
||||
if (haystack[i] == needle[0]
|
||||
&& xcsncmp(haystack + i, needle, needleLen) == 0) {
|
||||
return haystack + i;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -41,4 +41,7 @@ extern size_t xcslen(const XML_Char *s);
|
||||
extern int xcscmp(const XML_Char *a, const XML_Char *b);
|
||||
extern int xcsncmp(const XML_Char *a, const XML_Char *b, size_t len);
|
||||
|
||||
extern const XML_Char *xcsnstr(const XML_Char *haystack, const XML_Char *needle,
|
||||
size_t maxLen);
|
||||
|
||||
#endif // ! defined(EXPAT_XCS_H)
|
||||
+731
-138
File diff suppressed because it is too large.
Load diff
@@ -176,8 +176,8 @@ struct encoding {
|
||||
const char *);
|
||||
int (*nameLength)(const ENCODING *, const char *);
|
||||
const char *(*skipS)(const ENCODING *, const char *);
|
||||
int (*getAtts)(const ENCODING *enc, const char *ptr, int attsMax,
|
||||
ATTRIBUTE *atts);
|
||||
size_t (*getAtts)(const ENCODING *enc, const char *ptr, size_t attsMax,
|
||||
ATTRIBUTE *atts);
|
||||
int (*charRefNumber)(const ENCODING *enc, const char *ptr);
|
||||
int (*predefinedEntityName)(const ENCODING *, const char *, const char *);
|
||||
void (*updatePosition)(const ENCODING *, const char *ptr, const char *end,
|
||||
|
||||
@@ -1505,11 +1505,11 @@ PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
first attsMax attributes are stored in atts.
|
||||
*/
|
||||
|
||||
static int
|
||||
PREFIX(getAtts)(const ENCODING *enc, const char *ptr, int attsMax,
|
||||
static size_t
|
||||
PREFIX(getAtts)(const ENCODING *enc, const char *ptr, size_t attsMax,
|
||||
ATTRIBUTE *atts) {
|
||||
enum { other, inName, inValue } state = inName;
|
||||
int nAtts = 0;
|
||||
size_t nAtts = 0;
|
||||
int open = 0; /* defined when state == inValue;
|
||||
initialization just to shut up compilers */
|
||||
|
||||
|
||||
Reference in new issue
Block a user