1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-24 06:50:08 +03:00

Revert "include: Make most IS_* macros private"

This reverts commit 84a6c82ff83d04963d6e1c5cd18ded68ea02d99f.
This commit is contained in:
Nick Wellnhofer 2025-02-13 18:41:33 +01:00
parent 6c716d491d
commit 9c16a153d8
16 changed files with 172 additions and 29 deletions

View File

@ -26,7 +26,6 @@
#include "private/buf.h"
#include "private/error.h"
#include "private/io.h"
#include "private/parser.h"
#include "private/save.h"
/************************************************************************

View File

@ -41,7 +41,6 @@
#include "private/buf.h"
#include "private/error.h"
#include "private/memory.h"
#include "private/parser.h"
#include "private/threads.h"
#define MAX_DELEGATE 50

View File

@ -24,7 +24,6 @@
#include <libxml/xmlerror.h>
#include "private/error.h"
#include "private/parser.h"
#define DUMP_TEXT_TYPE 1

View File

@ -1142,8 +1142,6 @@ xmlIconvFree(void *vctxt) {
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \
defined(__GLIBC__)
#include "private/parser.h"
static int
xmlEncodingMatch(const char *name1, const char *name2) {
/*

View File

@ -28,7 +28,6 @@
#include "private/entities.h"
#include "private/error.h"
#include "private/parser.h"
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t) -1)

View File

@ -91,6 +91,42 @@ XMLPUBVAR const unsigned int xmlParserMaxDepth;
*/
#define XML_MAX_NAMELEN 100
/************************************************************************
* *
* UNICODE version of the macros. *
* *
************************************************************************/
/**
* IS_BYTE_CHAR:
* @c: an byte value (int)
*
* Macro to check the following production in the XML spec:
*
* [2] Char ::= #x9 | #xA | #xD | [#x20...]
* any byte character in the accepted range
*/
#define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
/**
* IS_CHAR:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
* | [#x10000-#x10FFFF]
* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
*/
#define IS_CHAR(c) xmlIsCharQ(c)
/**
* IS_CHAR_CH:
* @c: an xmlChar (usually an unsigned char)
*
* Behaves like IS_CHAR on single-byte value
*/
#define IS_CHAR_CH(c) xmlIsChar_ch(c)
/**
* IS_BLANK:
* @c: an UNICODE value (int)
@ -109,6 +145,142 @@ XMLPUBVAR const unsigned int xmlParserMaxDepth;
*/
#define IS_BLANK_CH(c) xmlIsBlank_ch(c)
/**
* IS_BASECHAR:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [85] BaseChar ::= ... long list see REC ...
*/
#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
/**
* IS_DIGIT:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [88] Digit ::= ... long list see REC ...
*/
#define IS_DIGIT(c) xmlIsDigitQ(c)
/**
* IS_DIGIT_CH:
* @c: an xmlChar value (usually an unsigned char)
*
* Behaves like IS_DIGIT but with a single byte argument
*/
#define IS_DIGIT_CH(c) xmlIsDigit_ch(c)
/**
* IS_COMBINING:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [87] CombiningChar ::= ... long list see REC ...
*/
#define IS_COMBINING(c) xmlIsCombiningQ(c)
/**
* IS_COMBINING_CH:
* @c: an xmlChar (usually an unsigned char)
*
* Always false (all combining chars > 0xff)
*/
#define IS_COMBINING_CH(c) 0
/**
* IS_EXTENDER:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 |
* #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] |
* [#x309D-#x309E] | [#x30FC-#x30FE]
*/
#define IS_EXTENDER(c) xmlIsExtenderQ(c)
/**
* IS_EXTENDER_CH:
* @c: an xmlChar value (usually an unsigned char)
*
* Behaves like IS_EXTENDER but with a single-byte argument
*/
#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c)
/**
* IS_IDEOGRAPHIC:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
*/
#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
/**
* IS_LETTER:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [84] Letter ::= BaseChar | Ideographic
*/
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
/**
* IS_LETTER_CH:
* @c: an xmlChar value (normally unsigned char)
*
* Macro behaves like IS_LETTER, but only check base chars
*
*/
#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
/**
* IS_ASCII_LETTER:
* @c: an xmlChar value
*
* Macro to check [a-zA-Z]
*
*/
#define IS_ASCII_LETTER(c) ((0x61 <= ((c) | 0x20)) && \
(((c) | 0x20) <= 0x7a))
/**
* IS_ASCII_DIGIT:
* @c: an xmlChar value
*
* Macro to check [0-9]
*
*/
#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39))
/**
* IS_PUBIDCHAR:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
*/
#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
/**
* IS_PUBIDCHAR_CH:
* @c: an xmlChar value (normally unsigned char)
*
* Same as IS_PUBIDCHAR but for single-byte value
*/
#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
/**
* Global variables used for predefined strings.
*/

View File

@ -46,20 +46,6 @@
(((ctxt)->input->entity != NULL) && \
((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
#define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
#define IS_CHAR(c) xmlIsCharQ(c)
#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
#define IS_DIGIT(c) xmlIsDigitQ(c)
#define IS_COMBINING(c) xmlIsCombiningQ(c)
#define IS_EXTENDER(c) xmlIsExtenderQ(c)
#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
#define IS_ASCII_LETTER(c) ((0x61 <= ((c) | 0x20)) && \
(((c) | 0x20) <= 0x7a))
#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39))
#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
/**
* INPUT_CHUNK:
*

View File

@ -35,7 +35,6 @@
#include <libxml/parserInternals.h>
#include "private/memory.h"
#include "private/parser.h"
#ifdef LIBXML_PATTERN_ENABLED

View File

@ -35,7 +35,6 @@
#include <libxml/xmlschemastypes.h>
#include "private/error.h"
#include "private/parser.h"
#include "private/regexp.h"
#include "private/string.h"

1
tree.c
View File

@ -46,7 +46,6 @@
#include "private/entities.h"
#include "private/error.h"
#include "private/memory.h"
#include "private/parser.h"
#include "private/tree.h"
/*

View File

@ -31,7 +31,6 @@
#include "private/error.h"
#include "private/memory.h"
#include "private/parser.h"
#include "private/regexp.h"
#ifndef SIZE_MAX

View File

@ -26,7 +26,6 @@
#include "private/entities.h"
#include "private/error.h"
#include "private/io.h"
#include "private/parser.h"
#include "private/save.h"
#ifdef LIBXML_OUTPUT_ENABLED

View File

@ -78,7 +78,6 @@
#include "private/error.h"
#include "private/memory.h"
#include "private/parser.h"
#include "private/string.h"
/* #define WXS_ELEM_DECL_CONS_ENABLED */

View File

@ -35,7 +35,6 @@
#include <libxml/xmlschemastypes.h>
#include "private/error.h"
#include "private/parser.h"
#ifndef isnan
#define isnan(x) (!((x) == (x)))

View File

@ -47,7 +47,6 @@
#include "private/buf.h"
#include "private/error.h"
#include "private/memory.h"
#include "private/parser.h"
#include "private/xpath.h"
/* Disabled for now */

View File

@ -45,7 +45,6 @@
#define XPTR_XMLNS_SCHEME
#include "private/error.h"
#include "private/parser.h"
#include "private/xpath.h"
/************************************************************************