home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-21  |  2.0 KB  |  99 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3.     Time.h
  4.     Date and time
  5.     
  6.     Copyright © Apple Computer,Inc.  1987-1991, 1993, 1994.
  7.     All Rights Reserved.
  8.  
  9. ************************************************************/
  10.  
  11.  
  12. #ifndef __TIME_H__ /* __TIME__ is a reserved preprocessor symbol */
  13. #define __TIME_H__
  14.  
  15. #ifndef NULL
  16. #define NULL 0
  17. #endif
  18.  
  19. #ifndef __size_t__
  20. #define __size_t__
  21. typedef unsigned int size_t;
  22. #endif
  23.  
  24. /*
  25.  *    Declarations
  26.  */
  27.  
  28. #define CLOCKS_PER_SEC 60
  29. typedef unsigned long int clock_t;
  30. typedef unsigned long int time_t;
  31. #ifdef powerc
  32. #pragma options align=power
  33. #endif
  34. struct tm {
  35.     int tm_sec;        /* Seconds after the minute -- [0, 61] */
  36.     int tm_min;        /* Minutes after the hour -- [0, 59] */
  37.     int tm_hour;    /* Hours after midnight -- [0, 23] */
  38.     int tm_mday;    /* Day of the month -- [1, 31] */
  39.     int tm_mon;        /* Months since January -- [0, 11] */
  40.     int tm_year;    /* Years since 1900 */
  41.     int tm_wday;    /* Days since Sunday -- [0, 6] */
  42.     int tm_yday;    /* Days since January 1 -- [0, 365] */
  43.     int tm_isdst;    /* Daylight Savings Time flag */
  44. };
  45. #ifdef powerc
  46. #pragma options align=reset
  47. #endif
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. #ifdef __CFM68K__
  54.     #ifdef UsingSharedLibs
  55.         #pragma lib_export on
  56.     #endif
  57. #endif
  58.  
  59. /*
  60.  *    Time manipulation functions
  61.  */
  62.  
  63. clock_t clock(void);                        /* function */
  64. #ifndef powerc
  65.     #define clock() __tickcount()            /* macro - use TickCount() */
  66.     pascal unsigned long __tickcount(void)
  67.         = 0xA975; 
  68. #endif /* powerc */
  69.  
  70. double  difftime(time_t time1, time_t time0);                /* function */
  71. #define difftime(time1,time0) ((long double)time1 - time0)    /* macro */
  72.  
  73. time_t mktime(struct tm *timeptr);
  74. time_t time(time_t *timer);
  75.  
  76.  
  77. /*
  78.  *    Time conversion functions
  79.  */
  80.  
  81. char *asctime (const struct tm *timeptr);
  82. char *ctime(const time_t *timer);
  83. struct tm *gmtime(const time_t *timer);
  84. struct tm *localtime(const time_t *timer);
  85. size_t strftime(char *s, size_t maxsize,
  86.                  const char *format, const struct tm *timerptr);
  87.  
  88. #ifdef __CFM68K__
  89.     #ifdef UsingSharedLibs
  90.         #pragma lib_export off
  91.     #endif
  92. #endif
  93.  
  94. #ifdef __cplusplus
  95. }
  96. #endif
  97.  
  98. #endif
  99.