diff options
author | Kevin B Kenny <kennykb@acm.org> | 2017-03-14 21:09:27 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2017-03-14 21:09:27 (GMT) |
commit | 5ddb691286f2aa5d37b524769d0267211527f155 (patch) | |
tree | eeb60a02d9afcc8c42bd5bd244cd5d95598d9c54 /generic/tclClock.c | |
parent | d4b614d6551e55fd6e1bb52a335e37657603f91c (diff) | |
download | tcl-5ddb691286f2aa5d37b524769d0267211527f155.zip tcl-5ddb691286f2aa5d37b524769d0267211527f155.tar.gz tcl-5ddb691286f2aa5d37b524769d0267211527f155.tar.bz2 |
Make 'clock' and 'encoding' into proper compilable ensembles
Diffstat (limited to 'generic/tclClock.c')
-rw-r--r-- | generic/tclClock.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c index c3b29e9..bb9fbeb 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -253,6 +253,19 @@ TclClockInit( ClockClientData *data; int i; + /* Structure of the 'clock' ensemble */ + + static const EnsembleImplMap clockImplMap[] = { + {"add", NULL, TclCompileBasicMin1ArgCmd, NULL, NULL, 0}, + {"clicks", NULL, TclCompileBasicMin0ArgCmd, NULL, NULL, 0}, + {"format", NULL, TclCompileBasicMin1ArgCmd, NULL, NULL, 0}, + {"microseconds", NULL, TclCompileBasicMin0ArgCmd, NULL, NULL, 0}, + {"milliseconds", NULL, TclCompileBasicMin0ArgCmd, NULL, NULL, 0}, + {"scan", NULL, TclCompileBasicMin1ArgCmd, NULL, NULL, 0}, + {"seconds", NULL, TclCompileBasicMin0ArgCmd, NULL, NULL, 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 +289,7 @@ TclClockInit( /* * Install the commands. + * TODO - Let Tcl_MakeEnsemble do this? */ #define TCL_CLOCK_PREFIX_LEN 14 /* == strlen("::tcl::clock::") */ @@ -286,6 +300,10 @@ TclClockInit( Tcl_CreateObjCommand(interp, cmdName, clockCmdPtr->objCmdProc, data, ClockDeleteCmdProc); } + + /* Make the clock ensemble */ + + TclMakeEnsemble(interp, "clock", clockImplMap); } /* |