mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
1b6f7a9057
New include file timefuncs.h exports private API function _PyTime_DoubleToTimet() from timemodule.c. timemodule should export some other functions too (look for painful bits in datetimemodule.c). Added insane-argument checking to datetime's assorted fromtimestamp() and utcfromtimestamp() methods. Added insane-argument tests of these to test_datetime, and insane-argument tests for ctime(), localtime() and gmtime() to test_time.
24 lines
442 B
C
24 lines
442 B
C
/* timefuncs.h
|
|
*/
|
|
|
|
/* Utility function related to timemodule.c. */
|
|
|
|
#ifndef TIMEFUNCS_H
|
|
#define TIMEFUNCS_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
/* Cast double x to time_t, but raise ValueError if x is too large
|
|
* to fit in a time_t. ValueError is set on return iff the return
|
|
* value is (time_t)-1 and PyErr_Occurred().
|
|
*/
|
|
PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* TIMEFUNCS_H */
|