1
0

time.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef __TIME_H
  2. #define __TIME_H
  3. #pragma lib "/$M/lib/ape/libap.a"
  4. #include <stddef.h>
  5. #define CLOCKS_PER_SEC 1000
  6. /* obsolsecent, but required */
  7. #define CLK_TCK CLOCKS_PER_SEC
  8. #ifndef _CLOCK_T
  9. #define _CLOCK_T
  10. typedef long clock_t;
  11. #endif
  12. #ifndef _TIME_T
  13. #define _TIME_T
  14. typedef long time_t;
  15. #endif
  16. struct tm {
  17. int tm_sec;
  18. int tm_min;
  19. int tm_hour;
  20. int tm_mday;
  21. int tm_mon;
  22. int tm_year;
  23. int tm_wday;
  24. int tm_yday;
  25. int tm_isdst;
  26. };
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. extern clock_t clock(void);
  31. extern double difftime(time_t, time_t);
  32. extern time_t mktime(struct tm *);
  33. extern time_t time(time_t *);
  34. extern char *asctime(const struct tm *);
  35. extern char *ctime(const time_t *);
  36. extern struct tm *gmtime(const time_t *);
  37. extern struct tm *localtime(const time_t *);
  38. extern size_t strftime(char *, size_t, const char *, const struct tm *);
  39. #ifdef _REENTRANT_SOURCE
  40. extern struct tm *gmtime_r(const time_t *, struct tm *);
  41. extern struct tm *localtime_r(const time_t *, struct tm *);
  42. extern char *ctime_r(const time_t *, char *);
  43. #endif
  44. #ifdef _POSIX_SOURCE
  45. extern void tzset(void);
  46. #endif
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #ifdef _POSIX_SOURCE
  51. extern char *tzname[2];
  52. #endif
  53. #endif /* __TIME_H */