Alexander Belopolsky | 6fc4ade | 2010-08-05 17:34:27 +0000 | [diff] [blame] | 1 | #ifndef Py_PYTIME_H |
| 2 | #define Py_PYTIME_H |
| 3 | |
| 4 | #include "pyconfig.h" /* include for defines */ |
| 5 | |
| 6 | /************************************************************************** |
| 7 | Symbols and macros to supply platform-independent interfaces to time related |
| 8 | functions and constants |
| 9 | **************************************************************************/ |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
| 12 | #endif |
| 13 | |
| 14 | #ifdef HAVE_GETTIMEOFDAY |
| 15 | typedef struct timeval _PyTime_timeval; |
| 16 | #else |
| 17 | typedef struct { |
| 18 | time_t tv_sec; /* seconds since Jan. 1, 1970 */ |
| 19 | long tv_usec; /* and microseconds */ |
| 20 | } _PyTime_timeval; |
| 21 | #endif |
| 22 | |
| 23 | /* Similar to POSIX gettimeofday but cannot fail. If system gettimeofday |
| 24 | * fails or is not available, fall back to lower resolution clocks. |
| 25 | */ |
| 26 | PyAPI_FUNC(void) _PyTime_gettimeofday(_PyTime_timeval *tp); |
| 27 | |
| 28 | /* Dummy to force linking. */ |
| 29 | PyAPI_FUNC(void) _PyTime_Init(void); |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | } |
| 33 | #endif |
| 34 | |
| 35 | #endif /* Py_PYTIME_H */ |