Skip to content

Commit d679f44

Browse files
committed
functions: Fix build if libxml2 modules are disabled
1 parent 66103bd commit d679f44

File tree

3 files changed

+6
-53
lines changed

3 files changed

+6
-53
lines changed

libxslt/functions.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,26 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
100100
{
101101
xsltTransformContextPtr tctxt;
102102
xmlURIPtr uri;
103-
xmlChar *fragment;
103+
xmlChar *fragment = NULL;
104104
xsltDocumentPtr idoc; /* document info */
105105
xmlDocPtr doc;
106106
xmlXPathContextPtr xptrctxt = NULL;
107107
xmlXPathObjectPtr resObj = NULL;
108108

109+
(void) xptrctxt;
110+
109111
tctxt = xsltXPathGetTransformContext(ctxt);
110112
if (tctxt == NULL) {
111113
xsltTransformError(NULL, NULL, NULL,
112114
"document() : internal error tctxt == NULL\n");
113-
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
114-
return;
115+
goto out_fragment;
115116
}
116117

117118
uri = xmlParseURI((const char *) URI);
118119
if (uri == NULL) {
119120
xsltTransformError(tctxt, NULL, NULL,
120121
"document() : failed to parse URI\n");
121-
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
122-
return;
122+
goto out_fragment;
123123
}
124124

125125
/*
@@ -147,12 +147,7 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
147147
*/
148148
doc = tctxt->style->doc;
149149
} else {
150-
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
151-
152-
if (fragment != NULL)
153-
xmlFree(fragment);
154-
155-
return;
150+
goto out_fragment;
156151
}
157152
} else
158153
doc = idoc->doc;

python/libxml_wrap.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ typedef struct {
6666
xmlParserCtxtPtr obj;
6767
} PyparserCtxt_Object;
6868

69-
#define Pycatalog_Get(v) (((v) == Py_None) ? NULL : \
70-
(((Pycatalog_Object *)(v))->obj))
71-
72-
typedef struct {
73-
PyObject_HEAD
74-
xmlCatalogPtr obj;
75-
} Pycatalog_Object;
76-
7769
#if PY_MAJOR_VERSION >= 3
7870
FILE *libxml_PyFileGet(PyObject *f);
7971
void libxml_PyFileRelease(FILE *f);
@@ -104,10 +96,8 @@ PyObject * libxml_xmlXPathContextPtrWrap(xmlXPathContextPtr ctxt);
10496
PyObject * libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt);
10597
PyObject * libxml_xmlXPathParserContextPtrWrap(xmlXPathParserContextPtr ctxt);
10698
PyObject * libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj);
107-
PyObject * libxml_xmlCatalogPtrWrap(xmlCatalogPtr obj);
10899
PyObject * libxml_xmlURIPtrWrap(xmlURIPtr uri);
109100
PyObject * libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffer);
110101
PyObject * libxml_xmlParserInputBufferPtrWrap(xmlParserInputBufferPtr buffer);
111-
PyObject * libxml_xmlRegexpPtrWrap(xmlRegexpPtr regexp);
112102

113103
xmlXPathObjectPtr libxml_xmlXPathObjectPtrConvert(PyObject * obj);

python/types.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -752,22 +752,6 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
752752
return (ret);
753753
}
754754

755-
PyObject *
756-
libxml_xmlCatalogPtrWrap(xmlCatalogPtr catal)
757-
{
758-
PyObject *ret;
759-
760-
#ifdef DEBUG
761-
printf("libxml_xmlNodePtrWrap: catal = %p\n", catal);
762-
#endif
763-
if (catal == NULL) {
764-
Py_INCREF(Py_None);
765-
return (Py_None);
766-
}
767-
ret = PyCapsule_New((void *) catal, (char *) "xmlCatalogPtr", NULL);
768-
return (ret);
769-
}
770-
771755
PyObject *
772756
libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffer)
773757
{
@@ -800,19 +784,3 @@ libxml_xmlParserInputBufferPtrWrap(xmlParserInputBufferPtr buffer)
800784
NULL);
801785
return (ret);
802786
}
803-
804-
PyObject *
805-
libxml_xmlRegexpPtrWrap(xmlRegexpPtr regexp)
806-
{
807-
PyObject *ret;
808-
809-
#ifdef DEBUG
810-
printf("libxml_xmlRegexpPtrWrap: regexp = %p\n", regexp);
811-
#endif
812-
if (regexp == NULL) {
813-
Py_INCREF(Py_None);
814-
return (Py_None);
815-
}
816-
ret = PyCapsule_New((void *) regexp, (char *) "xmlRegexpPtr", NULL);
817-
return (ret);
818-
}

0 commit comments

Comments
 (0)