Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
2.9 KiB

  1. /***
  2. *time.h - definitions/declarations for time routines
  3. *
  4. * Copyright (c) 1985-1990, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file contains the various declarations and definitions
  8. * for the time routines.
  9. * [ANSI/System V]
  10. *
  11. ****/
  12. #if defined(_DLL) && !defined(_MT)
  13. #error Cannot define _DLL without _MT
  14. #endif
  15. #ifdef _MT
  16. #define _FAR_ _far
  17. #else
  18. #define _FAR_
  19. #endif
  20. /* implementation defined time types */
  21. #ifndef _TIME_T_DEFINED
  22. typedef long time_t;
  23. #define _TIME_T_DEFINED
  24. #endif
  25. #ifndef _CLOCK_T_DEFINED
  26. typedef long clock_t;
  27. #define _CLOCK_T_DEFINED
  28. #endif
  29. #ifndef _SIZE_T_DEFINED
  30. typedef unsigned int size_t;
  31. #define _SIZE_T_DEFINED
  32. #endif
  33. /* structure for use with localtime(), gmtime(), etc. */
  34. #ifndef _TM_DEFINED
  35. struct tm {
  36. int tm_sec; /* seconds after the minute - [0,59] */
  37. int tm_min; /* minutes after the hour - [0,59] */
  38. int tm_hour; /* hours since midnight - [0,23] */
  39. int tm_mday; /* day of the month - [1,31] */
  40. int tm_mon; /* months since January - [0,11] */
  41. int tm_year; /* years since 1900 */
  42. int tm_wday; /* days since Sunday - [0,6] */
  43. int tm_yday; /* days since January 1 - [0,365] */
  44. int tm_isdst; /* daylight savings time flag */
  45. };
  46. #define _TM_DEFINED
  47. #endif
  48. /* define NULL pointer value */
  49. #ifndef NULL
  50. #if (_MSC_VER >= 600)
  51. #define NULL ((void *)0)
  52. #elif (defined(M_I86SM) || defined(M_I86MM))
  53. #define NULL 0
  54. #else
  55. #define NULL 0L
  56. #endif
  57. #endif
  58. /* clock ticks macro - ANSI version */
  59. #define CLOCKS_PER_SEC 1000
  60. /* clock ticks macro - archaic version */
  61. #define CLK_TCK 1000
  62. /* extern declarations for the global variables used by the ctime family of
  63. * routines.
  64. */
  65. #ifdef _DLL
  66. extern int _FAR_ _cdecl daylight; /* non-zero if daylight savings time is used */
  67. extern long _FAR_ _cdecl timezone; /* difference in seconds between GMT and local time */
  68. extern char _FAR_ * _FAR_ _cdecl tzname[2]; /* standard/daylight savings time zone names */
  69. #else
  70. extern int _near _cdecl daylight; /* non-zero if daylight savings time is used */
  71. extern long _near _cdecl timezone; /* difference in seconds between GMT and local time */
  72. extern char * _near _cdecl tzname[2]; /* standard/daylight savings time zone names */
  73. #endif
  74. /* function prototypes */
  75. #ifdef _MT
  76. double _FAR_ _pascal difftime(time_t, time_t);
  77. #else
  78. double _FAR_ _cdecl difftime(time_t, time_t);
  79. #endif
  80. char _FAR_ * _FAR_ _cdecl asctime(const struct tm _FAR_ *);
  81. char _FAR_ * _FAR_ _cdecl ctime(const time_t _FAR_ *);
  82. #ifndef _WINDLL
  83. clock_t _FAR_ _cdecl clock(void);
  84. #endif
  85. struct tm _FAR_ * _FAR_ _cdecl gmtime(const time_t _FAR_ *);
  86. struct tm _FAR_ * _FAR_ _cdecl localtime(const time_t _FAR_ *);
  87. time_t _FAR_ _cdecl mktime(struct tm _FAR_ *);
  88. #ifndef _WINDLL
  89. size_t _FAR_ _cdecl strftime(char _FAR_ *, size_t, const char _FAR_ *,
  90. const struct tm _FAR_ *);
  91. #endif
  92. char _FAR_ * _FAR_ _cdecl _strdate(char _FAR_ *);
  93. char _FAR_ * _FAR_ _cdecl _strtime(char _FAR_ *);
  94. time_t _FAR_ _cdecl time(time_t _FAR_ *);
  95. void _FAR_ _cdecl tzset(void);