time.h 960 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef __TIME
  2. #define __TIME
  3. #define CLOCKS_PER_SEC 1000000
  4. #ifndef NULL
  5. #define NULL 0
  6. #endif
  7. #if !defined(_CLOCK_T) && !defined(_CLOCK_T_)
  8. #define _CLOCK_T
  9. #define _CLOCK_T_
  10. typedef long clock_t;
  11. #endif
  12. #if !defined(_TIME_T) && !defined(_TIME_T_)
  13. #define _TIME_T
  14. #define _TIME_T_
  15. typedef long time_t;
  16. #endif
  17. #if !defined(_SIZE_T) && !defined(_SIZE_T_)
  18. #define _SIZE_T
  19. #define _SIZE_T_
  20. typedef unsigned long size_t;
  21. #endif
  22. struct tm {
  23. int tm_sec;
  24. int tm_min;
  25. int tm_hour;
  26. int tm_mday;
  27. int tm_mon;
  28. int tm_year;
  29. int tm_wday;
  30. int tm_yday;
  31. int tm_isdst;
  32. };
  33. extern clock_t clock(void);
  34. extern double difftime(time_t, time_t);
  35. extern time_t mktime(struct tm *);
  36. extern time_t time(time_t *);
  37. extern char *asctime(const struct tm *);
  38. extern char *ctime(const time_t *);
  39. extern struct tm *gmtime(const time_t *);
  40. extern struct tm *localtime(const time_t *);
  41. extern size_t strftime(char *, size_t, const char *, const struct tm *);
  42. #endif /* __TIME */