diff options
author | Kevin B Kenny <kennykb@acm.org> | 2004-09-27 14:31:14 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2004-09-27 14:31:14 (GMT) |
commit | b2ddd5afb45d64091bc8d01b2b113523ffd74d45 (patch) | |
tree | 8b6c18227f33530b862fb4e7970c41ca4d140197 /generic/tclClock.c | |
parent | 7ce488b19c3bc7061ea8976f1672952b4f5fd1c7 (diff) | |
download | tcl-b2ddd5afb45d64091bc8d01b2b113523ffd74d45.zip tcl-b2ddd5afb45d64091bc8d01b2b113523ffd74d45.tar.gz tcl-b2ddd5afb45d64091bc8d01b2b113523ffd74d45.tar.bz2 |
many more TIP 173 changes
Diffstat (limited to 'generic/tclClock.c')
-rw-r--r-- | generic/tclClock.c | 105 |
1 files changed, 1 insertions, 104 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c index f6edf43..e30760b 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclClock.c,v 1.33 2004/09/14 21:42:55 kennykb Exp $ + * RCS: @(#) $Id: tclClock.c,v 1.34 2004/09/27 14:31:17 kennykb Exp $ */ #include "tclInt.h" @@ -519,107 +519,4 @@ TzsetIfNecessary() } Tcl_MutexUnlock( &clockMutex ); } - -/* - *------------------------------------------------------------------------- - * - * TclClockOldscanObjCmd -- - * - * Implements the legacy 'clock scan' Tcl command when no '-format' - * option is supplied. - * - * Results: - * Returns a standard Tcl result. - * - * This function implements the 'clock scan' Tcl command when no - * -format group is present. Refer to the user documentation to see - * what it does. - * - *------------------------------------------------------------------------- - */ - -int -TclClockOldscanObjCmd( ClientData clientData, /* unused */ - Tcl_Interp* interp, /* Tcl interpreter */ - int objc, /* Parameter count */ - Tcl_Obj *CONST * objv /* Parameter vector */ - ) -{ - int index; - Tcl_Obj *CONST *objPtr; - char *scanStr; - Tcl_Obj *baseObjPtr = NULL; - int useGMT = 0; - unsigned long baseClock; - unsigned long clockVal; - long zone; - Tcl_Obj *resultPtr; - int dummy; - - static CONST char *scanSwitches[] = { - "-base", "-gmt", (char *) NULL - }; - - if ((objc < 2) || (objc > 6)) { - wrongScanArgs: - Tcl_WrongNumArgs(interp, 2, objv, - "dateString ?-base clockValue? ?-gmt boolean?"); - return TCL_ERROR; - } - objPtr = objv+2; - objc -= 2; - while (objc > 1) { - if (Tcl_GetIndexFromObj(interp, objPtr[0], scanSwitches, - "switch", 0, &index) != TCL_OK) { - return TCL_ERROR; - } - switch (index) { - case 0: /* -base */ - baseObjPtr = objPtr[1]; - break; - case 1: /* -gmt */ - if (Tcl_GetBooleanFromObj(interp, objPtr[1], - &useGMT) != TCL_OK) { - return TCL_ERROR; - } - break; - } - objPtr += 2; - objc -= 2; - } - if (objc != 0) { - goto wrongScanArgs; - } - - if (baseObjPtr != NULL) { - if (Tcl_GetLongFromObj(interp, baseObjPtr, - (long*) &baseClock) != TCL_OK) { - return TCL_ERROR; - } - } else { - baseClock = TclpGetSeconds(); - } - - if (useGMT) { - zone = -50000; /* Force GMT */ - } else { - zone = TclpGetTimeZone((unsigned long) baseClock); - } - - scanStr = Tcl_GetStringFromObj(objv[1], &dummy); - Tcl_MutexLock(&clockMutex); - if (TclGetDate(scanStr, (unsigned long) baseClock, zone, - &clockVal) < 0) { - Tcl_MutexUnlock(&clockMutex); - resultPtr = Tcl_NewObj(); - Tcl_AppendStringsToObj(resultPtr, - "unable to convert date-time string \"", - scanStr, "\"", (char *) NULL); - Tcl_SetObjResult( interp, resultPtr ); - return TCL_ERROR; - } - Tcl_MutexUnlock(&clockMutex); - Tcl_SetObjResult(interp, Tcl_NewWideIntObj( (Tcl_WideInt) clockVal ) ); - return TCL_OK; -} |