diff --git a/ChangeLog b/ChangeLog index e6a4add5..d02b805c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sun Jul 29 08:37:59 EDT 2001 Daniel Veillard + + * libexslt/functions.c libxslt/extensions.[ch] libxslt/extensions.h + libxslt/xslt.[hc] libxslt/xsltInternals.h xsltproc/xsltproc.c: + more cleanup of the problems introduced with EXSLT, also closes + bug #58180 + Sat Jul 28 08:25:05 MDT 2001 John Fleck * doc/internals.html - general cleanup diff --git a/libexslt/functions.c b/libexslt/functions.c index 56c293d7..d4f31482 100644 --- a/libexslt/functions.c +++ b/libexslt/functions.c @@ -1,14 +1,18 @@ +#include "libxslt/libxslt.h" + #include #include #include #include #include +#include #include #include #include #include +#include #include "exslt.h" @@ -167,7 +171,6 @@ exsltFuncNewFunctionData (void) { static void exsltFuncFunctionFunction (xmlXPathParserContextPtr ctxt, int nargs) { xmlXPathObjectPtr obj, oldResult, ret; - xmlHashTablePtr funcs; exsltFuncData *data; exsltFuncFunctionData *func; xmlNodePtr paramNode, oldInsert, fake; @@ -340,8 +343,9 @@ exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) { } static void -exsltFuncResultElem (xsltTransformContextPtr ctxt, xmlNodePtr node, - xmlNodePtr inst, xsltStylePreCompPtr comp) { +exsltFuncResultElem (xsltTransformContextPtr ctxt, + xmlNodePtr node ATTRIBUTE_UNUSED, xmlNodePtr inst, + xsltStylePreCompPtr comp ATTRIBUTE_UNUSED) { xmlNodePtr test; xmlChar *select; exsltFuncData *data; diff --git a/libxslt/extensions.c b/libxslt/extensions.c index 31d1eef3..0adbc592 100644 --- a/libxslt/extensions.c +++ b/libxslt/extensions.c @@ -851,7 +851,7 @@ xsltUnregisterExtModule(const xmlChar * URI) * * Unregister all the XSLT extension module from the library. */ -void +static void xsltUnregisterAllExtModules(void) { if (xsltExtensionsHash == NULL) @@ -948,7 +948,7 @@ xsltUnregisterExtModuleFunction (const xmlChar *name, * * Unregisters all extension module function */ -void +static void xsltUnregisterAllExtModuleFunction (void) { xmlHashFree(xsltFunctionsHash, NULL); xsltFunctionsHash = NULL; @@ -1088,7 +1088,7 @@ xsltUnregisterExtModuleElement (const xmlChar *name, * * Unregisters all extension module element */ -void +static void xsltUnregisterAllExtModuleElement (void) { xmlHashFree(xsltElementsHash, (xmlHashDeallocator) xsltFreeExtElement); xsltElementsHash = NULL; @@ -1162,7 +1162,7 @@ xsltUnregisterExtModuleTopLevel (const xmlChar *name, * * Unregisters all extension module function */ -void +static void xsltUnregisterAllExtModuleTopLevel (void) { xmlHashFree(xsltTopLevelsHash, NULL); xsltTopLevelsHash = NULL; @@ -1465,3 +1465,18 @@ xsltRegisterTestModule (void) { xsltExtElementPreCompTest , xsltExtElementTest); } + +/** + * xsltCleanupGlobals: + * + * Unregister all global variables set up by the XSLT library + */ +void +xsltCleanupGlobals(void) +{ + xsltUnregisterAllExtModules(); + xsltUnregisterAllExtModuleFunction(); + xsltUnregisterAllExtModuleElement(); + xsltUnregisterAllExtModuleTopLevel(); +} + diff --git a/libxslt/extensions.h b/libxslt/extensions.h index 7af52353..4f64e24c 100644 --- a/libxslt/extensions.h +++ b/libxslt/extensions.h @@ -80,8 +80,6 @@ int xsltRegisterExtModuleFull int xsltUnregisterExtModule (const xmlChar * URI); -void xsltUnregisterAllExtModules(void); - void * xsltGetExtData (xsltTransformContextPtr ctxt, const xmlChar *URI); diff --git a/libxslt/xslt.c b/libxslt/xslt.c index 1a3f6c67..00a976e5 100644 --- a/libxslt/xslt.c +++ b/libxslt/xslt.c @@ -1249,7 +1249,7 @@ xsltGatherNamespaces(xsltStylesheetPtr style) { /** * xsltParseTemplateContent: * @style: the XSLT stylesheet - * @template: the container node (can be a document for literal results) + * @templ: the container node (can be a document for literal results) * * parse a template content-model * Clean-up the template content from unwanted ignorable blank nodes @@ -1257,14 +1257,14 @@ xsltGatherNamespaces(xsltStylesheetPtr style) { */ void -xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr template) { +xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr templ) { xmlNodePtr cur, delete; /* * This content comes from the stylesheet * For stylesheets, the set of whitespace-preserving * element names consists of just xsl:text. */ - cur = template->children; + cur = templ->children; delete = NULL; while (cur != NULL) { if (delete != NULL) { @@ -1362,7 +1362,7 @@ skip_children: cur = cur->parent; if (cur == NULL) break; - if (cur == template) { + if (cur == templ) { cur = NULL; break; } @@ -1385,7 +1385,7 @@ skip_children: /* * Skip the first params */ - cur = template->children; + cur = templ->children; while (cur != NULL) { if ((IS_XSLT_ELEM(cur)) && (!(IS_XSLT_NAME(cur, "param")))) break; diff --git a/libxslt/xslt.h b/libxslt/xslt.h index d18ec5fa..d19cf298 100644 --- a/libxslt/xslt.h +++ b/libxslt/xslt.h @@ -71,6 +71,11 @@ extern const int xsltLibxsltVersion; */ extern const int xsltLibxmlVersion; +/* + * Global cleanup function + */ +void xsltCleanupGlobals (void); + #ifdef __cplusplus } #endif diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h index 56be65bc..02c7f7ca 100644 --- a/libxslt/xsltInternals.h +++ b/libxslt/xsltInternals.h @@ -455,7 +455,7 @@ xmlXPathError xsltFormatNumberConversion(xsltDecimalFormatPtr self, xmlChar **result); void xsltParseTemplateContent(xsltStylesheetPtr style, - xmlNodePtr template); + xmlNodePtr templ); #ifdef __cplusplus } diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c index 718c1fbb..29a4c2dd 100644 --- a/xsltproc/xsltproc.c +++ b/xsltproc/xsltproc.c @@ -505,10 +505,7 @@ main(int argc, char **argv) } xsltFreeStylesheet(cur); } - xsltUnregisterAllExtModules(); - xsltUnregisterAllExtModuleFunction(); - xsltUnregisterAllExtModuleElement(); - xsltUnregisterAllExtModuleTopLevel(); + xsltCleanupGlobals(); xmlCleanupParser(); xmlMemoryDump(); return (0);