| 1 |
#ifndef DATETIME_H |
| 2 |
#define DATETIME_H |
| 3 |
#ifdef __cplusplus |
| 4 |
extern "C" { |
| 5 |
#endif |
| 6 |
|
| 7 |
#include "cpyext_datetime.h" |
| 8 |
|
| 9 |
PyAPI_DATA(PyDateTime_CAPI*) PyDateTimeAPI; |
| 10 |
|
| 11 |
#define PyDateTime_IMPORT (PyDateTimeAPI = _PyDateTime_Import()) |
| 12 |
|
| 13 |
|
| 14 |
#define PyDateTime_TimeZone_UTC PyDateTimeAPI->TimeZone_UTC |
| 15 |
|
| 16 |
|
| 17 |
#define PyDate_FromDate(year, month, day) \ |
| 18 |
PyDateTimeAPI->Date_FromDate(year, month, day, PyDateTimeAPI->DateType) |
| 19 |
|
| 20 |
#define PyDateTime_FromDateAndTime(year, month, day, hour, min, sec, usec) \ |
| 21 |
PyDateTimeAPI->DateTime_FromDateAndTime(year, month, day, hour, \ |
| 22 |
min, sec, usec, Py_None, PyDateTimeAPI->DateTimeType) |
| 23 |
|
| 24 |
#define PyDateTime_FromDateAndTimeAndFold(year, month, day, hour, min, sec, usec, fold) \ |
| 25 |
PyDateTimeAPI->DateTime_FromDateAndTimeAndFold(year, month, day, hour, \ |
| 26 |
min, sec, usec, Py_None, fold, PyDateTimeAPI->DateTimeType) |
| 27 |
|
| 28 |
#define PyTime_FromTime(hour, minute, second, usecond) \ |
| 29 |
PyDateTimeAPI->Time_FromTime(hour, minute, second, usecond, \ |
| 30 |
Py_None, PyDateTimeAPI->TimeType) |
| 31 |
|
| 32 |
#define PyTime_FromTimeAndFold(hour, minute, second, usecond, fold) \ |
| 33 |
PyDateTimeAPI->Time_FromTimeAndFold(hour, minute, second, usecond, \ |
| 34 |
Py_None, fold, PyDateTimeAPI->TimeType) |
| 35 |
|
| 36 |
#define PyDelta_FromDSU(days, seconds, useconds) \ |
| 37 |
PyDateTimeAPI->Delta_FromDelta(days, seconds, useconds, 1, \ |
| 38 |
PyDateTimeAPI->DeltaType) |
| 39 |
|
| 40 |
#define PyTimeZone_FromOffset(offset) \ |
| 41 |
PyDateTimeAPI->TimeZone_FromTimeZone(offset, NULL) |
| 42 |
|
| 43 |
#define PyTimeZone_FromOffsetAndName(offset, name) \ |
| 44 |
PyDateTimeAPI->TimeZone_FromTimeZone(offset, name) |
| 45 |
|
| 46 |
#define PyDateTime_TimeZone_UTC PyDateTimeAPI->TimeZone_UTC |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
#define PyDateTime_DATE_GET_FOLD PyDateTime_GET_FOLD |
| 52 |
|
| 53 |
#ifdef __cplusplus |
| 54 |
} |
| 55 |
#endif |
| 56 |
#endif |