summaryrefslogtreecommitdiffstats
path: root/generic/tclStubInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclStubInit.c')
-rw-r--r--generic/tclStubInit.c396
1 files changed, 233 insertions, 163 deletions
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 85dfe1c..fd4a222 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -10,7 +10,7 @@
*/
#include "tclInt.h"
-#include "tclPort.h"
+#include "tommath.h"
/*
* Remove macros that will interfere with the definitions below.
@@ -66,12 +66,26 @@ int TclSockMinimumBuffersOld(sock, size)
int sock;
int size;
{
- return TclSockMinimumBuffers((void *) (size_t) sock, size);
+ return TclSockMinimumBuffers(INT2PTR(sock), size);
+}
+#endif
+
+MODULE_SCOPE TclIntStubs tclIntStubs;
+MODULE_SCOPE TclIntPlatStubs tclIntPlatStubs;
+MODULE_SCOPE TclPlatStubs tclPlatStubs;
+MODULE_SCOPE TclStubs tclStubs;
+MODULE_SCOPE TclTomMathStubs tclTomMathStubs;
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+#undef TclWinNToHS
+unsigned short TclWinNToHS(unsigned short ns) {
+ return ntohs(ns);
}
#endif
#ifdef __WIN32__
# define TclUnixWaitForFile 0
+# define TclUnixCopyFile 0
# define TclpReaddir 0
# define TclpIsAtty 0
#elif defined(__CYGWIN__)
@@ -98,12 +112,6 @@ TclWinGetPlatformId()
return 2; /* VER_PLATFORM_WIN32_NT */;
}
-TclPlatformType *
-TclWinGetPlatform()
-{
- return &tclPlatform;
-}
-
void *TclWinGetTclInstance()
{
void *hInstance = NULL;
@@ -112,12 +120,6 @@ void *TclWinGetTclInstance()
return hInstance;
}
-unsigned short
-TclWinNToHS(unsigned short ns)
-{
- return ntohs(ns);
-}
-
int
TclWinSetSockOpt(SOCKET s, int level, int optname,
const char *optval, int optlen)
@@ -190,7 +192,6 @@ Tcl_WinTCharToUtf(
}
#else /* UNIX and MAC */
-# define TclpGetPid 0
# define TclpLocaltime_unix TclpLocaltime
# define TclpGmtime_unix TclpGmtime
#endif
@@ -207,8 +208,8 @@ TclIntStubs tclIntStubs = {
TCL_STUB_MAGIC,
NULL,
NULL, /* 0 */
- TclAccessDeleteProc, /* 1 */
- TclAccessInsertProc, /* 2 */
+ NULL, /* 1 */
+ NULL, /* 2 */
TclAllocateFreeObjects, /* 3 */
NULL, /* 4 */
TclCleanupChildren, /* 5 */
@@ -219,7 +220,7 @@ TclIntStubs tclIntStubs = {
TclCreateProc, /* 10 */
TclDeleteCompiledLocalVars, /* 11 */
TclDeleteVars, /* 12 */
- TclDoGlob, /* 13 */
+ NULL, /* 13 */
TclDumpMemoryInfo, /* 14 */
NULL, /* 15 */
TclExprFloatError, /* 16 */
@@ -233,13 +234,13 @@ TclIntStubs tclIntStubs = {
TclFormatInt, /* 24 */
TclFreePackageInfo, /* 25 */
NULL, /* 26 */
- TclGetDate, /* 27 */
+ NULL, /* 27 */
TclpGetDefaultStdChannel, /* 28 */
NULL, /* 29 */
NULL, /* 30 */
TclGetExtension, /* 31 */
TclGetFrame, /* 32 */
- TclGetInterpProc, /* 33 */
+ NULL, /* 33 */
TclGetIntForIndex, /* 34 */
NULL, /* 35 */
TclGetLong, /* 36 */
@@ -249,16 +250,16 @@ TclIntStubs tclIntStubs = {
TclGetOpenMode, /* 40 */
TclGetOriginalCommand, /* 41 */
TclpGetUserHome, /* 42 */
- TclGlobalInvoke, /* 43 */
+ NULL, /* 43 */
TclGuessPackageName, /* 44 */
TclHideUnsafeCommands, /* 45 */
TclInExit, /* 46 */
NULL, /* 47 */
NULL, /* 48 */
- TclIncrVar2, /* 49 */
+ NULL, /* 49 */
TclInitCompiledLocals, /* 50 */
TclInterpInit, /* 51 */
- TclInvoke, /* 52 */
+ NULL, /* 52 */
TclInvokeObjectCommand, /* 53 */
TclInvokeStringCommand, /* 54 */
TclIsProc, /* 55 */
@@ -271,9 +272,9 @@ TclIntStubs tclIntStubs = {
TclObjCommandComplete, /* 62 */
TclObjInterpProc, /* 63 */
TclObjInvoke, /* 64 */
- TclObjInvokeGlobal, /* 65 */
- TclOpenFileChannelDeleteProc, /* 66 */
- TclOpenFileChannelInsertProc, /* 67 */
+ NULL, /* 65 */
+ NULL, /* 66 */
+ NULL, /* 67 */
NULL, /* 68 */
TclpAlloc, /* 69 */
NULL, /* 70 */
@@ -300,7 +301,7 @@ TclIntStubs tclIntStubs = {
TclProcCleanupProc, /* 91 */
TclProcCompileProc, /* 92 */
TclProcDeleteProc, /* 93 */
- TclProcInterpProc, /* 94 */
+ NULL, /* 94 */
NULL, /* 95 */
TclRenameCommand, /* 96 */
TclResetShadowedCmdRefs, /* 97 */
@@ -312,8 +313,8 @@ TclIntStubs tclIntStubs = {
TclSockGetPort, /* 103 */
TclSockMinimumBuffersOld, /* 104 */
NULL, /* 105 */
- TclStatDeleteProc, /* 106 */
- TclStatInsertProc, /* 107 */
+ NULL, /* 106 */
+ NULL, /* 107 */
TclTeardownNamespace, /* 108 */
TclUpdateReturnInfo, /* 109 */
TclSockMinimumBuffers, /* 110 */
@@ -340,13 +341,13 @@ TclIntStubs tclIntStubs = {
Tcl_SetNamespaceResolvers, /* 131 */
TclpHasSockets, /* 132 */
TclpGetDate, /* 133 */
- TclpStrftime, /* 134 */
- TclpCheckStackSpace, /* 135 */
+ NULL, /* 134 */
+ NULL, /* 135 */
NULL, /* 136 */
NULL, /* 137 */
TclGetEnv, /* 138 */
NULL, /* 139 */
- TclLooksLikeInt, /* 140 */
+ NULL, /* 140 */
TclpGetCwd, /* 141 */
TclSetByteCodeFromAny, /* 142 */
TclAddLiteralObj, /* 143 */
@@ -381,11 +382,11 @@ TclIntStubs tclIntStubs = {
TclInThreadExit, /* 172 */
TclUniCharMatch, /* 173 */
NULL, /* 174 */
- NULL, /* 175 */
- NULL, /* 176 */
- NULL, /* 177 */
- NULL, /* 178 */
- NULL, /* 179 */
+ TclCallVarTraces, /* 175 */
+ TclCleanupVar, /* 176 */
+ TclVarErrMsg, /* 177 */
+ Tcl_SetStartupScript, /* 178 */
+ Tcl_GetStartupScript, /* 179 */
NULL, /* 180 */
NULL, /* 181 */
TclpLocaltime, /* 182 */
@@ -404,58 +405,58 @@ TclIntStubs tclIntStubs = {
NULL, /* 195 */
NULL, /* 196 */
NULL, /* 197 */
- NULL, /* 198 */
- TclMatchIsTrivial, /* 199 */
- NULL, /* 200 */
- NULL, /* 201 */
- NULL, /* 202 */
- NULL, /* 203 */
- NULL, /* 204 */
- NULL, /* 205 */
- NULL, /* 206 */
- NULL, /* 207 */
- NULL, /* 208 */
+ TclObjGetFrame, /* 198 */
+ NULL, /* 199 */
+ TclpObjRemoveDirectory, /* 200 */
+ TclpObjCopyDirectory, /* 201 */
+ TclpObjCreateDirectory, /* 202 */
+ TclpObjDeleteFile, /* 203 */
+ TclpObjCopyFile, /* 204 */
+ TclpObjRenameFile, /* 205 */
+ TclpObjStat, /* 206 */
+ TclpObjAccess, /* 207 */
+ TclpOpenFileChannel, /* 208 */
NULL, /* 209 */
NULL, /* 210 */
NULL, /* 211 */
- NULL, /* 212 */
- NULL, /* 213 */
- NULL, /* 214 */
- NULL, /* 215 */
- NULL, /* 216 */
- NULL, /* 217 */
- NULL, /* 218 */
+ TclpFindExecutable, /* 212 */
+ TclGetObjNameOfExecutable, /* 213 */
+ TclSetObjNameOfExecutable, /* 214 */
+ TclStackAlloc, /* 215 */
+ TclStackFree, /* 216 */
+ TclPushStackFrame, /* 217 */
+ TclPopStackFrame, /* 218 */
NULL, /* 219 */
NULL, /* 220 */
NULL, /* 221 */
NULL, /* 222 */
NULL, /* 223 */
- NULL, /* 224 */
- NULL, /* 225 */
- NULL, /* 226 */
- NULL, /* 227 */
- NULL, /* 228 */
- NULL, /* 229 */
- NULL, /* 230 */
- NULL, /* 231 */
- NULL, /* 232 */
- NULL, /* 233 */
- NULL, /* 234 */
- NULL, /* 235 */
- NULL, /* 236 */
+ TclGetPlatform, /* 224 */
+ TclTraceDictPath, /* 225 */
+ TclObjBeingDeleted, /* 226 */
+ TclSetNsPath, /* 227 */
+ TclObjInterpProcCore, /* 228 */
+ TclPtrMakeUpvar, /* 229 */
+ TclObjLookupVar, /* 230 */
+ TclGetNamespaceFromObj, /* 231 */
+ TclEvalObjEx, /* 232 */
+ TclGetSrcInfoForPc, /* 233 */
+ TclVarHashCreateVar, /* 234 */
+ TclInitVarHashTable, /* 235 */
+ TclBackgroundException, /* 236 */
NULL, /* 237 */
NULL, /* 238 */
NULL, /* 239 */
NULL, /* 240 */
NULL, /* 241 */
NULL, /* 242 */
- NULL, /* 243 */
+ TclDbDumpActiveObjects, /* 243 */
NULL, /* 244 */
NULL, /* 245 */
NULL, /* 246 */
NULL, /* 247 */
NULL, /* 248 */
- TclUnusedStubEntry, /* 249 */
+ TclDoubleDigits, /* 249 */
};
TclIntPlatStubs tclIntPlatStubs = {
@@ -476,7 +477,7 @@ TclIntPlatStubs tclIntPlatStubs = {
TclpLocaltime_unix, /* 11 */
TclpGmtime_unix, /* 12 */
TclpInetNtoa, /* 13 */
- NULL, /* 14 */
+ TclUnixCopyFile, /* 14 */
NULL, /* 15 */
NULL, /* 16 */
NULL, /* 17 */
@@ -511,7 +512,7 @@ TclIntPlatStubs tclIntPlatStubs = {
TclpCreatePipe, /* 14 */
TclpCreateProcess, /* 15 */
TclpIsAtty, /* 16 */
- NULL, /* 17 */
+ TclUnixCopyFile, /* 17 */
TclpMakeFile, /* 18 */
TclpOpenFile, /* 19 */
TclWinAddProcess, /* 20 */
@@ -519,7 +520,7 @@ TclIntPlatStubs tclIntPlatStubs = {
TclpCreateTempFile, /* 22 */
TclpGetTZName, /* 23 */
TclWinNoBackslash, /* 24 */
- TclWinGetPlatform, /* 25 */
+ NULL, /* 25 */
TclWinSetInterfaces, /* 26 */
TclWinFlushDirtyChannels, /* 27 */
TclWinResetInterfaces, /* 28 */
@@ -540,12 +541,12 @@ TclIntPlatStubs tclIntPlatStubs = {
TclpLocaltime_unix, /* 11 */
TclpGmtime_unix, /* 12 */
TclpInetNtoa, /* 13 */
- NULL, /* 14 */
- NULL, /* 15 */
- NULL, /* 16 */
- NULL, /* 17 */
- NULL, /* 18 */
- NULL, /* 19 */
+ TclUnixCopyFile, /* 14 */
+ TclMacOSXGetFileAttribute, /* 15 */
+ TclMacOSXSetFileAttribute, /* 16 */
+ TclMacOSXCopyFileAttributes, /* 17 */
+ TclMacOSXMatchType, /* 18 */
+ TclMacOSXNotifierAddRunLoopMode, /* 19 */
NULL, /* 20 */
NULL, /* 21 */
NULL, /* 22 */
@@ -572,6 +573,75 @@ TclPlatStubs tclPlatStubs = {
#endif /* MACOSX */
};
+TclTomMathStubs tclTomMathStubs = {
+ TCL_STUB_MAGIC,
+ NULL,
+ TclBN_epoch, /* 0 */
+ TclBN_revision, /* 1 */
+ TclBN_mp_add, /* 2 */
+ TclBN_mp_add_d, /* 3 */
+ TclBN_mp_and, /* 4 */
+ TclBN_mp_clamp, /* 5 */
+ TclBN_mp_clear, /* 6 */
+ TclBN_mp_clear_multi, /* 7 */
+ TclBN_mp_cmp, /* 8 */
+ TclBN_mp_cmp_d, /* 9 */
+ TclBN_mp_cmp_mag, /* 10 */
+ TclBN_mp_copy, /* 11 */
+ TclBN_mp_count_bits, /* 12 */
+ TclBN_mp_div, /* 13 */
+ TclBN_mp_div_d, /* 14 */
+ TclBN_mp_div_2, /* 15 */
+ TclBN_mp_div_2d, /* 16 */
+ TclBN_mp_div_3, /* 17 */
+ TclBN_mp_exch, /* 18 */
+ TclBN_mp_expt_d, /* 19 */
+ TclBN_mp_grow, /* 20 */
+ TclBN_mp_init, /* 21 */
+ TclBN_mp_init_copy, /* 22 */
+ TclBN_mp_init_multi, /* 23 */
+ TclBN_mp_init_set, /* 24 */
+ TclBN_mp_init_size, /* 25 */
+ TclBN_mp_lshd, /* 26 */
+ TclBN_mp_mod, /* 27 */
+ TclBN_mp_mod_2d, /* 28 */
+ TclBN_mp_mul, /* 29 */
+ TclBN_mp_mul_d, /* 30 */
+ TclBN_mp_mul_2, /* 31 */
+ TclBN_mp_mul_2d, /* 32 */
+ TclBN_mp_neg, /* 33 */
+ TclBN_mp_or, /* 34 */
+ TclBN_mp_radix_size, /* 35 */
+ TclBN_mp_read_radix, /* 36 */
+ TclBN_mp_rshd, /* 37 */
+ TclBN_mp_shrink, /* 38 */
+ TclBN_mp_set, /* 39 */
+ TclBN_mp_sqr, /* 40 */
+ TclBN_mp_sqrt, /* 41 */
+ TclBN_mp_sub, /* 42 */
+ TclBN_mp_sub_d, /* 43 */
+ TclBN_mp_to_unsigned_bin, /* 44 */
+ TclBN_mp_to_unsigned_bin_n, /* 45 */
+ TclBN_mp_toradix_n, /* 46 */
+ TclBN_mp_unsigned_bin_size, /* 47 */
+ TclBN_mp_xor, /* 48 */
+ TclBN_mp_zero, /* 49 */
+ TclBN_reverse, /* 50 */
+ TclBN_fast_s_mp_mul_digs, /* 51 */
+ TclBN_fast_s_mp_sqr, /* 52 */
+ TclBN_mp_karatsuba_mul, /* 53 */
+ TclBN_mp_karatsuba_sqr, /* 54 */
+ TclBN_mp_toom_mul, /* 55 */
+ TclBN_mp_toom_sqr, /* 56 */
+ TclBN_s_mp_add, /* 57 */
+ TclBN_s_mp_mul_digs, /* 58 */
+ TclBN_s_mp_sqr, /* 59 */
+ TclBN_s_mp_sub, /* 60 */
+ TclBN_mp_init_set_int, /* 61 */
+ TclBN_mp_set_int, /* 62 */
+ TclBN_mp_cnt_lsb, /* 63 */
+};
+
static TclStubHooks tclStubHooks = {
&tclPlatStubs,
&tclIntStubs,
@@ -1099,92 +1169,92 @@ TclStubs tclStubs = {
Tcl_Seek, /* 491 */
Tcl_Tell, /* 492 */
Tcl_ChannelWideSeekProc, /* 493 */
- NULL, /* 494 */
- NULL, /* 495 */
- NULL, /* 496 */
- NULL, /* 497 */
- NULL, /* 498 */
- NULL, /* 499 */
- NULL, /* 500 */
- NULL, /* 501 */
- NULL, /* 502 */
- NULL, /* 503 */
- NULL, /* 504 */
- NULL, /* 505 */
- NULL, /* 506 */
- NULL, /* 507 */
- NULL, /* 508 */
- NULL, /* 509 */
- NULL, /* 510 */
- NULL, /* 511 */
- NULL, /* 512 */
- NULL, /* 513 */
- NULL, /* 514 */
- NULL, /* 515 */
- NULL, /* 516 */
- NULL, /* 517 */
- NULL, /* 518 */
- NULL, /* 519 */
- NULL, /* 520 */
- NULL, /* 521 */
- NULL, /* 522 */
- NULL, /* 523 */
- NULL, /* 524 */
- NULL, /* 525 */
- NULL, /* 526 */
- NULL, /* 527 */
- NULL, /* 528 */
- NULL, /* 529 */
- NULL, /* 530 */
- NULL, /* 531 */
- NULL, /* 532 */
- NULL, /* 533 */
- NULL, /* 534 */
- NULL, /* 535 */
- NULL, /* 536 */
- NULL, /* 537 */
- NULL, /* 538 */
- NULL, /* 539 */
- NULL, /* 540 */
- NULL, /* 541 */
- NULL, /* 542 */
- NULL, /* 543 */
- NULL, /* 544 */
- NULL, /* 545 */
- NULL, /* 546 */
- NULL, /* 547 */
- NULL, /* 548 */
- NULL, /* 549 */
- NULL, /* 550 */
- NULL, /* 551 */
- NULL, /* 552 */
- NULL, /* 553 */
+ Tcl_DictObjPut, /* 494 */
+ Tcl_DictObjGet, /* 495 */
+ Tcl_DictObjRemove, /* 496 */
+ Tcl_DictObjSize, /* 497 */
+ Tcl_DictObjFirst, /* 498 */
+ Tcl_DictObjNext, /* 499 */
+ Tcl_DictObjDone, /* 500 */
+ Tcl_DictObjPutKeyList, /* 501 */
+ Tcl_DictObjRemoveKeyList, /* 502 */
+ Tcl_NewDictObj, /* 503 */
+ Tcl_DbNewDictObj, /* 504 */
+ Tcl_RegisterConfig, /* 505 */
+ Tcl_CreateNamespace, /* 506 */
+ Tcl_DeleteNamespace, /* 507 */
+ Tcl_AppendExportList, /* 508 */
+ Tcl_Export, /* 509 */
+ Tcl_Import, /* 510 */
+ Tcl_ForgetImport, /* 511 */
+ Tcl_GetCurrentNamespace, /* 512 */
+ Tcl_GetGlobalNamespace, /* 513 */
+ Tcl_FindNamespace, /* 514 */
+ Tcl_FindCommand, /* 515 */
+ Tcl_GetCommandFromObj, /* 516 */
+ Tcl_GetCommandFullName, /* 517 */
+ Tcl_FSEvalFileEx, /* 518 */
+ Tcl_SetExitProc, /* 519 */
+ Tcl_LimitAddHandler, /* 520 */
+ Tcl_LimitRemoveHandler, /* 521 */
+ Tcl_LimitReady, /* 522 */
+ Tcl_LimitCheck, /* 523 */
+ Tcl_LimitExceeded, /* 524 */
+ Tcl_LimitSetCommands, /* 525 */
+ Tcl_LimitSetTime, /* 526 */
+ Tcl_LimitSetGranularity, /* 527 */
+ Tcl_LimitTypeEnabled, /* 528 */
+ Tcl_LimitTypeExceeded, /* 529 */
+ Tcl_LimitTypeSet, /* 530 */
+ Tcl_LimitTypeReset, /* 531 */
+ Tcl_LimitGetCommands, /* 532 */
+ Tcl_LimitGetTime, /* 533 */
+ Tcl_LimitGetGranularity, /* 534 */
+ Tcl_SaveInterpState, /* 535 */
+ Tcl_RestoreInterpState, /* 536 */
+ Tcl_DiscardInterpState, /* 537 */
+ Tcl_SetReturnOptions, /* 538 */
+ Tcl_GetReturnOptions, /* 539 */
+ Tcl_IsEnsemble, /* 540 */
+ Tcl_CreateEnsemble, /* 541 */
+ Tcl_FindEnsemble, /* 542 */
+ Tcl_SetEnsembleSubcommandList, /* 543 */
+ Tcl_SetEnsembleMappingDict, /* 544 */
+ Tcl_SetEnsembleUnknownHandler, /* 545 */
+ Tcl_SetEnsembleFlags, /* 546 */
+ Tcl_GetEnsembleSubcommandList, /* 547 */
+ Tcl_GetEnsembleMappingDict, /* 548 */
+ Tcl_GetEnsembleUnknownHandler, /* 549 */
+ Tcl_GetEnsembleFlags, /* 550 */
+ Tcl_GetEnsembleNamespace, /* 551 */
+ Tcl_SetTimeProc, /* 552 */
+ Tcl_QueryTimeProc, /* 553 */
Tcl_ChannelThreadActionProc, /* 554 */
- NULL, /* 555 */
- NULL, /* 556 */
- NULL, /* 557 */
- NULL, /* 558 */
- NULL, /* 559 */
- NULL, /* 560 */
- NULL, /* 561 */
- NULL, /* 562 */
- NULL, /* 563 */
- NULL, /* 564 */
- NULL, /* 565 */
- NULL, /* 566 */
- NULL, /* 567 */
- NULL, /* 568 */
- NULL, /* 569 */
- NULL, /* 570 */
- NULL, /* 571 */
- NULL, /* 572 */
+ Tcl_NewBignumObj, /* 555 */
+ Tcl_DbNewBignumObj, /* 556 */
+ Tcl_SetBignumObj, /* 557 */
+ Tcl_GetBignumFromObj, /* 558 */
+ Tcl_TakeBignumFromObj, /* 559 */
+ Tcl_TruncateChannel, /* 560 */
+ Tcl_ChannelTruncateProc, /* 561 */
+ Tcl_SetChannelErrorInterp, /* 562 */
+ Tcl_GetChannelErrorInterp, /* 563 */
+ Tcl_SetChannelError, /* 564 */
+ Tcl_GetChannelError, /* 565 */
+ Tcl_InitBignumFromDouble, /* 566 */
+ Tcl_GetNamespaceUnknownHandler, /* 567 */
+ Tcl_SetNamespaceUnknownHandler, /* 568 */
+ Tcl_GetEncodingFromObj, /* 569 */
+ Tcl_GetEncodingSearchPath, /* 570 */
+ Tcl_SetEncodingSearchPath, /* 571 */
+ Tcl_GetEncodingNameFromEnvironment, /* 572 */
Tcl_PkgRequireProc, /* 573 */
- NULL, /* 574 */
- NULL, /* 575 */
- NULL, /* 576 */
- NULL, /* 577 */
- NULL, /* 578 */
- NULL, /* 579 */
+ Tcl_AppendObjToErrorInfo, /* 574 */
+ Tcl_AppendLimitedToObj, /* 575 */
+ Tcl_Format, /* 576 */
+ Tcl_AppendFormatToObj, /* 577 */
+ Tcl_ObjPrintf, /* 578 */
+ Tcl_AppendPrintfToObj, /* 579 */
NULL, /* 580 */
NULL, /* 581 */
NULL, /* 582 */