From d2b7a7797a402493c3e257f8c83b27111c0770c0 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 28 Oct 2015 21:15:21 +0000 Subject: Expose some of the TclBN operations through the internal API, so clients of the bignum code don't need to use tclTomMath.h directly. --- generic/tclInt.h | 7 +------ generic/tclTomMath.decls | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index 356d250..f9d2edf 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4435,17 +4435,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/tclTomMath.decls b/generic/tclTomMath.decls index ea3abb1..8d9e05f 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: -- cgit v0.12