mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
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.
This commit is contained in:
@@ -2876,14 +2876,13 @@ libxml_addLocalCatalog(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
|
||||
}
|
||||
#endif /* LIBXML_CATALOG_ENABLED */
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* RelaxNG error handler registration *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
#ifdef LIBXML_RELAXNG_ENABLED
|
||||
typedef struct
|
||||
{
|
||||
PyObject *warn;
|
||||
@@ -3035,7 +3034,9 @@ libxml_xmlRelaxNGFreeValidCtxt(ATTRIBUTE_UNUSED PyObject *self, PyObject *args)
|
||||
Py_INCREF(Py_None);
|
||||
return(Py_None);
|
||||
}
|
||||
#endif /* LIBXML_RELAXNG_ENABLED */
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
typedef struct
|
||||
{
|
||||
PyObject *warn;
|
||||
@@ -3188,8 +3189,7 @@ libxml_xmlSchemaFreeValidCtxt(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
|
||||
Py_INCREF(Py_None);
|
||||
return(Py_None);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* LIBXML_SCHEMAS_ENABLED */
|
||||
|
||||
#ifdef LIBXML_C14N_ENABLED
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
@@ -3594,9 +3594,11 @@ static PyMethodDef libxmlMethods[] = {
|
||||
#ifdef LIBXML_CATALOG_ENABLED
|
||||
{(char *)"addLocalCatalog", libxml_addLocalCatalog, METH_VARARGS, NULL },
|
||||
#endif
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
#ifdef LIBXML_RELAXNG_ENABLED
|
||||
{(char *)"xmlRelaxNGSetValidErrors", libxml_xmlRelaxNGSetValidErrors, METH_VARARGS, NULL},
|
||||
{(char *)"xmlRelaxNGFreeValidCtxt", libxml_xmlRelaxNGFreeValidCtxt, METH_VARARGS, NULL},
|
||||
#endif
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
{(char *)"xmlSchemaSetValidErrors", libxml_xmlSchemaSetValidErrors, METH_VARARGS, NULL},
|
||||
{(char *)"xmlSchemaFreeValidCtxt", libxml_xmlSchemaFreeValidCtxt, METH_VARARGS, NULL},
|
||||
#endif
|
||||
|
@@ -19,8 +19,10 @@
|
||||
#include <libxml/xmlreader.h>
|
||||
#include <libxml/globals.h>
|
||||
#include <libxml/xmlsave.h>
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
#ifdef LIBXML_RELAXNG_ENABLED
|
||||
#include <libxml/relaxng.h>
|
||||
#endif
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
#include <libxml/xmlschemas.h>
|
||||
#endif
|
||||
|
||||
@@ -204,7 +206,7 @@ void libxml_PyFileRelease(FILE *f);
|
||||
#define PyFile_Release(f)
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
#ifdef LIBXML_RELAXNG_ENABLED
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
xmlRelaxNGPtr obj;
|
||||
@@ -229,6 +231,9 @@ typedef struct {
|
||||
#define PyrelaxNgValidCtxt_Get(v) (((v) == Py_None) ? NULL : \
|
||||
(((PyrelaxNgValidCtxt_Object *)(v))->obj))
|
||||
|
||||
#endif /* LIBXML_RELAXNG_ENABLED */
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
xmlSchemaPtr obj;
|
||||
@@ -292,10 +297,12 @@ PyObject * libxml_xmlTextReaderPtrWrap(xmlTextReaderPtr reader);
|
||||
PyObject * libxml_xmlTextReaderLocatorPtrWrap(xmlTextReaderLocatorPtr locator);
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
#ifdef LIBXML_RELAXNG_ENABLED
|
||||
PyObject * libxml_xmlRelaxNGPtrWrap(xmlRelaxNGPtr ctxt);
|
||||
PyObject * libxml_xmlRelaxNGParserCtxtPtrWrap(xmlRelaxNGParserCtxtPtr ctxt);
|
||||
PyObject * libxml_xmlRelaxNGValidCtxtPtrWrap(xmlRelaxNGValidCtxtPtr valid);
|
||||
#endif /* LIBXML_RELAXNG_ENABLED */
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
PyObject * libxml_xmlSchemaPtrWrap(xmlSchemaPtr ctxt);
|
||||
PyObject * libxml_xmlSchemaParserCtxtPtrWrap(xmlSchemaParserCtxtPtr ctxt);
|
||||
PyObject * libxml_xmlSchemaValidCtxtPtrWrap(xmlSchemaValidCtxtPtr valid);
|
||||
|
@@ -771,7 +771,7 @@ libxml_xmlTextReaderLocatorPtrWrap(xmlTextReaderLocatorPtr locator)
|
||||
}
|
||||
#endif /* LIBXML_READER_ENABLED */
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
#ifdef LIBXML_RELAXNG_ENABLED
|
||||
PyObject *
|
||||
libxml_xmlRelaxNGPtrWrap(xmlRelaxNGPtr ctxt)
|
||||
{
|
||||
@@ -815,7 +815,9 @@ libxml_xmlRelaxNGValidCtxtPtrWrap(xmlRelaxNGValidCtxtPtr valid)
|
||||
(char *) "xmlRelaxNGValidCtxtPtr", NULL);
|
||||
return (ret);
|
||||
}
|
||||
#endif /* LIBXML_RELAXNG_ENABLED */
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
PyObject *
|
||||
libxml_xmlSchemaPtrWrap(xmlSchemaPtr ctxt)
|
||||
{
|
||||
|
Reference in New Issue
Block a user