summaryrefslogtreecommitdiff
path: root/libexslt/math.c
diff options
context:
space:
mode:
authorThomas Broyer <tbroyer@src.gnome.org>2001-07-26 17:27:38 +0000
committerThomas Broyer <tbroyer@src.gnome.org>2001-07-26 17:27:38 +0000
commit3a16b45ef141de88ab28039ff8cb868be4751f35 (patch)
tree39871212227e31e8df5f5fce51e4af80a394f2e0 /libexslt/math.c
parent93a9ef80f276ad2676d129e83f6992736a0a17ce (diff)
downloadlibxslt-3a16b45ef141de88ab28039ff8cb868be4751f35.tar.gz
libxslt-3a16b45ef141de88ab28039ff8cb868be4751f35.tar.bz2
libxslt-3a16b45ef141de88ab28039ff8cb868be4751f35.zip
new extension framework. Added stylesheet module data, top-level and
* libxslt/extensions.[ch] libxslt/functions.[ch] libxslt/preproc.c libxslt/transform.[ch] libxslt/variables.c libxslt/xslt.c libxslt/xsltInternals.h: new extension framework. Added stylesheet module data, top-level and extension elements precomputing, global registration of top-level elements and extension elements and functions. Extensions are no longer initialized from extension-element-prefixes declarations but when modules need the data. init/shutdown functions registered with xsltRegisterExtModule{,Full} only allocate and free module data, they shouldn't register the elements and functions any more. * libxslt/xsltutils.c: fixed a bug in xsltPrintErrorContext when @node wasn't NULL. * libxslt/xslt.c: fixed xsltPrecomputeStylesheetTop which allowed non-XSLT top-level elements before any xsl:import element. * libexslt/common.c libexslt/functions.c libexslt/math.c libexslt/sets.c: adapted to use the new extension framework. * libxslt/functions.c libxslt/extensions[ch] xsltproc/xsltproc.c: moved the test module from functions.c to extensions.[ch], modified it to use the new extension framework. Updated xsltproc to register the test module.
Diffstat (limited to 'libexslt/math.c')
-rw-r--r--libexslt/math.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/libexslt/math.c b/libexslt/math.c
index c9bb1a8d..ddb2fbdb 100644
--- a/libexslt/math.c
+++ b/libexslt/math.c
@@ -271,19 +271,6 @@ exsltMathLowestFunction (xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathReturnNodeSet(ctxt, ret);
}
-static void *
-exsltMathInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
- xsltRegisterExtFunction (ctxt, (const xmlChar *) "min",
- URI, exsltMathMinFunction);
- xsltRegisterExtFunction (ctxt, (const xmlChar *) "max",
- URI, exsltMathMaxFunction);
- xsltRegisterExtFunction (ctxt, (const xmlChar *) "highest",
- URI, exsltMathHighestFunction);
- xsltRegisterExtFunction (ctxt, (const xmlChar *) "lowest",
- URI, exsltMathLowestFunction);
- return(NULL);
-}
-
/**
* exsltMathRegister:
*
@@ -292,5 +279,16 @@ exsltMathInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
void
exsltMathRegister (void) {
- xsltRegisterExtModule (EXSLT_MATH_NAMESPACE, exsltMathInit, NULL);
+ xsltRegisterExtModuleFunction ((const xmlChar *) "min",
+ EXSLT_MATH_NAMESPACE,
+ exsltMathMinFunction);
+ xsltRegisterExtModuleFunction ((const xmlChar *) "max",
+ EXSLT_MATH_NAMESPACE,
+ exsltMathMaxFunction);
+ xsltRegisterExtModuleFunction ((const xmlChar *) "highest",
+ EXSLT_MATH_NAMESPACE,
+ exsltMathHighestFunction);
+ xsltRegisterExtModuleFunction ((const xmlChar *) "lowest",
+ EXSLT_MATH_NAMESPACE,
+ exsltMathLowestFunction);
}