timefuncs.h 567 B

1234567891011121314151617181920212223242526
  1. /* timefuncs.h
  2. */
  3. /* Utility function related to timemodule.c. */
  4. #ifndef TIMEFUNCS_H
  5. #define TIMEFUNCS_H
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /* Cast double x to time_t, but raise ValueError if x is too large
  10. * to fit in a time_t. ValueError is set on return iff the return
  11. * value is (time_t)-1 and PyErr_Occurred().
  12. */
  13. PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x);
  14. /* Get the current time since the epoch in seconds */
  15. PyAPI_FUNC(double) _PyTime_FloatTime(void);
  16. #ifdef __cplusplus
  17. }
  18. #endif
  19. #endif /* TIMEFUNCS_H */