home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / famapi.zip / INCLUDE.ZIP / TIME.H < prev    next >
C/C++ Source or Header  |  1992-12-19  |  2KB  |  88 lines

  1. //
  2. //      **************************************************************
  3. //       JdeBP C++ Library Routines      General Public Licence v1.00
  4. //          Copyright (c) 1991,1992  Jonathan de Boyne Pollard
  5. //      **************************************************************
  6. //
  7. //  TIME (ANSI and POSIX)
  8. //
  9.  
  10. #if !defined(___STDDEF_H_INCLUDED)
  11. #include <_stddef.h>
  12. #endif
  13.  
  14. #ifndef __TIME_H_INCLUDED
  15.  
  16. #define CLOCKS_PER_SEC  1000        /* Clock ticks in 1 second  */
  17.  
  18. #define NULL    _NULL
  19.  
  20. #if _POSIX1_SOURCE == 1
  21. #define CLK_TCK     CLOCKS_PER_SEC  /* Archaism in first draft POSIX.1 */
  22. #endif
  23.  
  24. #ifndef _TIME_T_DEFINED
  25. typedef _Time_t time_t;
  26. #define _TIME_T_DEFINED
  27. #endif
  28.  
  29. #ifndef _CLOCK_T_DEFINED
  30. typedef _Clock_t clock_t;
  31. #define _CLOCK_T_DEFINED
  32. #endif
  33.  
  34. #ifndef _SIZE_T_DEFINED
  35. typedef _Size_t size_t;
  36. #define _SIZE_T_DEFINED
  37. #endif
  38.  
  39. #ifndef _STRUCT_TM_DEFINED
  40. struct tm {
  41.     int tm_sec;     // seconds after the minute - [0,61]
  42.     int tm_min;     // minutes after the hour   - [0,59]
  43.     int tm_hour;    // hours of the day         - [0,23]
  44.     int tm_mday;    // day of the month         - [1,31]
  45.     int tm_mon;     // months of the year       - [0,11]
  46.     int tm_year;    // years since 1900
  47.     int tm_wday;    // days since Sunday        - [0,6]
  48.     int tm_yday;    // days since January 1     - [0,365]
  49.     int tm_isdst;   // daylight savings time flag
  50. };
  51. #define _STRUCT_TM_DEFINED
  52. #endif
  53.  
  54. extern "C" {
  55.  
  56. char *  _CDECL  asctime     (const struct tm *);
  57. clock_t _CDECL  clock       (void);
  58. char *  _CDECL  ctime       (const time_t *);
  59. double  _CDECL  difftime    (time_t, time_t);
  60. struct tm * _CDECL  gmtime  (const time_t *);
  61. struct tm * _CDECL  localtime   (const time_t *);
  62. time_t  _CDECL  mktime      (struct tm *);
  63. size_t  _CDECL  strftime    (char *, size_t, const char *, const struct tm *);
  64. time_t  _CDECL  time        (time_t *);
  65.  
  66. #if _POSIX1_SOURCE > 0
  67. void    _CDECL  tzset       (void);
  68.  
  69. extern int _CDECL       daylight;   // non-zero if DST is used
  70. extern long _CDECL      timezone;   // seconds west of GMT
  71. extern char * _CDECL    _TZname[2]; // standard/daylight savings names
  72. #endif
  73.  
  74. #if _MSDOS_SOURCE > 0
  75. char *  _CDECL  _strdate    (char *);
  76. char *  _CDECL  _strtime    (char *);
  77. #endif
  78.  
  79. }
  80.  
  81. #if _POSIX1_SOURCE > 0
  82. #define tzname _TZname
  83. #endif
  84.  
  85. #define __TIME_H_INCLUDED
  86. #endif
  87.  
  88.