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 | 35636070b1b86333cfcb193a660c872f1382132a (patch) | |
tree | eeb60a02d9afcc8c42bd5bd244cd5d95598d9c54 /generic/tclClock.c | |
parent | e7d7d95f9f17dbfe2200ba4983280d293bff4ba2 (diff) | |
download | tcl-35636070b1b86333cfcb193a660c872f1382132a.zip tcl-35636070b1b86333cfcb193a660c872f1382132a.tar.gz tcl-35636070b1b86333cfcb193a660c872f1382132a.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); } /* |