mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-07-29 15:41:13 +03:00
functions: Fix build if libxml2 modules are disabled
This commit is contained in:
@ -100,26 +100,26 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
|
|||||||
{
|
{
|
||||||
xsltTransformContextPtr tctxt;
|
xsltTransformContextPtr tctxt;
|
||||||
xmlURIPtr uri;
|
xmlURIPtr uri;
|
||||||
xmlChar *fragment;
|
xmlChar *fragment = NULL;
|
||||||
xsltDocumentPtr idoc; /* document info */
|
xsltDocumentPtr idoc; /* document info */
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
xmlXPathContextPtr xptrctxt = NULL;
|
xmlXPathContextPtr xptrctxt = NULL;
|
||||||
xmlXPathObjectPtr resObj = NULL;
|
xmlXPathObjectPtr resObj = NULL;
|
||||||
|
|
||||||
|
(void) xptrctxt;
|
||||||
|
|
||||||
tctxt = xsltXPathGetTransformContext(ctxt);
|
tctxt = xsltXPathGetTransformContext(ctxt);
|
||||||
if (tctxt == NULL) {
|
if (tctxt == NULL) {
|
||||||
xsltTransformError(NULL, NULL, NULL,
|
xsltTransformError(NULL, NULL, NULL,
|
||||||
"document() : internal error tctxt == NULL\n");
|
"document() : internal error tctxt == NULL\n");
|
||||||
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
|
goto out_fragment;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uri = xmlParseURI((const char *) URI);
|
uri = xmlParseURI((const char *) URI);
|
||||||
if (uri == NULL) {
|
if (uri == NULL) {
|
||||||
xsltTransformError(tctxt, NULL, NULL,
|
xsltTransformError(tctxt, NULL, NULL,
|
||||||
"document() : failed to parse URI\n");
|
"document() : failed to parse URI\n");
|
||||||
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
|
goto out_fragment;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -147,12 +147,7 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
|
|||||||
*/
|
*/
|
||||||
doc = tctxt->style->doc;
|
doc = tctxt->style->doc;
|
||||||
} else {
|
} else {
|
||||||
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
|
goto out_fragment;
|
||||||
|
|
||||||
if (fragment != NULL)
|
|
||||||
xmlFree(fragment);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
doc = idoc->doc;
|
doc = idoc->doc;
|
||||||
|
@ -66,14 +66,6 @@ typedef struct {
|
|||||||
xmlParserCtxtPtr obj;
|
xmlParserCtxtPtr obj;
|
||||||
} PyparserCtxt_Object;
|
} PyparserCtxt_Object;
|
||||||
|
|
||||||
#define Pycatalog_Get(v) (((v) == Py_None) ? NULL : \
|
|
||||||
(((Pycatalog_Object *)(v))->obj))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
PyObject_HEAD
|
|
||||||
xmlCatalogPtr obj;
|
|
||||||
} Pycatalog_Object;
|
|
||||||
|
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
FILE *libxml_PyFileGet(PyObject *f);
|
FILE *libxml_PyFileGet(PyObject *f);
|
||||||
void libxml_PyFileRelease(FILE *f);
|
void libxml_PyFileRelease(FILE *f);
|
||||||
@ -104,10 +96,8 @@ PyObject * libxml_xmlXPathContextPtrWrap(xmlXPathContextPtr ctxt);
|
|||||||
PyObject * libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt);
|
PyObject * libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt);
|
||||||
PyObject * libxml_xmlXPathParserContextPtrWrap(xmlXPathParserContextPtr ctxt);
|
PyObject * libxml_xmlXPathParserContextPtrWrap(xmlXPathParserContextPtr ctxt);
|
||||||
PyObject * libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj);
|
PyObject * libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj);
|
||||||
PyObject * libxml_xmlCatalogPtrWrap(xmlCatalogPtr obj);
|
|
||||||
PyObject * libxml_xmlURIPtrWrap(xmlURIPtr uri);
|
PyObject * libxml_xmlURIPtrWrap(xmlURIPtr uri);
|
||||||
PyObject * libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffer);
|
PyObject * libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffer);
|
||||||
PyObject * libxml_xmlParserInputBufferPtrWrap(xmlParserInputBufferPtr buffer);
|
PyObject * libxml_xmlParserInputBufferPtrWrap(xmlParserInputBufferPtr buffer);
|
||||||
PyObject * libxml_xmlRegexpPtrWrap(xmlRegexpPtr regexp);
|
|
||||||
|
|
||||||
xmlXPathObjectPtr libxml_xmlXPathObjectPtrConvert(PyObject * obj);
|
xmlXPathObjectPtr libxml_xmlXPathObjectPtrConvert(PyObject * obj);
|
||||||
|
@ -752,22 +752,6 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
|
|||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *
|
|
||||||
libxml_xmlCatalogPtrWrap(xmlCatalogPtr catal)
|
|
||||||
{
|
|
||||||
PyObject *ret;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
printf("libxml_xmlNodePtrWrap: catal = %p\n", catal);
|
|
||||||
#endif
|
|
||||||
if (catal == NULL) {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
return (Py_None);
|
|
||||||
}
|
|
||||||
ret = PyCapsule_New((void *) catal, (char *) "xmlCatalogPtr", NULL);
|
|
||||||
return (ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffer)
|
libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffer)
|
||||||
{
|
{
|
||||||
@ -800,19 +784,3 @@ libxml_xmlParserInputBufferPtrWrap(xmlParserInputBufferPtr buffer)
|
|||||||
NULL);
|
NULL);
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *
|
|
||||||
libxml_xmlRegexpPtrWrap(xmlRegexpPtr regexp)
|
|
||||||
{
|
|
||||||
PyObject *ret;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
printf("libxml_xmlRegexpPtrWrap: regexp = %p\n", regexp);
|
|
||||||
#endif
|
|
||||||
if (regexp == NULL) {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
return (Py_None);
|
|
||||||
}
|
|
||||||
ret = PyCapsule_New((void *) regexp, (char *) "xmlRegexpPtr", NULL);
|
|
||||||
return (ret);
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user