home *** CD-ROM | disk | FTP | other *** search
/ Practical Programming in Tcl & Tk (4th Edition) / TCLBOOK4.BIN / pc / exsource.old / 47_1.c < prev    next >
Text File  |  2003-04-15  |  704b  |  31 lines

  1. /*
  2.  * Example 47-1
  3.  * The Clock_Init procedure.
  4.  */
  5.  
  6. int ClockCmd(ClientData clientData,
  7.                 Tcl_Interp *interp,
  8.                 int argc, char *argv[]);
  9. int ClockObjCmd(ClientData clientData,
  10.                 Tcl_Interp *interp,
  11.                 int objc, Tcl_Obj *CONST objv[]);
  12. void ClockObjDelete(ClientData clientData);
  13.  
  14. /*
  15. * Clock_Init is called when the package is loaded.
  16. */
  17.  
  18. int Clock_Init(Tcl_Interp *interp) {
  19.     if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
  20.         return TCL_ERROR;
  21.     }
  22.     Tcl_CreateCommand(interp, "wclock", ClockCmd,
  23.             (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
  24.     Tcl_CreateObjCommand(interp, "oclock", ClockObjCmd,
  25.             (ClientData)NULL, ClockObjDelete);
  26.     Tcl_PkgProvide(interp, "Tkclock", "1.0");
  27.     return TCL_OK;
  28. }
  29.  
  30.  
  31.