1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-07-29 15:41:13 +03:00

Fix extension callback signatures

This commit is contained in:
Nick Wellnhofer
2017-11-29 16:12:36 +01:00
parent 6a822a2c1a
commit 3bea417b5e
3 changed files with 20 additions and 16 deletions

View File

@ -142,7 +142,7 @@ exsltFuncRegisterImportFunc (void *payload, void *vctxt,
* *
* Returns the data for this transformation * Returns the data for this transformation
*/ */
static exsltFuncData * static void *
exsltFuncInit (xsltTransformContextPtr ctxt, const xmlChar *URI) { exsltFuncInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
exsltFuncData *ret; exsltFuncData *ret;
xsltStylesheetPtr tmp; xsltStylesheetPtr tmp;
@ -187,7 +187,9 @@ exsltFuncInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
static void static void
exsltFuncShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, exsltFuncShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
const xmlChar *URI ATTRIBUTE_UNUSED, const xmlChar *URI ATTRIBUTE_UNUSED,
exsltFuncData *data) { void *vdata) {
exsltFuncData *data = (exsltFuncData *) vdata;
if (data->result != NULL) if (data->result != NULL)
xmlXPathFreeObject(data->result); xmlXPathFreeObject(data->result);
xmlFree(data); xmlFree(data);
@ -203,7 +205,7 @@ exsltFuncShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
* *
* Returns the allocated data * Returns the allocated data
*/ */
static xmlHashTablePtr static void *
exsltFuncStyleInit (xsltStylesheetPtr style ATTRIBUTE_UNUSED, exsltFuncStyleInit (xsltStylesheetPtr style ATTRIBUTE_UNUSED,
const xmlChar *URI ATTRIBUTE_UNUSED) { const xmlChar *URI ATTRIBUTE_UNUSED) {
return xmlHashCreate(1); return xmlHashCreate(1);
@ -226,7 +228,8 @@ exsltFuncFreeDataEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
static void static void
exsltFuncStyleShutdown (xsltStylesheetPtr style ATTRIBUTE_UNUSED, exsltFuncStyleShutdown (xsltStylesheetPtr style ATTRIBUTE_UNUSED,
const xmlChar *URI ATTRIBUTE_UNUSED, const xmlChar *URI ATTRIBUTE_UNUSED,
xmlHashTablePtr data) { void *vdata) {
xmlHashTablePtr data = (xmlHashTablePtr) vdata;
xmlHashFree(data, exsltFuncFreeDataEntry); xmlHashFree(data, exsltFuncFreeDataEntry);
} }
@ -792,10 +795,10 @@ exsltFuncResultElem (xsltTransformContextPtr ctxt,
void void
exsltFuncRegister (void) { exsltFuncRegister (void) {
xsltRegisterExtModuleFull (EXSLT_FUNCTIONS_NAMESPACE, xsltRegisterExtModuleFull (EXSLT_FUNCTIONS_NAMESPACE,
(xsltExtInitFunction) exsltFuncInit, exsltFuncInit,
(xsltExtShutdownFunction) exsltFuncShutdown, exsltFuncShutdown,
(xsltStyleExtInitFunction) exsltFuncStyleInit, exsltFuncStyleInit,
(xsltStyleExtShutdownFunction) exsltFuncStyleShutdown); exsltFuncStyleShutdown);
xsltRegisterExtModuleTopLevel ((const xmlChar *) "function", xsltRegisterExtModuleTopLevel ((const xmlChar *) "function",
EXSLT_FUNCTIONS_NAMESPACE, EXSLT_FUNCTIONS_NAMESPACE,

View File

@ -29,7 +29,7 @@
* *
* Returns the data for this transformation * Returns the data for this transformation
*/ */
static xmlHashTablePtr static void *
exsltSaxonInit (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, exsltSaxonInit (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
const xmlChar *URI ATTRIBUTE_UNUSED) { const xmlChar *URI ATTRIBUTE_UNUSED) {
return xmlHashCreate(1); return xmlHashCreate(1);
@ -52,7 +52,8 @@ exsltSaxonFreeCompExprEntry(void *payload,
static void static void
exsltSaxonShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, exsltSaxonShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
const xmlChar *URI ATTRIBUTE_UNUSED, const xmlChar *URI ATTRIBUTE_UNUSED,
xmlHashTablePtr data) { void *vdata) {
xmlHashTablePtr data = (xmlHashTablePtr) vdata;
xmlHashFree(data, exsltSaxonFreeCompExprEntry); xmlHashFree(data, exsltSaxonFreeCompExprEntry);
} }
@ -299,8 +300,8 @@ exsltSaxonLineNumberFunction(xmlXPathParserContextPtr ctxt, int nargs) {
void void
exsltSaxonRegister (void) { exsltSaxonRegister (void) {
xsltRegisterExtModule (SAXON_NAMESPACE, xsltRegisterExtModule (SAXON_NAMESPACE,
(xsltExtInitFunction) exsltSaxonInit, exsltSaxonInit,
(xsltExtShutdownFunction) exsltSaxonShutdown); exsltSaxonShutdown);
xsltRegisterExtModuleFunction((const xmlChar *) "expression", xsltRegisterExtModuleFunction((const xmlChar *) "expression",
SAXON_NAMESPACE, SAXON_NAMESPACE,
exsltSaxonExpressionFunction); exsltSaxonExpressionFunction);

View File

@ -1127,10 +1127,10 @@ libxslt_xsltRegisterExtensionClass(PyObject *self ATTRIBUTE_UNUSED,
Py_XINCREF(pyobj_c); Py_XINCREF(pyobj_c);
ret = xsltRegisterExtModuleFull(ns_uri, ret = xsltRegisterExtModuleFull(ns_uri,
(xsltExtInitFunction) libxslt_xsltPythonExtModuleCtxtInit, libxslt_xsltPythonExtModuleCtxtInit,
(xsltExtShutdownFunction) libxslt_xsltPythonExtModuleCtxtShutdown, libxslt_xsltPythonExtModuleCtxtShutdown,
(xsltStyleExtInitFunction) libxslt_xsltPythonExtModuleStyleInit, libxslt_xsltPythonExtModuleStyleInit,
(xsltStyleExtShutdownFunction) libxslt_xsltPythonExtModuleStyleShutdown); libxslt_xsltPythonExtModuleStyleShutdown);
py_retval = libxml_intWrap((int) ret); py_retval = libxml_intWrap((int) ret);
if (ret < 0) { if (ret < 0) {
Py_XDECREF(pyobj_c); Py_XDECREF(pyobj_c);