Attachment "tip73.patch" to
ticket [483500ffff]
added by
kennykb
2001-11-20 22:24:54.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcl/tcl/ChangeLog,v
retrieving revision 1.714
diff -u -r1.714 ChangeLog
--- ChangeLog 2001/11/20 09:24:55 1.714
+++ ChangeLog 2001/11/20 15:21:30
@@ -1,3 +1,38 @@
+2001-11-19 Kevin B. Kenny <[email protected]>
+
+ * doc/GetTime.3 (Tcl_GetTime):
+ * generic/tcl.decls (Tcl_GetTime):
+ * generic/tclClock.c (Tcl_ClockObjCmd):
+ * generic/tclCompile.c (TclCleanupByteCode, TclInitByteCodeObj):
+ * generic/tclCmdMZ.c (Tcl_TimeObjCmd):
+ * generic/tclUtil.c (TclpGetTime):
+ * generic/tclTest.c (GetTimesCmd):
+ * generic/tclTimer.c (Tcl_CreateTimerHandler, TimerSetupProc,
+ TimerCheckProc, TimerHandlerEventProc):
+ * mac/tclMacNotify.c (Tcl_SetTimer):
+ * mac/tclMacShLib.exp (Tcl_GetTime):
+ * mac/tclMacTime.c (Tcl_GetTime):
+ * unix/tclUnixChan.c (TclUnixWaitForFile):
+ * unix/tclUnixEvent.c (Tcl_Sleep):
+ * unix/tclUnixThrd.c (Tcl_ConditionWait):
+ * unix/tclUnixTime.c (Tcl_GetTime):
+ * win/tclWinNotify.c (Tcl_Sleep):
+ * win/tclWinTest.c (TestwinclockCmd):
+ * win/tclWinTime.c (TclpGetSeconds, TclpGetClicks, Tcl_GetTime):
+ Changed all uses of TclpGetTime to Tcl_GetTime. Added Tcl_GetTime
+ to the Stubs table and the library documentation. Added a
+ TclpGetTime in tclUtil.c for backward compatibility of
+ extensions. [TIP#73]
+
+ * generic/tclCmdMZ.c (Tcl_TimeObjCmd): Corrected an error in the
+ [time] command that caused incorrect results to be returned if the
+ total duration of all iterations exceeded 2**31 microseconds.
+ [Bug #478847]
+
+ * generic/tclInt.decls:
+ * generic/tclInt.h:
+ * generic/tclStubInit.h: Reran 'make genstubs'
+
2001-11-20 Jeff Hobbs <[email protected]>
* unix/tclUnixInit.c (TclpSetInitialEncodings): update of patch
Index: doc/GetTime.3
===================================================================
RCS file: GetTime.3
diff -N GetTime.3
--- /dev/null Thu May 24 22:33:05 2001
+++ GetTime.3 Tue Nov 20 07:21:30 2001
@@ -0,0 +1,53 @@
+'\"
+'\" Copyright (c) 2001, by Kevin B. Kenny. All rights reserved.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+'\" CVS: @(#) $Id: $
+'\"
+.so man.macros
+.TH Tcl_GetTime 3 8.4 Tcl "Tcl Library Procedures"
+.BS
+.SH NAME
+Tcl_GetTime \- get date and time
+.SH SYNOPSIS
+.nf
+\fB#include <tcl.h>\fR
+.sp
+\fBTcl_GetTime\fR(\fI timePtr \fR)
+.SH ARGUMENTS
+.AS "Tcl_Time *" timePtr
+.AP "Tcl_Time *" timePtr out
+Points to memory in which to store the date and time information.
+.BE
+.SH DESCRIPTION
+.PP
+The \fBTcl_GetTime\fR function retrieves the current time as a
+\fITcl_Time\fR structure in memory the caller provides. This
+structure has the following definition:
+.CS
+typedef struct Tcl_Time {
+ long sec;
+ long usec;
+} Tcl_Time;
+.CE
+.PP
+On return, the \fIsec\fR member of the structure is filled in with the
+number of seconds that have elapsed since the \fIepoch:\fR the epoch
+is the point in time of 00:00 UTC, 1 January 1970. This number does
+\fInot\fR count leap seconds \- an interval of one day advances it by
+86400 seconds regardless of whether a leap second has been inserted.
+.PP
+The \fIusec\fR member of the structure is filled in with the number of
+microseconds that have elapsed since the start of the second
+designated by \fIsec\fR. The Tcl library makes every effort to keep
+this number as precise as possible, subject to the limitations of the
+computer system. On multiprocessor variants of Windows, this number
+may be limited to the 10- or 20-ms granularity of the system clock.
+(On single-processor Windows systems, the \fIusec\fR field is derived
+from a performance counter and is highly precise.)
+.SH "SEE ALSO"
+clock
+.SH KEYWORDS
+date, time
Index: generic/tcl.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.decls,v
retrieving revision 1.65
diff -u -r1.65 tcl.decls
--- generic/tcl.decls 2001/10/16 05:31:17 1.65
+++ generic/tcl.decls 2001/11/20 15:21:30
@@ -1687,7 +1687,12 @@
declare 481 generic {
int Tcl_EvalTokensStandard(Tcl_Interp *interp, Tcl_Token *tokenPtr, int count)
}
-
+
+# New export due to TIP#73
+declare 482 generic {
+ void Tcl_GetTime( Tcl_Time* timeBuf )
+}
+
##############################################################################
# Define the platform specific public Tcl interface. These functions are
Index: generic/tclClock.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclClock.c,v
retrieving revision 1.11
diff -u -r1.11 tclClock.c
--- generic/tclClock.c 2000/08/18 18:02:16 1.11
+++ generic/tclClock.c 2001/11/20 15:21:30
@@ -109,7 +109,7 @@
* We can enforce at least millisecond granularity
*/
Tcl_Time time;
- TclpGetTime(&time);
+ Tcl_GetTime(&time);
Tcl_SetLongObj(resultPtr,
(long) (time.sec*1000 + time.usec/1000));
} else {
Index: generic/tclCmdMZ.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCmdMZ.c,v
retrieving revision 1.49
diff -u -r1.49 tclCmdMZ.c
--- generic/tclCmdMZ.c 2001/11/19 14:35:54 1.49
+++ generic/tclCmdMZ.c 2001/11/20 15:21:30
@@ -2673,17 +2673,17 @@
objPtr = objv[1];
i = count;
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
while (i-- > 0) {
result = Tcl_EvalObjEx(interp, objPtr, 0);
if (result != TCL_OK) {
return result;
}
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
- totalMicroSec =
- (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
+ totalMicroSec = ( ( (double) ( stop.sec - start.sec ) ) * 1.0e6
+ + ( stop.usec - start.usec ) );
sprintf(buf, "%.0f microseconds per iteration",
((count <= 0) ? 0 : totalMicroSec/count));
Tcl_ResetResult(interp);
Index: generic/tclCompile.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCompile.c,v
retrieving revision 1.27
diff -u -r1.27 tclCompile.c
--- generic/tclCompile.c 2001/11/14 23:17:03 1.27
+++ generic/tclCompile.c 2001/11/20 15:21:31
@@ -592,7 +592,7 @@
(double) (codePtr->numAuxDataItems * sizeof(AuxData));
statsPtr->currentCmdMapBytes -= (double) codePtr->numCmdLocBytes;
- TclpGetTime(&destroyTime);
+ Tcl_GetTime(&destroyTime);
lifetimeSec = destroyTime.sec - codePtr->createTime.sec;
if (lifetimeSec > 2000) { /* avoid overflow */
lifetimeSec = 2000;
@@ -1630,7 +1630,7 @@
#ifdef TCL_COMPILE_STATS
codePtr->structureSize = structureSize
- (sizeof(size_t) + sizeof(Tcl_Time));
- TclpGetTime(&(codePtr->createTime));
+ Tcl_GetTime(&(codePtr->createTime));
RecordByteCodeStats(codePtr);
#endif /* TCL_COMPILE_STATS */
Index: generic/tclDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclDecls.h,v
retrieving revision 1.65
diff -u -r1.65 tclDecls.h
--- generic/tclDecls.h 2001/10/16 05:31:17 1.65
+++ generic/tclDecls.h 2001/11/20 15:21:32
@@ -1507,6 +1507,8 @@
EXTERN int Tcl_EvalTokensStandard _ANSI_ARGS_((
Tcl_Interp * interp, Tcl_Token * tokenPtr,
int count));
+/* 482 */
+EXTERN void Tcl_GetTime _ANSI_ARGS_((Tcl_Time* timeBuf));
typedef struct TclStubHooks {
struct TclPlatStubs *tclPlatStubs;
@@ -2048,6 +2050,7 @@
int (*tcl_OutputBuffered) _ANSI_ARGS_((Tcl_Channel chan)); /* 479 */
void (*tcl_FSMountsChanged) _ANSI_ARGS_((Tcl_Filesystem * fsPtr)); /* 480 */
int (*tcl_EvalTokensStandard) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Token * tokenPtr, int count)); /* 481 */
+ void (*tcl_GetTime) _ANSI_ARGS_((Tcl_Time* timeBuf)); /* 482 */
} TclStubs;
#ifdef __cplusplus
@@ -4015,6 +4018,10 @@
#ifndef Tcl_EvalTokensStandard
#define Tcl_EvalTokensStandard \
(tclStubsPtr->tcl_EvalTokensStandard) /* 481 */
+#endif
+#ifndef Tcl_GetTime
+#define Tcl_GetTime \
+ (tclStubsPtr->tcl_GetTime) /* 482 */
#endif
#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
Index: generic/tclInt.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.decls,v
retrieving revision 1.36
diff -u -r1.36 tclInt.decls
--- generic/tclInt.decls 2001/11/14 23:17:03 1.36
+++ generic/tclInt.decls 2001/11/20 15:21:32
@@ -301,9 +301,12 @@
declare 76 generic {
unsigned long TclpGetSeconds(void)
}
+
+# deprecated
declare 77 generic {
void TclpGetTime(Tcl_Time *time)
}
+
declare 78 generic {
int TclpGetTimeZone(unsigned long time)
}
Index: generic/tclInt.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.h,v
retrieving revision 1.69
diff -u -r1.69 tclInt.h
--- generic/tclInt.h 2001/11/14 23:17:03 1.69
+++ generic/tclInt.h 2001/11/20 15:21:32
@@ -1801,7 +1801,6 @@
EXTERN Tcl_Channel TclpGetDefaultStdChannel _ANSI_ARGS_((int type));
EXTERN long TclpGetGMTOffset _ANSI_ARGS_((void));
EXTERN unsigned long TclpGetSeconds _ANSI_ARGS_((void));
-EXTERN void TclpGetTime _ANSI_ARGS_((Tcl_Time *time));
EXTERN int TclpGetTimeZone _ANSI_ARGS_((unsigned long time));
EXTERN char * TclpGetUserHome _ANSI_ARGS_((CONST char *name,
Tcl_DString *bufferPtr));
Index: generic/tclStubInit.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclStubInit.c,v
retrieving revision 1.63
diff -u -r1.63 tclStubInit.c
--- generic/tclStubInit.c 2001/11/14 23:17:04 1.63
+++ generic/tclStubInit.c 2001/11/20 15:21:32
@@ -882,6 +882,7 @@
Tcl_OutputBuffered, /* 479 */
Tcl_FSMountsChanged, /* 480 */
Tcl_EvalTokensStandard, /* 481 */
+ Tcl_GetTime, /* 482 */
};
/* !END!: Do not edit above this line. */
Index: generic/tclTest.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclTest.c,v
retrieving revision 1.32
diff -u -r1.32 tclTest.c
--- generic/tclTest.c 2001/09/28 01:21:53 1.32
+++ generic/tclTest.c 2001/11/20 15:21:32
@@ -3627,54 +3627,54 @@
/* alloc & free 100000 times */
fprintf(stderr, "alloc & free 100000 6 word items\n");
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
objPtr = (Tcl_Obj *) ckalloc(sizeof(Tcl_Obj));
ckfree((char *) objPtr);
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per alloc+free\n", timePer/100000);
/* alloc 5000 times */
fprintf(stderr, "alloc 5000 6 word items\n");
objv = (Tcl_Obj **) ckalloc(5000 * sizeof(Tcl_Obj *));
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 5000; i++) {
objv[i] = (Tcl_Obj *) ckalloc(sizeof(Tcl_Obj));
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per alloc\n", timePer/5000);
/* free 5000 times */
fprintf(stderr, "free 5000 6 word items\n");
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 5000; i++) {
ckfree((char *) objv[i]);
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per free\n", timePer/5000);
/* Tcl_NewObj 5000 times */
fprintf(stderr, "Tcl_NewObj 5000 times\n");
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 5000; i++) {
objv[i] = Tcl_NewObj();
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per Tcl_NewObj\n", timePer/5000);
/* Tcl_DecrRefCount 5000 times */
fprintf(stderr, "Tcl_DecrRefCount 5000 times\n");
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 5000; i++) {
objPtr = objv[i];
Tcl_DecrRefCount(objPtr);
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per Tcl_DecrRefCount\n", timePer/5000);
ckfree((char *) objv);
@@ -3682,24 +3682,24 @@
/* TclGetString 100000 times */
fprintf(stderr, "TclGetStringFromObj of \"12345\" 100000 times\n");
objPtr = Tcl_NewStringObj("12345", -1);
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
(void) TclGetString(objPtr);
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per TclGetStringFromObj of \"12345\"\n",
timePer/100000);
/* Tcl_GetIntFromObj 100000 times */
fprintf(stderr, "Tcl_GetIntFromObj of \"12345\" 100000 times\n");
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
if (Tcl_GetIntFromObj(interp, objPtr, &n) != TCL_OK) {
return TCL_ERROR;
}
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per Tcl_GetIntFromObj of \"12345\"\n",
timePer/100000);
@@ -3707,63 +3707,63 @@
/* Tcl_GetInt 100000 times */
fprintf(stderr, "Tcl_GetInt of \"12345\" 100000 times\n");
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
if (Tcl_GetInt(interp, "12345", &n) != TCL_OK) {
return TCL_ERROR;
}
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per Tcl_GetInt of \"12345\"\n",
timePer/100000);
/* sprintf 100000 times */
fprintf(stderr, "sprintf of 12345 100000 times\n");
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
sprintf(newString, "%d", 12345);
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per sprintf of 12345\n",
timePer/100000);
/* hashtable lookup 100000 times */
fprintf(stderr, "hashtable lookup of \"gettimes\" 100000 times\n");
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
(void) Tcl_FindHashEntry(&iPtr->globalNsPtr->cmdTable, "gettimes");
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per hashtable lookup of \"gettimes\"\n",
timePer/100000);
/* Tcl_SetVar 100000 times */
fprintf(stderr, "Tcl_SetVar of \"12345\" 100000 times\n");
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
s = Tcl_SetVar(interp, "a", "12345", TCL_LEAVE_ERR_MSG);
if (s == NULL) {
return TCL_ERROR;
}
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per Tcl_SetVar of a to \"12345\"\n",
timePer/100000);
/* Tcl_GetVar 100000 times */
fprintf(stderr, "Tcl_GetVar of a==\"12345\" 100000 times\n");
- TclpGetTime(&start);
+ Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
s = Tcl_GetVar(interp, "a", TCL_LEAVE_ERR_MSG);
if (s == NULL) {
return TCL_ERROR;
}
}
- TclpGetTime(&stop);
+ Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per Tcl_GetVar of a==\"12345\"\n",
timePer/100000);
Index: generic/tclTimer.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclTimer.c,v
retrieving revision 1.3
diff -u -r1.3 tclTimer.c
--- generic/tclTimer.c 1999/04/16 00:46:54 1.3
+++ generic/tclTimer.c 2001/11/20 15:21:32
@@ -224,7 +224,7 @@
* Compute when the event should fire.
*/
- TclpGetTime(&time);
+ Tcl_GetTime(&time);
timerHandlerPtr->time.sec = time.sec + milliseconds/1000;
timerHandlerPtr->time.usec = time.usec + (milliseconds%1000)*1000;
if (timerHandlerPtr->time.usec >= 1000000) {
@@ -350,7 +350,7 @@
* Compute the timeout for the next timer on the list.
*/
- TclpGetTime(&blockTime);
+ Tcl_GetTime(&blockTime);
blockTime.sec = tsdPtr->firstTimerHandlerPtr->time.sec - blockTime.sec;
blockTime.usec = tsdPtr->firstTimerHandlerPtr->time.usec -
blockTime.usec;
@@ -401,7 +401,7 @@
* Compute the timeout for the next timer on the list.
*/
- TclpGetTime(&blockTime);
+ Tcl_GetTime(&blockTime);
blockTime.sec = tsdPtr->firstTimerHandlerPtr->time.sec - blockTime.sec;
blockTime.usec = tsdPtr->firstTimerHandlerPtr->time.usec -
blockTime.usec;
@@ -500,7 +500,7 @@
tsdPtr->timerPending = 0;
currentTimerId = tsdPtr->lastTimerId;
- TclpGetTime(&time);
+ Tcl_GetTime(&time);
while (1) {
nextPtrPtr = &tsdPtr->firstTimerHandlerPtr;
timerHandlerPtr = tsdPtr->firstTimerHandlerPtr;
Index: generic/tclUtil.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclUtil.c,v
retrieving revision 1.25
diff -u -r1.25 tclUtil.c
--- generic/tclUtil.c 2001/11/14 23:17:04 1.25
+++ generic/tclUtil.c 2001/11/20 15:21:32
@@ -2453,3 +2453,29 @@
{
return (tclExecutableName);
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclpGetTime --
+ *
+ * Deprecated synonym for Tcl_GetTime.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Stores current time in the buffer designated by "timePtr"
+ *
+ * This procedure is provided for the benefit of extensions written
+ * before Tcl_GetTime was exported from the library.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TclpGetTime( timePtr )
+ Tcl_Time* timePtr;
+{
+ Tcl_GetTime( timePtr );
+}
Index: mac/tclMacNotify.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacNotify.c,v
retrieving revision 1.6
diff -u -r1.6 tclMacNotify.c
--- mac/tclMacNotify.c 1999/08/10 04:21:40 1.6
+++ mac/tclMacNotify.c 2001/11/20 15:21:33
@@ -351,7 +351,7 @@
* Compute when the timer should fire.
*/
- TclpGetTime(¬ifier.timer);
+ Tcl_GetTime(¬ifier.timer);
notifier.timer.sec += timePtr->sec;
notifier.timer.usec += timePtr->usec;
if (notifier.timer.usec >= 1000000) {
Index: mac/tclMacShLib.exp
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacShLib.exp,v
retrieving revision 1.4
diff -u -r1.4 tclMacShLib.exp
--- mac/tclMacShLib.exp 2001/08/30 08:53:15 1.4
+++ mac/tclMacShLib.exp 2001/11/20 15:21:33
@@ -510,6 +510,7 @@
Tcl_GetStdChannel
Tcl_GetStringFromObj
Tcl_GetStringResult
+Tcl_GetTime
Tcl_GetVar
Tcl_GetVar2
Tcl_GetVariableFullName
Index: mac/tclMacTime.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacTime.c,v
retrieving revision 1.4
diff -u -r1.4 tclMacTime.c
--- mac/tclMacTime.c 2001/07/31 19:12:07 1.4
+++ mac/tclMacTime.c 2001/11/20 15:21:33
@@ -19,7 +19,7 @@
#include <time.h>
/*
- * Static variables used by the TclpGetTime function.
+ * Static variables used by the Tcl_GetTime function.
*/
static int initalized = false;
@@ -173,7 +173,7 @@
/*
*----------------------------------------------------------------------
*
- * TclpGetTime --
+ * Tcl_GetTime --
*
* Gets the current system time in seconds and microseconds
* since the beginning of the epoch: 00:00 UCT, January 1, 1970.
@@ -188,7 +188,7 @@
*/
void
-TclpGetTime(
+Tcl_GetTime(
Tcl_Time *timePtr) /* Location to store time information. */
{
UnsignedWide micro;
Index: unix/tclUnixChan.c
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tclUnixChan.c,v
retrieving revision 1.22
diff -u -r1.22 tclUnixChan.c
--- unix/tclUnixChan.c 2001/10/25 15:50:49 1.22
+++ unix/tclUnixChan.c 2001/11/20 15:21:33
@@ -2706,7 +2706,7 @@
*/
if (timeout > 0) {
- TclpGetTime(&now);
+ Tcl_GetTime(&now);
abortTime.sec = now.sec + timeout/1000;
abortTime.usec = now.usec + (timeout%1000)*1000;
if (abortTime.usec >= 1000000) {
@@ -2796,7 +2796,7 @@
* The select returned early, so we need to recompute the timeout.
*/
- TclpGetTime(&now);
+ Tcl_GetTime(&now);
if ((abortTime.sec < now.sec)
|| ((abortTime.sec == now.sec)
&& (abortTime.usec <= now.usec))) {
Index: unix/tclUnixEvent.c
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tclUnixEvent.c,v
retrieving revision 1.3
diff -u -r1.3 tclUnixEvent.c
--- unix/tclUnixEvent.c 1999/04/16 00:48:04 1.3
+++ unix/tclUnixEvent.c 2001/11/20 15:21:33
@@ -44,7 +44,7 @@
* early, go back to sleep again.
*/
- TclpGetTime(&before);
+ Tcl_GetTime(&before);
after = before;
after.sec += ms/1000;
after.usec += (ms%1000)*1000;
@@ -71,6 +71,6 @@
}
(void) select(0, (SELECT_MASK *) 0, (SELECT_MASK *) 0,
(SELECT_MASK *) 0, &delay);
- TclpGetTime(&before);
+ Tcl_GetTime(&before);
}
}
Index: unix/tclUnixThrd.c
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tclUnixThrd.c,v
retrieving revision 1.14
diff -u -r1.14 tclUnixThrd.c
--- unix/tclUnixThrd.c 2001/03/29 19:29:22 1.14
+++ unix/tclUnixThrd.c 2001/11/20 15:21:33
@@ -688,7 +688,7 @@
* current time, including possible overflow situations. [Bug #411603]
*/
- TclpGetTime(&now);
+ Tcl_GetTime(&now);
ptime.tv_sec = timePtr->sec + now.sec +
(timePtr->usec + now.usec) / 1000000;
ptime.tv_nsec = 1000 * ((timePtr->usec + now.usec) % 1000000);
Index: unix/tclUnixTime.c
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tclUnixTime.c,v
retrieving revision 1.11
diff -u -r1.11 tclUnixTime.c
--- unix/tclUnixTime.c 2001/04/10 18:32:39 1.11
+++ unix/tclUnixTime.c 2001/11/20 15:21:33
@@ -240,7 +240,7 @@
/*
*----------------------------------------------------------------------
*
- * TclpGetTime --
+ * Tcl_GetTime --
*
* Gets the current system time in seconds and microseconds
* since the beginning of the epoch: 00:00 UCT, January 1, 1970.
@@ -255,7 +255,7 @@
*/
void
-TclpGetTime(timePtr)
+Tcl_GetTime(timePtr)
Tcl_Time *timePtr; /* Location to store time information. */
{
struct timeval tv;
Index: win/tclWinNotify.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinNotify.c,v
retrieving revision 1.8
diff -u -r1.8 tclWinNotify.c
--- win/tclWinNotify.c 2001/09/20 18:34:22 1.8
+++ win/tclWinNotify.c 2001/11/20 15:21:33
@@ -521,7 +521,7 @@
Tcl_Time desired; /* Desired wakeup time */
int sleepTime = ms; /* Time to sleep */
- TclpGetTime( &now );
+ Tcl_GetTime( &now );
desired.sec = now.sec + ( ms / 1000 );
desired.usec = now.usec + 1000 * ( ms % 1000 );
if ( desired.usec > 1000000 ) {
@@ -531,7 +531,7 @@
for ( ; ; ) {
Sleep( sleepTime );
- TclpGetTime( &now );
+ Tcl_GetTime( &now );
if ( now.sec > desired.sec ) {
break;
} else if ( ( now.sec == desired.sec )
Index: win/tclWinTest.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinTest.c,v
retrieving revision 1.5
diff -u -r1.5 tclWinTest.c
--- win/tclWinTest.c 2000/11/21 21:33:43 1.5
+++ win/tclWinTest.c 2001/11/20 15:21:33
@@ -244,7 +244,7 @@
return TCL_ERROR;
}
- TclpGetTime( &tclTime );
+ Tcl_GetTime( &tclTime );
GetSystemTimeAsFileTime( &sysTime );
t1.LowPart = posixEpoch.dwLowDateTime;
t1.HighPart = posixEpoch.dwHighDateTime;
Index: win/tclWinTime.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinTime.c,v
retrieving revision 1.8
diff -u -r1.8 tclWinTime.c
--- win/tclWinTime.c 2001/09/06 11:48:44 1.8
+++ win/tclWinTime.c 2001/11/20 15:21:33
@@ -131,7 +131,7 @@
TclpGetSeconds()
{
Tcl_Time t;
- TclpGetTime( &t );
+ Tcl_GetTime( &t );
return t.sec;
}
@@ -159,14 +159,14 @@
TclpGetClicks()
{
/*
- * Use the TclpGetTime abstraction to get the time in microseconds,
+ * Use the Tcl_GetTime abstraction to get the time in microseconds,
* as nearly as we can, and return it.
*/
Tcl_Time now; /* Current Tcl time */
unsigned long retval; /* Value to return */
- TclpGetTime( &now );
+ Tcl_GetTime( &now );
retval = ( now.sec * 1000000 ) + now.usec;
return retval;
@@ -205,7 +205,7 @@
/*
*----------------------------------------------------------------------
*
- * TclpGetTime --
+ * Tcl_GetTime --
*
* Gets the current system time in seconds and microseconds
* since the beginning of the epoch: 00:00 UCT, January 1, 1970.
@@ -226,7 +226,7 @@
*/
void
-TclpGetTime(timePtr)
+Tcl_GetTime(timePtr)
Tcl_Time *timePtr; /* Location to store time information. */
{