summaryrefslogtreecommitdiffstats
path: root/generic/tclClock.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-03-17 13:14:14 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-03-17 13:14:14 (GMT)
commitfb1a2c58ddbae29e3c1cdb08b882d008b829547d (patch)
treefbeab2daa748495cacdee97cf19bec914a8e228b /generic/tclClock.c
parent40ee63b6ff6901dea05f4cef62d51bfa188630ed (diff)
parent5617ad7c180796ca3ded40478d67504694057ee6 (diff)
downloadtcl-fb1a2c58ddbae29e3c1cdb08b882d008b829547d.zip
tcl-fb1a2c58ddbae29e3c1cdb08b882d008b829547d.tar.gz
tcl-fb1a2c58ddbae29e3c1cdb08b882d008b829547d.tar.bz2
merge trunk
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 cb04ceb..dd52e5c 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);
}
/*