time.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * time.h - date and time
  3. */
  4. /* $Header$ */
  5. #ifndef _TIME_HEADER_
  6. #define _TIME_HEADER_
  7. #ifndef NULL
  8. #define NULL 0
  9. #endif /* NULL */
  10. #ifdef __BSD4_2
  11. #define CLK_TCK 60 /* ticks per second */
  12. #else
  13. #define CLK_TCK 1
  14. #endif /* __BSD4_2 */
  15. #ifndef _TYPE_SIZE_
  16. #define _TYPE_SIZE_
  17. typedef unsigned int size_t; /* type returned by sizeof */
  18. #endif /* _TYPE_SIZE_ */
  19. typedef signed long time_t; /* type returned by TOD clock */
  20. typedef signed long clock_t; /* type returned by real time clock */
  21. struct tm {
  22. int tm_sec; /* seconds after the minute - [0, 59] */
  23. int tm_min; /* minutes after the hour - [0, 59] */
  24. int tm_hour; /* hours since midnight - [0, 28] */
  25. int tm_mday; /* day of the month - [1, 31] */
  26. int tm_mon; /* months since January - [0, 11] */
  27. int tm_year; /* years since 1900 */
  28. int tm_wday; /* days since Sunday - [0, 6] */
  29. int tm_yday; /* days since January 1 - [0, 365] */
  30. int tm_isdst; /* Daylight Saving Time flag */
  31. };
  32. clock_t clock(void);
  33. double difftime(time_t time1, time_t time0);
  34. time_t mktime(struct tm *timeptr);
  35. time_t time(time_t *timeptr);
  36. char *asctime(const struct tm *timeptr);
  37. char *ctime(const time_t *timer);
  38. struct tm *gmtime(const time_t *timer);
  39. struct tm *localtime(const time_t *timer);
  40. size_t strftime(char *s, size_t maxsize,
  41. const char *format,
  42. const struct tm *timeptr);
  43. #endif /* _TIME_HEADER_ */