time.h 1016 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 _POSIX_SOURCE
  40. extern void tzset(void);
  41. #endif
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #ifdef _POSIX_SOURCE
  46. extern char *tzname[2];
  47. #endif
  48. #endif /* __TIME_H */