diff options
author | kennykb <kennykb@noemail.net> | 2005-12-13 22:43:14 (GMT) |
---|---|---|
committer | kennykb <kennykb@noemail.net> | 2005-12-13 22:43:14 (GMT) |
commit | 2fb0f9b403a0f8dcda8418af57a20ad41c50f9a0 (patch) | |
tree | f5971ca2525b7271645c996adc428790015b1fe6 /generic/tclTomMathInterface.c | |
parent | 0b08bede7ebf6353c81ae29a55c8b567e7a7b655 (diff) | |
download | tcl-2fb0f9b403a0f8dcda8418af57a20ad41c50f9a0.zip tcl-2fb0f9b403a0f8dcda8418af57a20ad41c50f9a0.tar.gz tcl-2fb0f9b403a0f8dcda8418af57a20ad41c50f9a0.tar.bz2 |
Export stubs for libtommath; fix mingw compiler warnings
FossilOrigin-Name: 3842b9c46803a8677c011078725b04cff7adff2d
Diffstat (limited to 'generic/tclTomMathInterface.c')
-rw-r--r-- | generic/tclTomMathInterface.c | 79 |
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 /* *---------------------------------------------------------------------- |