Diff
Not logged in

Differences From Artifact [1720c26bac]:

To Artifact [2da068e0b2]:


1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
19











-
+







/* 
 * tclWinTime.c --
 *
 *	Contains Windows specific versions of Tcl functions that
 *	obtain time values from the operating system.
 *
 * Copyright 1995-1998 by Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinTime.c,v 1.14.2.3 2004/05/14 21:41:12 kennykb Exp $
 * RCS: @(#) $Id: tclWinTime.c,v 1.14.2.4 2004/05/17 14:26:50 kennykb Exp $
 */

#include "tclWinInt.h"

#define SECSPERDAY (60L * 60L * 24L)
#define SECSPERYEAR (SECSPERDAY * 365L)
#define SECSPER4YEAR (SECSPERYEAR * 4L + SECSPERDAY)
1068
1069
1070
1071
1072
1073
1074
1075
1076





1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1068
1069
1070
1071
1072
1073
1074


1075
1076
1077
1078
1079
1080


1081
1082
1083
1084
1085
1086
1087







-
-
+
+
+
+
+

-
-







 * Side effects:
 *	Invokes gmtime or gmtime_r as appropriate.
 *
 *----------------------------------------------------------------------
 */

struct tm *
TclpGmtime( timePtr )
    CONST time_t *timePtr;	/* Pointer to the number of seconds
TclpGmtime( tt )
    TclpTime_t tt;
{
    CONST time_t *timePtr = (CONST time_t *) tt;
				/* Pointer to the number of seconds
				 * since the local system's epoch */

{
    /*
     * The MS implementation of gmtime is thread safe because
     * it returns the time in a block of thread-local storage,
     * and Windows does not provide a Posix gmtime_r function.
     */
    return gmtime( timePtr );
}
1099
1100
1101
1102
1103
1104
1105
1106
1107





1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1100
1101
1102
1103
1104
1105
1106


1107
1108
1109
1110
1111
1112
1113

1114
1115
1116
1117
1118
1119
1120







-
-
+
+
+
+
+


-







 * Side effects:
 *	Invokes localtime or localtime_r as appropriate.
 *
 *----------------------------------------------------------------------
 */

struct tm *
TclpLocaltime( timePtr )
    CONST time_t *timePtr;	/* Pointer to the number of seconds
TclpLocaltime( tt )
    TclpTime_t tt;
{
    CONST time_t *timePtr = (CONST time_t *) tt;
				/* Pointer to the number of seconds
				 * since the local system's epoch */

{
    /*
     * The MS implementation of localtime is thread safe because
     * it returns the time in a block of thread-local storage,
     * and Windows does not provide a Posix localtime_r function.
     */
    return localtime( timePtr );
}