diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-11-01 22:22:24 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-11-01 22:22:24 (GMT) |
commit | 7e5a0b2c65911122445120f1eecbe93e777b5642 (patch) | |
tree | 87e4ead14ff22ef455b4d2421d64e139f589feeb | |
parent | cc6e483540da9b2a79ef806bed5736d0d0f1a15f (diff) | |
parent | 573cabc6d240f1e84a271373810ae254a2dd4791 (diff) | |
download | tcl-7e5a0b2c65911122445120f1eecbe93e777b5642.zip tcl-7e5a0b2c65911122445120f1eecbe93e777b5642.tar.gz tcl-7e5a0b2c65911122445120f1eecbe93e777b5642.tar.bz2 |
merge trunk
-rw-r--r-- | generic/tclInt.h | 7 | ||||
-rw-r--r-- | generic/tclStubInit.c | 3 | ||||
-rw-r--r-- | generic/tclTomMath.decls | 23 | ||||
-rw-r--r-- | generic/tclTomMathDecls.h | 17 |
4 files changed, 40 insertions, 10 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 8716b75..f99858a 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4393,17 +4393,12 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, /* *---------------------------------------------------------------------- * - * Core procedures added to libtommath for bignum manipulation. + * Core procedure added to libtommath for bignum manipulation. * *---------------------------------------------------------------------- */ MODULE_SCOPE Tcl_PackageInitProc TclTommath_Init; -MODULE_SCOPE void TclBNInitBignumFromLong(mp_int *bignum, long initVal); -MODULE_SCOPE void TclBNInitBignumFromWideInt(mp_int *bignum, - Tcl_WideInt initVal); -MODULE_SCOPE void TclBNInitBignumFromWideUInt(mp_int *bignum, - Tcl_WideUInt initVal); /* *---------------------------------------------------------------------- diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 311c681..cd24485 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -680,6 +680,9 @@ const TclTomMathStubs tclTomMathStubs = { TclBN_mp_init_set_int, /* 61 */ TclBN_mp_set_int, /* 62 */ TclBN_mp_cnt_lsb, /* 63 */ + TclBNInitBignumFromLong, /* 64 */ + TclBNInitBignumFromWideInt, /* 65 */ + TclBNInitBignumFromWideUInt, /* 66 */ }; static const TclStubHooks tclStubHooks = { diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls index 2124378..1ff12b3 100644 --- a/generic/tclTomMath.decls +++ b/generic/tclTomMath.decls @@ -1,9 +1,8 @@ # tclTomMath.decls -- # -# This file contains the declarations for the functions in -# 'libtommath' that are contained within the Tcl library. -# This file is used to generate the 'tclTomMathDecls.h' and -# 'tclTomMathStub.c' files. +# This file contains the declarations for the functions in 'libtommath' +# that are contained within the Tcl library. This file is used to +# generate the 'tclTomMathDecls.h' and 'tclTomMathStub.c' files. # # If you edit this file, advance the revision number (and the epoch # if the new stubs are not backward compatible) in tclTomMathDecls.h @@ -221,3 +220,19 @@ declare 62 { declare 63 { int TclBN_mp_cnt_lsb(const mp_int *a) } + +# Formerly internal API to allow initialisation of bignums without knowing the +# typedefs of how a bignum works internally. +declare 64 { + void TclBNInitBignumFromLong(mp_int *bignum, long initVal) +} +declare 65 { + void TclBNInitBignumFromWideInt(mp_int *bignum, Tcl_WideInt initVal) +} +declare 66 { + void TclBNInitBignumFromWideUInt(mp_int *bignum, Tcl_WideUInt initVal) +} + +# Local Variables: +# mode: tcl +# End: diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index 66b149a..caf8ca8 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -268,6 +268,14 @@ TCLAPI int TclBN_mp_init_set_int(mp_int *a, unsigned long i); TCLAPI int TclBN_mp_set_int(mp_int *a, unsigned long i); /* 63 */ TCLAPI int TclBN_mp_cnt_lsb(const mp_int *a); +/* 64 */ +TCLAPI void TclBNInitBignumFromLong(mp_int *bignum, long initVal); +/* 65 */ +TCLAPI void TclBNInitBignumFromWideInt(mp_int *bignum, + Tcl_WideInt initVal); +/* 66 */ +TCLAPI void TclBNInitBignumFromWideUInt(mp_int *bignum, + Tcl_WideUInt initVal); typedef struct TclTomMathStubs { int magic; @@ -337,6 +345,9 @@ typedef struct TclTomMathStubs { int (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */ int (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */ int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */ + void (*tclBNInitBignumFromLong) (mp_int *bignum, long initVal); /* 64 */ + void (*tclBNInitBignumFromWideInt) (mp_int *bignum, Tcl_WideInt initVal); /* 65 */ + void (*tclBNInitBignumFromWideUInt) (mp_int *bignum, Tcl_WideUInt initVal); /* 66 */ } TclTomMathStubs; extern const TclTomMathStubs *tclTomMathStubsPtr; @@ -479,6 +490,12 @@ extern const TclTomMathStubs *tclTomMathStubsPtr; (tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */ #define TclBN_mp_cnt_lsb \ (tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */ +#define TclBNInitBignumFromLong \ + (tclTomMathStubsPtr->tclBNInitBignumFromLong) /* 64 */ +#define TclBNInitBignumFromWideInt \ + (tclTomMathStubsPtr->tclBNInitBignumFromWideInt) /* 65 */ +#define TclBNInitBignumFromWideUInt \ + (tclTomMathStubsPtr->tclBNInitBignumFromWideUInt) /* 66 */ #endif /* defined(USE_TCL_STUBS) */ |