summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-09-08 17:03:58 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-09-08 17:03:58 (GMT)
commit40ab3bd07ca11069b583be7177eea10c9c1986ec (patch)
tree600cebe21594b5987414e9e1dd5c89587a89d380 /generic
parentb53a04548e71d0ecf88493b1b5b78befc220ee32 (diff)
downloadtcl-40ab3bd07ca11069b583be7177eea10c9c1986ec.zip
tcl-40ab3bd07ca11069b583be7177eea10c9c1986ec.tar.gz
tcl-40ab3bd07ca11069b583be7177eea10c9c1986ec.tar.bz2
* generic/tclBasic.c (Tcl_CreateInterp): Removed obsolete
field for storing the string-based command procedure of built-in commands. We no longer have any string-based built-in commands!
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c339
1 files changed, 111 insertions, 228 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 63b709a..83bc4a6 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.112 2004/08/18 19:58:58 kennykb Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.113 2004/09/08 17:04:01 dgp Exp $
*/
#include "tclInt.h"
@@ -38,7 +38,6 @@ extern TclStubs tclStubs;
typedef struct {
char *name; /* Name of object-based command. */
- Tcl_CmdProc *proc; /* String-based procedure for command. */
Tcl_ObjCmdProc *objProc; /* Object-based procedure for command. */
CompileProc *compileProc; /* Procedure called to compile command. */
int isSafe; /* If non-zero, command will be present
@@ -52,207 +51,99 @@ typedef struct {
static CmdInfo builtInCmds[] = {
/*
- * Commands in the generic core. Note that at least one of the proc or
- * objProc members should be non-NULL. This avoids infinitely recursive
- * calls between TclInvokeObjectCommand and TclInvokeStringCommand if a
- * command name is computed at runtime and results in the name of a
- * compiled command.
+ * Commands in the generic core.
*/
- {"append", (Tcl_CmdProc *) NULL, Tcl_AppendObjCmd,
- TclCompileAppendCmd, 1},
- {"array", (Tcl_CmdProc *) NULL, Tcl_ArrayObjCmd,
- (CompileProc *) NULL, 1},
- {"binary", (Tcl_CmdProc *) NULL, Tcl_BinaryObjCmd,
- (CompileProc *) NULL, 1},
- {"break", (Tcl_CmdProc *) NULL, Tcl_BreakObjCmd,
- TclCompileBreakCmd, 1},
- {"case", (Tcl_CmdProc *) NULL, Tcl_CaseObjCmd,
- (CompileProc *) NULL, 1},
- {"catch", (Tcl_CmdProc *) NULL, Tcl_CatchObjCmd,
- TclCompileCatchCmd, 1},
- {"concat", (Tcl_CmdProc *) NULL, Tcl_ConcatObjCmd,
- (CompileProc *) NULL, 1},
- {"continue", (Tcl_CmdProc *) NULL, Tcl_ContinueObjCmd,
- TclCompileContinueCmd, 1},
- {"dict", (Tcl_CmdProc *) NULL, Tcl_DictObjCmd,
- (CompileProc *) NULL, 1},
- {"encoding", (Tcl_CmdProc *) NULL, Tcl_EncodingObjCmd,
- (CompileProc *) NULL, 0},
- {"error", (Tcl_CmdProc *) NULL, Tcl_ErrorObjCmd,
- (CompileProc *) NULL, 1},
- {"eval", (Tcl_CmdProc *) NULL, Tcl_EvalObjCmd,
- (CompileProc *) NULL, 1},
- {"exit", (Tcl_CmdProc *) NULL, Tcl_ExitObjCmd,
- (CompileProc *) NULL, 0},
- {"expr", (Tcl_CmdProc *) NULL, Tcl_ExprObjCmd,
- TclCompileExprCmd, 1},
- {"fcopy", (Tcl_CmdProc *) NULL, Tcl_FcopyObjCmd,
- (CompileProc *) NULL, 1},
- {"fileevent", (Tcl_CmdProc *) NULL, Tcl_FileEventObjCmd,
- (CompileProc *) NULL, 1},
- {"for", (Tcl_CmdProc *) NULL, Tcl_ForObjCmd,
- TclCompileForCmd, 1},
- {"foreach", (Tcl_CmdProc *) NULL, Tcl_ForeachObjCmd,
- TclCompileForeachCmd, 1},
- {"format", (Tcl_CmdProc *) NULL, Tcl_FormatObjCmd,
- (CompileProc *) NULL, 1},
- {"global", (Tcl_CmdProc *) NULL, Tcl_GlobalObjCmd,
- (CompileProc *) NULL, 1},
- {"if", (Tcl_CmdProc *) NULL, Tcl_IfObjCmd,
- TclCompileIfCmd, 1},
- {"incr", (Tcl_CmdProc *) NULL, Tcl_IncrObjCmd,
- TclCompileIncrCmd, 1},
- {"info", (Tcl_CmdProc *) NULL, Tcl_InfoObjCmd,
- (CompileProc *) NULL, 1},
- {"join", (Tcl_CmdProc *) NULL, Tcl_JoinObjCmd,
- (CompileProc *) NULL, 1},
- {"lappend", (Tcl_CmdProc *) NULL, Tcl_LappendObjCmd,
- TclCompileLappendCmd, 1},
- {"lassign", (Tcl_CmdProc *) NULL, Tcl_LassignObjCmd,
- TclCompileLassignCmd, 1},
- {"lindex", (Tcl_CmdProc *) NULL, Tcl_LindexObjCmd,
- TclCompileLindexCmd, 1},
- {"linsert", (Tcl_CmdProc *) NULL, Tcl_LinsertObjCmd,
- (CompileProc *) NULL, 1},
- {"list", (Tcl_CmdProc *) NULL, Tcl_ListObjCmd,
- TclCompileListCmd, 1},
- {"llength", (Tcl_CmdProc *) NULL, Tcl_LlengthObjCmd,
- TclCompileLlengthCmd, 1},
- {"load", (Tcl_CmdProc *) NULL, Tcl_LoadObjCmd,
- (CompileProc *) NULL, 0},
- {"lrange", (Tcl_CmdProc *) NULL, Tcl_LrangeObjCmd,
- (CompileProc *) NULL, 1},
- {"lrepeat", (Tcl_CmdProc *) NULL, Tcl_LrepeatObjCmd,
- (CompileProc *) NULL, 1},
- {"lreplace", (Tcl_CmdProc *) NULL, Tcl_LreplaceObjCmd,
- (CompileProc *) NULL, 1},
- {"lsearch", (Tcl_CmdProc *) NULL, Tcl_LsearchObjCmd,
- (CompileProc *) NULL, 1},
- {"lset", (Tcl_CmdProc *) NULL, Tcl_LsetObjCmd,
- TclCompileLsetCmd, 1},
- {"lsort", (Tcl_CmdProc *) NULL, Tcl_LsortObjCmd,
- (CompileProc *) NULL, 1},
- {"namespace", (Tcl_CmdProc *) NULL, Tcl_NamespaceObjCmd,
- (CompileProc *) NULL, 1},
- {"package", (Tcl_CmdProc *) NULL, Tcl_PackageObjCmd,
- (CompileProc *) NULL, 1},
- {"proc", (Tcl_CmdProc *) NULL, Tcl_ProcObjCmd,
- (CompileProc *) NULL, 1},
- {"regexp", (Tcl_CmdProc *) NULL, Tcl_RegexpObjCmd,
- TclCompileRegexpCmd, 1},
- {"regsub", (Tcl_CmdProc *) NULL, Tcl_RegsubObjCmd,
- (CompileProc *) NULL, 1},
- {"rename", (Tcl_CmdProc *) NULL, Tcl_RenameObjCmd,
- (CompileProc *) NULL, 1},
- {"return", (Tcl_CmdProc *) NULL, Tcl_ReturnObjCmd,
- TclCompileReturnCmd, 1},
- {"scan", (Tcl_CmdProc *) NULL, Tcl_ScanObjCmd,
- (CompileProc *) NULL, 1},
- {"set", (Tcl_CmdProc *) NULL, Tcl_SetObjCmd,
- TclCompileSetCmd, 1},
- {"split", (Tcl_CmdProc *) NULL, Tcl_SplitObjCmd,
- (CompileProc *) NULL, 1},
- {"string", (Tcl_CmdProc *) NULL, Tcl_StringObjCmd,
- TclCompileStringCmd, 1},
- {"subst", (Tcl_CmdProc *) NULL, Tcl_SubstObjCmd,
- (CompileProc *) NULL, 1},
- {"switch", (Tcl_CmdProc *) NULL, Tcl_SwitchObjCmd,
- TclCompileSwitchCmd, 1},
- {"trace", (Tcl_CmdProc *) NULL, Tcl_TraceObjCmd,
- (CompileProc *) NULL, 1},
- {"unload", (Tcl_CmdProc *) NULL, Tcl_UnloadObjCmd,
- (CompileProc *) NULL, 1},
- {"unset", (Tcl_CmdProc *) NULL, Tcl_UnsetObjCmd,
- (CompileProc *) NULL, 1},
- {"uplevel", (Tcl_CmdProc *) NULL, Tcl_UplevelObjCmd,
- (CompileProc *) NULL, 1},
- {"upvar", (Tcl_CmdProc *) NULL, Tcl_UpvarObjCmd,
- (CompileProc *) NULL, 1},
- {"variable", (Tcl_CmdProc *) NULL, Tcl_VariableObjCmd,
- (CompileProc *) NULL, 1},
- {"while", (Tcl_CmdProc *) NULL, Tcl_WhileObjCmd,
- TclCompileWhileCmd, 1},
+ {"append", Tcl_AppendObjCmd, TclCompileAppendCmd, 1},
+ {"array", Tcl_ArrayObjCmd, (CompileProc *) NULL, 1},
+ {"binary", Tcl_BinaryObjCmd, (CompileProc *) NULL, 1},
+ {"break", Tcl_BreakObjCmd, TclCompileBreakCmd, 1},
+ {"case", Tcl_CaseObjCmd, (CompileProc *) NULL, 1},
+ {"catch", Tcl_CatchObjCmd, TclCompileCatchCmd, 1},
+ {"concat", Tcl_ConcatObjCmd, (CompileProc *) NULL, 1},
+ {"continue", Tcl_ContinueObjCmd, TclCompileContinueCmd, 1},
+ {"dict", Tcl_DictObjCmd, (CompileProc *) NULL, 1},
+ {"encoding", Tcl_EncodingObjCmd, (CompileProc *) NULL, 0},
+ {"error", Tcl_ErrorObjCmd, (CompileProc *) NULL, 1},
+ {"eval", Tcl_EvalObjCmd, (CompileProc *) NULL, 1},
+ {"exit", Tcl_ExitObjCmd, (CompileProc *) NULL, 0},
+ {"expr", Tcl_ExprObjCmd, TclCompileExprCmd, 1},
+ {"fcopy", Tcl_FcopyObjCmd, (CompileProc *) NULL, 1},
+ {"fileevent", Tcl_FileEventObjCmd, (CompileProc *) NULL, 1},
+ {"for", Tcl_ForObjCmd, TclCompileForCmd, 1},
+ {"foreach", Tcl_ForeachObjCmd, TclCompileForeachCmd, 1},
+ {"format", Tcl_FormatObjCmd, (CompileProc *) NULL, 1},
+ {"global", Tcl_GlobalObjCmd, (CompileProc *) NULL, 1},
+ {"if", Tcl_IfObjCmd, TclCompileIfCmd, 1},
+ {"incr", Tcl_IncrObjCmd, TclCompileIncrCmd, 1},
+ {"info", Tcl_InfoObjCmd, (CompileProc *) NULL, 1},
+ {"join", Tcl_JoinObjCmd, (CompileProc *) NULL, 1},
+ {"lappend", Tcl_LappendObjCmd, TclCompileLappendCmd, 1},
+ {"lassign", Tcl_LassignObjCmd, TclCompileLassignCmd, 1},
+ {"lindex", Tcl_LindexObjCmd, TclCompileLindexCmd, 1},
+ {"linsert", Tcl_LinsertObjCmd, (CompileProc *) NULL, 1},
+ {"list", Tcl_ListObjCmd, TclCompileListCmd, 1},
+ {"llength", Tcl_LlengthObjCmd, TclCompileLlengthCmd, 1},
+ {"load", Tcl_LoadObjCmd, (CompileProc *) NULL, 0},
+ {"lrange", Tcl_LrangeObjCmd, (CompileProc *) NULL, 1},
+ {"lrepeat", Tcl_LrepeatObjCmd, (CompileProc *) NULL, 1},
+ {"lreplace", Tcl_LreplaceObjCmd, (CompileProc *) NULL, 1},
+ {"lsearch", Tcl_LsearchObjCmd, (CompileProc *) NULL, 1},
+ {"lset", Tcl_LsetObjCmd, TclCompileLsetCmd, 1},
+ {"lsort", Tcl_LsortObjCmd, (CompileProc *) NULL, 1},
+ {"namespace", Tcl_NamespaceObjCmd, (CompileProc *) NULL, 1},
+ {"package", Tcl_PackageObjCmd, (CompileProc *) NULL, 1},
+ {"proc", Tcl_ProcObjCmd, (CompileProc *) NULL, 1},
+ {"regexp", Tcl_RegexpObjCmd, TclCompileRegexpCmd, 1},
+ {"regsub", Tcl_RegsubObjCmd, (CompileProc *) NULL, 1},
+ {"rename", Tcl_RenameObjCmd, (CompileProc *) NULL, 1},
+ {"return", Tcl_ReturnObjCmd, TclCompileReturnCmd, 1},
+ {"scan", Tcl_ScanObjCmd, (CompileProc *) NULL, 1},
+ {"set", Tcl_SetObjCmd, TclCompileSetCmd, 1},
+ {"split", Tcl_SplitObjCmd, (CompileProc *) NULL, 1},
+ {"string", Tcl_StringObjCmd, TclCompileStringCmd, 1},
+ {"subst", Tcl_SubstObjCmd, (CompileProc *) NULL, 1},
+ {"switch", Tcl_SwitchObjCmd, TclCompileSwitchCmd, 1},
+ {"trace", Tcl_TraceObjCmd, (CompileProc *) NULL, 1},
+ {"unload", Tcl_UnloadObjCmd, (CompileProc *) NULL, 1},
+ {"unset", Tcl_UnsetObjCmd, (CompileProc *) NULL, 1},
+ {"uplevel", Tcl_UplevelObjCmd, (CompileProc *) NULL, 1},
+ {"upvar", Tcl_UpvarObjCmd, (CompileProc *) NULL, 1},
+ {"variable", Tcl_VariableObjCmd, (CompileProc *) NULL, 1},
+ {"while", Tcl_WhileObjCmd, TclCompileWhileCmd, 1},
/*
* Commands in the UNIX core:
*/
#ifndef TCL_GENERIC_ONLY
- {"after", (Tcl_CmdProc *) NULL, Tcl_AfterObjCmd,
- (CompileProc *) NULL, 1},
- {"cd", (Tcl_CmdProc *) NULL, Tcl_CdObjCmd,
- (CompileProc *) NULL, 0},
- {"close", (Tcl_CmdProc *) NULL, Tcl_CloseObjCmd,
- (CompileProc *) NULL, 1},
- {"eof", (Tcl_CmdProc *) NULL, Tcl_EofObjCmd,
- (CompileProc *) NULL, 1},
- {"fblocked", (Tcl_CmdProc *) NULL, Tcl_FblockedObjCmd,
- (CompileProc *) NULL, 1},
- {"fconfigure", (Tcl_CmdProc *) NULL, Tcl_FconfigureObjCmd,
- (CompileProc *) NULL, 0},
- {"file", (Tcl_CmdProc *) NULL, Tcl_FileObjCmd,
- (CompileProc *) NULL, 0},
- {"flush", (Tcl_CmdProc *) NULL, Tcl_FlushObjCmd,
- (CompileProc *) NULL, 1},
- {"gets", (Tcl_CmdProc *) NULL, Tcl_GetsObjCmd,
- (CompileProc *) NULL, 1},
- {"glob", (Tcl_CmdProc *) NULL, Tcl_GlobObjCmd,
- (CompileProc *) NULL, 0},
- {"open", (Tcl_CmdProc *) NULL, Tcl_OpenObjCmd,
- (CompileProc *) NULL, 0},
- {"pid", (Tcl_CmdProc *) NULL, Tcl_PidObjCmd,
- (CompileProc *) NULL, 1},
- {"puts", (Tcl_CmdProc *) NULL, Tcl_PutsObjCmd,
- (CompileProc *) NULL, 1},
- {"pwd", (Tcl_CmdProc *) NULL, Tcl_PwdObjCmd,
- (CompileProc *) NULL, 0},
- {"read", (Tcl_CmdProc *) NULL, Tcl_ReadObjCmd,
- (CompileProc *) NULL, 1},
- {"seek", (Tcl_CmdProc *) NULL, Tcl_SeekObjCmd,
- (CompileProc *) NULL, 1},
- {"socket", (Tcl_CmdProc *) NULL, Tcl_SocketObjCmd,
- (CompileProc *) NULL, 0},
- {"tell", (Tcl_CmdProc *) NULL, Tcl_TellObjCmd,
- (CompileProc *) NULL, 1},
- {"time", (Tcl_CmdProc *) NULL, Tcl_TimeObjCmd,
- (CompileProc *) NULL, 1},
- {"update", (Tcl_CmdProc *) NULL, Tcl_UpdateObjCmd,
- (CompileProc *) NULL, 1},
- {"vwait", (Tcl_CmdProc *) NULL, Tcl_VwaitObjCmd,
- (CompileProc *) NULL, 1},
- {"exec", (Tcl_CmdProc *) NULL, Tcl_ExecObjCmd,
- (CompileProc *) NULL, 0},
- {"source", (Tcl_CmdProc *) NULL, Tcl_SourceObjCmd,
- (CompileProc *) NULL, 0},
+ {"after", Tcl_AfterObjCmd, (CompileProc *) NULL, 1},
+ {"cd", Tcl_CdObjCmd, (CompileProc *) NULL, 0},
+ {"close", Tcl_CloseObjCmd, (CompileProc *) NULL, 1},
+ {"eof", Tcl_EofObjCmd, (CompileProc *) NULL, 1},
+ {"fblocked", Tcl_FblockedObjCmd, (CompileProc *) NULL, 1},
+ {"fconfigure", Tcl_FconfigureObjCmd, (CompileProc *) NULL, 0},
+ {"file", Tcl_FileObjCmd, (CompileProc *) NULL, 0},
+ {"flush", Tcl_FlushObjCmd, (CompileProc *) NULL, 1},
+ {"gets", Tcl_GetsObjCmd, (CompileProc *) NULL, 1},
+ {"glob", Tcl_GlobObjCmd, (CompileProc *) NULL, 0},
+ {"open", Tcl_OpenObjCmd, (CompileProc *) NULL, 0},
+ {"pid", Tcl_PidObjCmd, (CompileProc *) NULL, 1},
+ {"puts", Tcl_PutsObjCmd, (CompileProc *) NULL, 1},
+ {"pwd", Tcl_PwdObjCmd, (CompileProc *) NULL, 0},
+ {"read", Tcl_ReadObjCmd, (CompileProc *) NULL, 1},
+ {"seek", Tcl_SeekObjCmd, (CompileProc *) NULL, 1},
+ {"socket", Tcl_SocketObjCmd, (CompileProc *) NULL, 0},
+ {"tell", Tcl_TellObjCmd, (CompileProc *) NULL, 1},
+ {"time", Tcl_TimeObjCmd, (CompileProc *) NULL, 1},
+ {"update", Tcl_UpdateObjCmd, (CompileProc *) NULL, 1},
+ {"vwait", Tcl_VwaitObjCmd, (CompileProc *) NULL, 1},
+ {"exec", Tcl_ExecObjCmd, (CompileProc *) NULL, 0},
+ {"source", Tcl_SourceObjCmd, (CompileProc *) NULL, 0},
#endif /* TCL_GENERIC_ONLY */
- {NULL, (Tcl_CmdProc *) NULL, (Tcl_ObjCmdProc *) NULL,
- (CompileProc *) NULL, 0}
+ {NULL, (Tcl_ObjCmdProc *) NULL, (CompileProc *) NULL, 0}
};
-static const CmdInfo clockCmds [] = {
- /*
- * Commands in the '::tcl::clock' namespace that support the
- * 'clock' ensemble
- */
-
- { "::tcl::clock::clicks", (Tcl_CmdProc*) NULL,
- TclClockClicksObjCmd, (CompileProc*) NULL, 0 },
- { "::tcl::clock::microseconds", (Tcl_CmdProc*) NULL,
- TclClockMicrosecondsObjCmd, (CompileProc*) NULL, 0 },
- { "::tcl::clock::milliseconds", (Tcl_CmdProc*) NULL,
- TclClockMillisecondsObjCmd, (CompileProc*) NULL, 0 },
- { "::tcl::clock::seconds", (Tcl_CmdProc*) NULL,
- TclClockSecondsObjCmd, (CompileProc*) NULL, 0 },
- { "::tcl::clock::Localtime", (Tcl_CmdProc*) NULL,
- TclClockLocaltimeObjCmd, (CompileProc*) NULL, 0 },
- { "::tcl::clock::Mktime", (Tcl_CmdProc*) NULL,
- TclClockMktimeObjCmd, (CompileProc*) NULL, 0 },
- { "::tcl::clock::Oldscan", (Tcl_CmdProc*) NULL,
- TclClockOldscanObjCmd, (CompileProc*) NULL, 0 },
- { NULL, (Tcl_CmdProc *) NULL,
- (Tcl_ObjCmdProc *) NULL, (CompileProc *) NULL, 0 }
-};
/*
*----------------------------------------------------------------------
@@ -450,15 +341,13 @@ Tcl_CreateInterp()
* but no Tcl_CmdProc, set the Tcl_CmdProc to TclInvokeObjectCommand.
*/
- for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL;
- cmdInfoPtr++) {
+ for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) {
int new;
Tcl_HashEntry *hPtr;
- if ((cmdInfoPtr->proc == (Tcl_CmdProc *) NULL)
- && (cmdInfoPtr->objProc == (Tcl_ObjCmdProc *) NULL)
+ if ((cmdInfoPtr->objProc == (Tcl_ObjCmdProc *) NULL)
&& (cmdInfoPtr->compileProc == (CompileProc *) NULL)) {
- Tcl_Panic("Tcl_CreateInterp: builtin command with NULL string and object command procs and a NULL compile proc\n");
+ Tcl_Panic("Tcl_CreateInterp: builtin command with NULL object command proc and a NULL compile proc\n");
}
hPtr = Tcl_CreateHashEntry(&iPtr->globalNsPtr->cmdTable,
@@ -470,20 +359,10 @@ Tcl_CreateInterp()
cmdPtr->refCount = 1;
cmdPtr->cmdEpoch = 0;
cmdPtr->compileProc = cmdInfoPtr->compileProc;
- if (cmdInfoPtr->proc == (Tcl_CmdProc *) NULL) {
- cmdPtr->proc = TclInvokeObjectCommand;
- cmdPtr->clientData = (ClientData) cmdPtr;
- } else {
- cmdPtr->proc = cmdInfoPtr->proc;
- cmdPtr->clientData = (ClientData) NULL;
- }
- if (cmdInfoPtr->objProc == (Tcl_ObjCmdProc *) NULL) {
- cmdPtr->objProc = TclInvokeStringCommand;
- cmdPtr->objClientData = (ClientData) cmdPtr;
- } else {
- cmdPtr->objProc = cmdInfoPtr->objProc;
- cmdPtr->objClientData = (ClientData) NULL;
- }
+ cmdPtr->proc = TclInvokeObjectCommand;
+ cmdPtr->clientData = (ClientData) cmdPtr;
+ cmdPtr->objProc = cmdInfoPtr->objProc;
+ cmdPtr->objClientData = (ClientData) NULL;
cmdPtr->deleteProc = NULL;
cmdPtr->deleteData = (ClientData) NULL;
cmdPtr->flags = 0;
@@ -498,18 +377,27 @@ Tcl_CreateInterp()
* Tcl_CreateObjCommand, since they aren't in the global namespace.
*/
- for ( cmdInfoPtr = clockCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) {
- if ( cmdInfoPtr->objProc == NULL ) {
- Tcl_CreateCommand( interp, cmdInfoPtr->name,
- cmdInfoPtr->proc, (ClientData) NULL,
- (Tcl_CmdDeleteProc*) NULL );
- } else {
- Tcl_CreateObjCommand( interp, cmdInfoPtr->name,
- cmdInfoPtr->objProc, (ClientData) NULL,
- (Tcl_CmdDeleteProc*) NULL );
- }
- }
-
+ Tcl_CreateObjCommand( interp, "::tcl::clock::clicks",
+ TclClockClicksObjCmd, (ClientData) NULL,
+ (Tcl_CmdDeleteProc*) NULL );
+ Tcl_CreateObjCommand( interp, "::tcl::clock::microseconds",
+ TclClockMicrosecondsObjCmd, (ClientData) NULL,
+ (Tcl_CmdDeleteProc*) NULL );
+ Tcl_CreateObjCommand( interp, "::tcl::clock::milliseconds",
+ TclClockMillisecondsObjCmd, (ClientData) NULL,
+ (Tcl_CmdDeleteProc*) NULL );
+ Tcl_CreateObjCommand( interp, "::tcl::clock::seconds",
+ TclClockSecondsObjCmd, (ClientData) NULL,
+ (Tcl_CmdDeleteProc*) NULL );
+ Tcl_CreateObjCommand( interp, "::tcl::clock::Localtime",
+ TclClockLocaltimeObjCmd, (ClientData) NULL,
+ (Tcl_CmdDeleteProc*) NULL );
+ Tcl_CreateObjCommand( interp, "::tcl::clock::Mktime",
+ TclClockMktimeObjCmd, (ClientData) NULL,
+ (Tcl_CmdDeleteProc*) NULL );
+ Tcl_CreateObjCommand( interp, "::tcl::clock::Oldscan",
+ TclClockOldscanObjCmd, (ClientData) NULL,
+ (Tcl_CmdDeleteProc*) NULL );
/*
* Register the builtin math functions.
@@ -655,11 +543,6 @@ TclHideUnsafeCommands(interp)
Tcl_HideCommand(interp, cmdInfoPtr->name, cmdInfoPtr->name);
}
}
- for (cmdInfoPtr = clockCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) {
- if (!cmdInfoPtr->isSafe) {
- Tcl_HideCommand(interp, cmdInfoPtr->name, cmdInfoPtr->name);
- }
- }
return TCL_OK;
}