annotate Include/datetime.h @ 65035:87f4b32905df 2.7

Cosmetic fix to use print function.
author Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
date Fri, 01 Oct 2010 10:48:47 +0000
parents fd25030223b0
children b36cb4602e21
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
1 /* datetime.h
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
2 */
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
3
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
4 #ifndef DATETIME_H
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
5 #define DATETIME_H
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
6 #ifdef __cplusplus
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
7 extern "C" {
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
8 #endif
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
9
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
10 /* Fields are packed into successive bytes, each viewed as unsigned and
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
11 * big-endian, unless otherwise noted:
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
12 *
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
13 * byte offset
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
14 * 0 year 2 bytes, 1-9999
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
15 * 2 month 1 byte, 1-12
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
16 * 3 day 1 byte, 1-31
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
17 * 4 hour 1 byte, 0-23
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
18 * 5 minute 1 byte, 0-59
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
19 * 6 second 1 byte, 0-59
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
20 * 7 usecond 3 bytes, 0-999999
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
21 * 10
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
22 */
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
23
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
24 /* # of bytes for year, month, and day. */
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
25 #define _PyDateTime_DATE_DATASIZE 4
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
26
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
27 /* # of bytes for hour, minute, second, and usecond. */
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
28 #define _PyDateTime_TIME_DATASIZE 6
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
29
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
30 /* # of bytes for year, month, day, hour, minute, second, and usecond. */
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
31 #define _PyDateTime_DATETIME_DATASIZE 10
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
32
27217
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
33
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
34 typedef struct
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
35 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
36 PyObject_HEAD
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
37 long hashcode; /* -1 when unknown */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
38 int days; /* -MAX_DELTA_DAYS <= days <= MAX_DELTA_DAYS */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
39 int seconds; /* 0 <= seconds < 24*3600 is invariant */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
40 int microseconds; /* 0 <= microseconds < 1000000 is invariant */
27217
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
41 } PyDateTime_Delta;
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
42
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
43 typedef struct
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
44 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
45 PyObject_HEAD /* a pure abstract base clase */
27217
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
46 } PyDateTime_TZInfo;
27195
65dc0110a735 Got rid of the timetz type entirely. This was a bit trickier than I
Tim Peters <tim.peters@gmail.com>
parents: 26673
diff changeset
47
27217
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
48
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
49 /* The datetime and time types have hashcodes, and an optional tzinfo member,
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
50 * present if and only if hastzinfo is true.
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
51 */
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
52 #define _PyTZINFO_HEAD \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
53 PyObject_HEAD \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
54 long hashcode; \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
55 char hastzinfo; /* boolean flag */
27217
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
56
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
57 /* No _PyDateTime_BaseTZInfo is allocated; it's just to have something
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
58 * convenient to cast to, when getting at the hastzinfo member of objects
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
59 * starting with _PyTZINFO_HEAD.
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
60 */
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
61 typedef struct
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
62 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
63 _PyTZINFO_HEAD
27217
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
64 } _PyDateTime_BaseTZInfo;
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
65
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
66 /* All time objects are of PyDateTime_TimeType, but that can be allocated
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
67 * in two ways, with or without a tzinfo member. Without is the same as
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
68 * tzinfo == None, but consumes less memory. _PyDateTime_BaseTime is an
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
69 * internal struct used to allocate the right amount of space for the
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
70 * "without" case.
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
71 */
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
72 #define _PyDateTime_TIMEHEAD \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
73 _PyTZINFO_HEAD \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
74 unsigned char data[_PyDateTime_TIME_DATASIZE];
27217
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
75
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
76 typedef struct
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
77 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
78 _PyDateTime_TIMEHEAD
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
79 } _PyDateTime_BaseTime; /* hastzinfo false */
27217
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
80
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
81 typedef struct
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
82 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
83 _PyDateTime_TIMEHEAD
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
84 PyObject *tzinfo;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
85 } PyDateTime_Time; /* hastzinfo true */
27217
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
86
27218
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
87
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
88 /* All datetime objects are of PyDateTime_DateTimeType, but that can be
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
89 * allocated in two ways too, just like for time objects above. In addition,
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
90 * the plain date type is a base class for datetime, so it must also have
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
91 * a hastzinfo member (although it's unused there).
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
92 */
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
93 typedef struct
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
94 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
95 _PyTZINFO_HEAD
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
96 unsigned char data[_PyDateTime_DATE_DATASIZE];
27218
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
97 } PyDateTime_Date;
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
98
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
99 #define _PyDateTime_DATETIMEHEAD \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
100 _PyTZINFO_HEAD \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
101 unsigned char data[_PyDateTime_DATETIME_DATASIZE];
27217
10b7e60245b5 Minor fiddling to make the next part easier. Introduced an internal
Tim Peters <tim.peters@gmail.com>
parents: 27195
diff changeset
102
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
103 typedef struct
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
104 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
105 _PyDateTime_DATETIMEHEAD
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
106 } _PyDateTime_BaseDateTime; /* hastzinfo false */
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
107
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
108 typedef struct
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
109 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
110 _PyDateTime_DATETIMEHEAD
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
111 PyObject *tzinfo;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
112 } PyDateTime_DateTime; /* hastzinfo true */
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
113
27195
65dc0110a735 Got rid of the timetz type entirely. This was a bit trickier than I
Tim Peters <tim.peters@gmail.com>
parents: 26673
diff changeset
114
27218
38d2238c795e Got rid of the internal datetimetz type.
Tim Peters <tim.peters@gmail.com>
parents: 27217
diff changeset
115 /* Apply for date and datetime instances. */
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
116 #define PyDateTime_GET_YEAR(o) ((((PyDateTime_Date*)o)->data[0] << 8) | \
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
117 ((PyDateTime_Date*)o)->data[1])
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
118 #define PyDateTime_GET_MONTH(o) (((PyDateTime_Date*)o)->data[2])
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
119 #define PyDateTime_GET_DAY(o) (((PyDateTime_Date*)o)->data[3])
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
120
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
121 #define PyDateTime_DATE_GET_HOUR(o) (((PyDateTime_DateTime*)o)->data[4])
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
122 #define PyDateTime_DATE_GET_MINUTE(o) (((PyDateTime_DateTime*)o)->data[5])
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
123 #define PyDateTime_DATE_GET_SECOND(o) (((PyDateTime_DateTime*)o)->data[6])
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
124 #define PyDateTime_DATE_GET_MICROSECOND(o) \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
125 ((((PyDateTime_DateTime*)o)->data[7] << 16) | \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
126 (((PyDateTime_DateTime*)o)->data[8] << 8) | \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
127 ((PyDateTime_DateTime*)o)->data[9])
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
128
27195
65dc0110a735 Got rid of the timetz type entirely. This was a bit trickier than I
Tim Peters <tim.peters@gmail.com>
parents: 26673
diff changeset
129 /* Apply for time instances. */
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
130 #define PyDateTime_TIME_GET_HOUR(o) (((PyDateTime_Time*)o)->data[0])
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
131 #define PyDateTime_TIME_GET_MINUTE(o) (((PyDateTime_Time*)o)->data[1])
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
132 #define PyDateTime_TIME_GET_SECOND(o) (((PyDateTime_Time*)o)->data[2])
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
133 #define PyDateTime_TIME_GET_MICROSECOND(o) \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
134 ((((PyDateTime_Time*)o)->data[3] << 16) | \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
135 (((PyDateTime_Time*)o)->data[4] << 8) | \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
136 ((PyDateTime_Time*)o)->data[5])
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
137
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
138
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
139 /* Define structure for C API. */
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
140 typedef struct {
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
141 /* type objects */
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
142 PyTypeObject *DateType;
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
143 PyTypeObject *DateTimeType;
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
144 PyTypeObject *TimeType;
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
145 PyTypeObject *DeltaType;
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
146 PyTypeObject *TZInfoType;
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
147
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
148 /* constructors */
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
149 PyObject *(*Date_FromDate)(int, int, int, PyTypeObject*);
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
150 PyObject *(*DateTime_FromDateAndTime)(int, int, int, int, int, int, int,
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
151 PyObject*, PyTypeObject*);
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
152 PyObject *(*Time_FromTime)(int, int, int, int, PyObject*, PyTypeObject*);
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
153 PyObject *(*Delta_FromDelta)(int, int, int, int, PyTypeObject*);
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
154
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
155 /* constructors for the DB API */
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
156 PyObject *(*DateTime_FromTimestamp)(PyObject*, PyObject*, PyObject*);
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
157 PyObject *(*Date_FromTimestamp)(PyObject*, PyObject*);
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
158
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
159 } PyDateTime_CAPI;
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
160
59998
d11fbc796499 Backported PyCapsule from 3.1, and converted most uses of
Larry Hastings <larry@hastings.org>
parents: 57720
diff changeset
161 #define PyDateTime_CAPSULE_NAME "datetime.datetime_CAPI"
d11fbc796499 Backported PyCapsule from 3.1, and converted most uses of
Larry Hastings <larry@hastings.org>
parents: 57720
diff changeset
162
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
163
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
164 /* "magic" constant used to partially protect against developer mistakes. */
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
165 #define DATETIME_API_MAGIC 0x414548d5
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
166
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
167 #ifdef Py_BUILD_CORE
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
168
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
169 /* Macros for type checking when building the Python core. */
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
170 #define PyDate_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateType)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
171 #define PyDate_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateType)
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
172
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
173 #define PyDateTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateTimeType)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
174 #define PyDateTime_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateTimeType)
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
175
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
176 #define PyTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_TimeType)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
177 #define PyTime_CheckExact(op) (Py_TYPE(op) == &PyDateTime_TimeType)
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
178
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
179 #define PyDelta_Check(op) PyObject_TypeCheck(op, &PyDateTime_DeltaType)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
180 #define PyDelta_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DeltaType)
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
181
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
182 #define PyTZInfo_Check(op) PyObject_TypeCheck(op, &PyDateTime_TZInfoType)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
183 #define PyTZInfo_CheckExact(op) (Py_TYPE(op) == &PyDateTime_TZInfoType)
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
184
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
185 #else
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
186
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
187 /* Define global variable for the C API and a macro for setting it. */
57720
6e131e071310 initialize to NULL
Benjamin Peterson <benjamin@python.org>
parents: 44351
diff changeset
188 static PyDateTime_CAPI *PyDateTimeAPI = NULL;
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
189
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
190 #define PyDateTime_IMPORT \
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
191 PyDateTimeAPI = (PyDateTime_CAPI *)PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
192
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
193 /* Macros for type checking when not building the Python core. */
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
194 #define PyDate_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateType)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
195 #define PyDate_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DateType)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
196
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
197 #define PyDateTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateTimeType)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
198 #define PyDateTime_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DateTimeType)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
199
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
200 #define PyTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TimeType)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
201 #define PyTime_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->TimeType)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
202
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
203 #define PyDelta_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DeltaType)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
204 #define PyDelta_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DeltaType)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
205
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
206 #define PyTZInfo_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TZInfoType)
44351
86a2679dca46 #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents: 42334
diff changeset
207 #define PyTZInfo_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->TZInfoType)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
208
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
209 /* Macros for accessing constructors in a simplified fashion. */
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
210 #define PyDate_FromDate(year, month, day) \
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
211 PyDateTimeAPI->Date_FromDate(year, month, day, PyDateTimeAPI->DateType)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
212
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
213 #define PyDateTime_FromDateAndTime(year, month, day, hour, min, sec, usec) \
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
214 PyDateTimeAPI->DateTime_FromDateAndTime(year, month, day, hour, \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
215 min, sec, usec, Py_None, PyDateTimeAPI->DateTimeType)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
216
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
217 #define PyTime_FromTime(hour, minute, second, usecond) \
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
218 PyDateTimeAPI->Time_FromTime(hour, minute, second, usecond, \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
219 Py_None, PyDateTimeAPI->TimeType)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
220
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
221 #define PyDelta_FromDSU(days, seconds, useconds) \
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
222 PyDateTimeAPI->Delta_FromDelta(days, seconds, useconds, 1, \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
223 PyDateTimeAPI->DeltaType)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
224
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
225 /* Macros supporting the DB API. */
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
226 #define PyDateTime_FromTimestamp(args) \
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
227 PyDateTimeAPI->DateTime_FromTimestamp( \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
228 (PyObject*) (PyDateTimeAPI->DateTimeType), args, NULL)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
229
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
230 #define PyDate_FromTimestamp(args) \
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
231 PyDateTimeAPI->Date_FromTimestamp( \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
232 (PyObject*) (PyDateTimeAPI->DateType), args)
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
233
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 59998
diff changeset
234 #endif /* Py_BUILD_CORE */
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
235
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
236 #ifdef __cplusplus
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
237 }
26673
5b715cad34d0 datetime escapes the sandbox. The Windows build is all set. I leave it
Tim Peters <tim.peters@gmail.com>
parents:
diff changeset
238 #endif
32393
e5df8c8faa09 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
Tim Peters <tim.peters@gmail.com>
parents: 27218
diff changeset
239 #endif