[Python-checkins] python/dist/src/Include timefuncs.h,NONE,1.1

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Sat Jun 19 22:50:17 EDT 2004


Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14933/Include

Added Files:
	timefuncs.h 
Log Message:
Bug 975996:  Add _PyTime_DoubleToTimet to C API
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.


--- NEW FILE: timefuncs.h ---
/*  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 */




More information about the Python-checkins mailing list