Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: third_party/libxslt/libexslt/math.c

Issue 661058: libxslt update (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libxslt/libexslt/libexslt.h ('k') | third_party/libxslt/libexslt/sets.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libxslt/libexslt/math.c
===================================================================
--- third_party/libxslt/libexslt/math.c (revision 39981)
+++ third_party/libxslt/libexslt/math.c (working copy)
@@ -972,22 +972,22 @@
*/
static void
exsltMathAtan2Function (xmlXPathParserContextPtr ctxt, int nargs) {
- double ret, y;
+ double ret, x;
if (nargs != 2) {
xmlXPathSetArityError(ctxt);
return;
}
- y = xmlXPathPopNumber(ctxt);
+ x = xmlXPathPopNumber(ctxt);
if (xmlXPathCheckError(ctxt))
return;
- /* x */
+ /* y */
ret = xmlXPathPopNumber(ctxt);
if (xmlXPathCheckError(ctxt))
return;
- ret = exsltMathAtan2(y, ret);
+ ret = exsltMathAtan2(ret, x);
xmlXPathReturnNumber(ctxt, ret);
}
@@ -1106,3 +1106,97 @@
exsltMathExpFunction);
#endif
}
+
+/**
+ * exsltMathXpathCtxtRegister:
+ *
+ * Registers the EXSLT - Math module for use outside XSLT
+ */
+int
+exsltMathXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix)
+{
+ if (ctxt
+ && prefix
+ && !xmlXPathRegisterNs(ctxt,
+ prefix,
+ (const xmlChar *) EXSLT_MATH_NAMESPACE)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "min",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathMinFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "max",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathMaxFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "highest",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathHighestFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "lowest",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathLowestFunction)
+#ifdef HAVE_STDLIB_H
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "random",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathRandomFunction)
+#endif
+#if HAVE_MATH_H
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "abs",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathAbsFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "sqrt",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathSqrtFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "power",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathPowerFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "log",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathLogFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "sin",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathSinFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "cos",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathCosFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "tan",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathTanFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "asin",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathAsinFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "acos",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathAcosFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "atan",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathAtanFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "atan2",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathAtan2Function)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "exp",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathExpFunction)
+#endif
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "constant",
+ (const xmlChar *) EXSLT_MATH_NAMESPACE,
+ exsltMathConstantFunction)) {
+ return 0;
+ }
+ return -1;
+}
« no previous file with comments | « third_party/libxslt/libexslt/libexslt.h ('k') | third_party/libxslt/libexslt/sets.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698