summaryrefslogtreecommitdiffstats
path: root/generic/tclTomMathInterface.c
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-12-13 22:43:15 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-12-13 22:43:15 (GMT)
commit47ed8302270238b3263e8c7e6fb103e6c12e4d9c (patch)
treef5971ca2525b7271645c996adc428790015b1fe6 /generic/tclTomMathInterface.c
parent0def411fa61fa15627a6b3b0cad45918f27ca675 (diff)
downloadtcl-47ed8302270238b3263e8c7e6fb103e6c12e4d9c.zip
tcl-47ed8302270238b3263e8c7e6fb103e6c12e4d9c.tar.gz
tcl-47ed8302270238b3263e8c7e6fb103e6c12e4d9c.tar.bz2
Export stubs for libtommath; fix mingw compiler warnings
Diffstat (limited to 'generic/tclTomMathInterface.c')
-rw-r--r--generic/tclTomMathInterface.c79
1 files changed, 77 insertions, 2 deletions
diff --git a/generic/tclTomMathInterface.c b/generic/tclTomMathInterface.c
index bf62963..65eddcf 100644
--- a/generic/tclTomMathInterface.c
+++ b/generic/tclTomMathInterface.c
@@ -11,12 +11,86 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTomMathInterface.c,v 1.5 2005/10/13 00:14:38 dgp Exp $
+ * RCS: @(#) $Id: tclTomMathInterface.c,v 1.6 2005/12/13 22:43:18 kennykb Exp $
*/
#include "tclInt.h"
#include "tommath.h"
#include <limits.h>
+
+extern TclTomMathStubs tclTomMathStubs;
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclTommath_Init --
+ *
+ * Initializes the TclTomMath 'package', which exists as a
+ * placeholder so that the package data can be used to hold
+ * a stub table pointer.
+ *
+ * Results:
+ * Returns a standard Tcl result.
+ *
+ * Side effects:
+ * Installs the stub table for tommath.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclTommath_Init(
+ Tcl_Interp* interp /* Tcl interpreter */
+) {
+ if (Tcl_PkgProvideEx(interp, "tcl::tommath", TCL_VERSION,
+ (ClientData)&tclTomMathStubs) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclBN_epoch --
+ *
+ * Return the epoch number of the TclTomMath stubs table
+ *
+ * Results:
+ * Returns an arbitrary integer that does not decrease with
+ * release. Stubs tables with different epochs are incompatible.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclBN_epoch()
+{
+ return TCLTOMMATH_EPOCH;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclBN_revision --
+ *
+ * Returns the revision level of the TclTomMath stubs table
+ *
+ * Results:
+ * Returns an arbitrary integer that increases with revisions.
+ * If a client requires a given epoch and revision, any Stubs table
+ * with the same epoch and an equal or higher revision satisfies
+ * the request.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclBN_revision()
+{
+ return TCLTOMMATH_REVISION;
+}
+#if 0
/*
*----------------------------------------------------------------------
@@ -57,7 +131,7 @@ TclBNAlloc(
*----------------------------------------------------------------------
*/
-extern void *
+void *
TclBNRealloc(
void *p,
size_t s)
@@ -90,6 +164,7 @@ TclBNFree(
{
Tcl_Free((char *) p);
}
+#endif
/*
*----------------------------------------------------------------------