summaryrefslogtreecommitdiffstats
path: root/generic/tclClock.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-03-17 12:51:53 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-03-17 12:51:53 (GMT)
commitaa3b9b49e082cbda4500eba60787a80c9cfd64e2 (patch)
treef67519530b2ee952335022154250f726972d334b /generic/tclClock.c
parentba078102bb35ae671db5adb952ee48ecef4003ed (diff)
parentf2882138fdb10093e33cbe23ad4eb5dea4461e6a (diff)
downloadtcl-aa3b9b49e082cbda4500eba60787a80c9cfd64e2.zip
tcl-aa3b9b49e082cbda4500eba60787a80c9cfd64e2.tar.gz
tcl-aa3b9b49e082cbda4500eba60787a80c9cfd64e2.tar.bz2
merge 8.6
Diffstat (limited to 'generic/tclClock.c')
-rw-r--r--generic/tclClock.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c
index c3b29e9..02b2845 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -208,11 +208,7 @@ struct ClockCommand {
};
static const struct ClockCommand clockCommands[] = {
- { "clicks", ClockClicksObjCmd },
{ "getenv", ClockGetenvObjCmd },
- { "microseconds", ClockMicrosecondsObjCmd },
- { "milliseconds", ClockMillisecondsObjCmd },
- { "seconds", ClockSecondsObjCmd },
{ "Oldscan", TclClockOldscanObjCmd },
{ "ConvertLocalToUTC", ClockConvertlocaltoutcObjCmd },
{ "GetDateFields", ClockGetdatefieldsObjCmd },
@@ -253,6 +249,19 @@ TclClockInit(
ClockClientData *data;
int i;
+ /* Structure of the 'clock' ensemble */
+
+ static const EnsembleImplMap clockImplMap[] = {
+ {"add", NULL, TclCompileBasicMin1ArgCmd, NULL, NULL, 0},
+ {"clicks", ClockClicksObjCmd, TclCompileClockClicksCmd, NULL, NULL, 0},
+ {"format", NULL, TclCompileBasicMin1ArgCmd, NULL, NULL, 0},
+ {"microseconds", ClockMicrosecondsObjCmd, TclCompileClockReadingCmd, NULL, INT2PTR(1), 0},
+ {"milliseconds", ClockMillisecondsObjCmd, TclCompileClockReadingCmd, NULL, INT2PTR(2), 0},
+ {"scan", NULL, TclCompileBasicMin1ArgCmd, NULL, NULL , 0},
+ {"seconds", ClockSecondsObjCmd, TclCompileClockReadingCmd, NULL, INT2PTR(3), 0},
+ {NULL, NULL, NULL, NULL, NULL, 0}
+ };
+
/*
* Safe interps get [::clock] as alias to a master, so do not need their
* own copies of the support routines.
@@ -276,6 +285,7 @@ TclClockInit(
/*
* Install the commands.
+ * TODO - Let Tcl_MakeEnsemble do this?
*/
#define TCL_CLOCK_PREFIX_LEN 14 /* == strlen("::tcl::clock::") */
@@ -286,6 +296,10 @@ TclClockInit(
Tcl_CreateObjCommand(interp, cmdName, clockCmdPtr->objCmdProc, data,
ClockDeleteCmdProc);
}
+
+ /* Make the clock ensemble */
+
+ TclMakeEnsemble(interp, "clock", clockImplMap);
}
/*