blob: 53dd37ac352957b6839be268901949eab21eae44 [file] [log] [blame]
Alexander Belopolsky6fc4ade2010-08-05 17:34:27 +00001#ifndef Py_PYTIME_H
2#define Py_PYTIME_H
3
4#include "pyconfig.h" /* include for defines */
5
6/**************************************************************************
7Symbols and macros to supply platform-independent interfaces to time related
8functions and constants
9**************************************************************************/
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#ifdef HAVE_GETTIMEOFDAY
15typedef struct timeval _PyTime_timeval;
16#else
17typedef 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 */
26PyAPI_FUNC(void) _PyTime_gettimeofday(_PyTime_timeval *tp);
27
28/* Dummy to force linking. */
29PyAPI_FUNC(void) _PyTime_Init(void);
30
31#ifdef __cplusplus
32}
33#endif
34
35#endif /* Py_PYTIME_H */
36#ifndef Py_PYTIME_H
37#define Py_PYTIME_H
38
39#include "pyconfig.h" /* include for defines */
40
41/**************************************************************************
42Symbols and macros to supply platform-independent interfaces to time related
43functions and constants
44**************************************************************************/
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49#ifdef HAVE_GETTIMEOFDAY
50typedef struct timeval _PyTime_timeval;
51#else
52typedef struct {
53 time_t tv_sec; /* seconds since Jan. 1, 1970 */
54 long tv_usec; /* and microseconds */
55} _PyTime_timeval;
56#endif
57
58/* Similar to POSIX gettimeofday but cannot fail. If system gettimeofday
59 * fails or is not available, fall back to lower resolution clocks.
60 */
61PyAPI_FUNC(void) _PyTime_gettimeofday(_PyTime_timeval *tp);
62
63/* Dummy to force linking. */
64PyAPI_FUNC(void) _PyTime_Init(void);
65
66#ifdef __cplusplus
67}
68#endif
69
70#endif /* Py_PYTIME_H */