time.pxd 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # http://en.wikipedia.org/wiki/C_date_and_time_functions
  2. from libc.stddef cimport wchar_t
  3. cdef extern from "<time.h>" nogil:
  4. ctypedef long clock_t
  5. ctypedef long time_t
  6. enum: CLOCKS_PER_SEC
  7. clock_t clock() # CPU time
  8. time_t time(time_t *) # wall clock time since Unix epoch
  9. cdef struct tm:
  10. int tm_sec
  11. int tm_min
  12. int tm_hour
  13. int tm_mday
  14. int tm_mon
  15. int tm_year
  16. int tm_wday
  17. int tm_yday
  18. int tm_isdst
  19. char *tm_zone
  20. long tm_gmtoff
  21. int daylight # global state
  22. long timezone
  23. char *tzname[2]
  24. void tzset()
  25. char *asctime(const tm *)
  26. char *asctime_r(const tm *, char *)
  27. char *ctime(const time_t *)
  28. char *ctime_r(const time_t *, char *)
  29. double difftime(time_t, time_t)
  30. tm *getdate(const char *)
  31. tm *gmtime(const time_t *)
  32. tm *gmtime_r(const time_t *, tm *)
  33. tm *localtime(const time_t *)
  34. tm *localtime_r(const time_t *, tm *)
  35. time_t mktime(tm *)
  36. size_t strftime(char *, size_t, const char *, const tm *)
  37. size_t wcsftime(wchar_t *str, size_t cnt, const wchar_t *fmt, tm *time)
  38. # POSIX not stdC
  39. char *strptime(const char *, const char *, tm *)