1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-26 00:37:43 +03:00

Rework validation context flags

Use a bitmask instead of magic values to

- keep track whether the validation context is part of a parser context
- keep track whether xmlValidateDtdFinal was called

This allows to add addtional flags later.

Note that this deliberately changes the name of a public struct member,
assuming that this was always private data never to be used by client
code.
This commit is contained in:
Nick Wellnhofer
2022-01-13 17:06:14 +01:00
parent a075d256fd
commit d7cb33cf44
5 changed files with 30 additions and 41 deletions

View File

@@ -60,17 +60,17 @@ typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx,
#ifdef IN_LIBXML
/**
* XML_CTXT_FINISH_DTD_0:
* XML_VCTXT_DTD_VALIDATED:
*
* Special value for finishDtd field when embedded in an xmlParserCtxt
* Set after xmlValidateDtdFinal was called.
*/
#define XML_CTXT_FINISH_DTD_0 0xabcd1234
#define XML_VCTXT_DTD_VALIDATED (1u << 0)
/**
* XML_CTXT_FINISH_DTD_1:
* XML_VCTXT_USE_PCTXT:
*
* Special value for finishDtd field when embedded in an xmlParserCtxt
* Set if the validation context is part of a parser context.
*/
#define XML_CTXT_FINISH_DTD_1 0xabcd1235
#define XML_VCTXT_USE_PCTXT (1u << 1)
#endif
/*
@@ -90,7 +90,7 @@ struct _xmlValidCtxt {
int nodeMax; /* Max depth of the parsing stack */
xmlNodePtr *nodeTab; /* array of nodes */
unsigned int finishDtd; /* finished validating the Dtd ? */
unsigned int flags; /* internal flags */
xmlDocPtr doc; /* the document */
int valid; /* temporary validity check result */