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

View File

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

View File

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